Skip to main content
POST
/
labels
Create a label
curl --request POST \
  --url https://app.tryordinal.com/api/v1/labels \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Engineering",
  "color": "green"
}
'
import requests

url = "https://app.tryordinal.com/api/v1/labels"

payload = {
"name": "Engineering",
"color": "green"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Engineering', color: 'green'})
};

fetch('https://app.tryordinal.com/api/v1/labels', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://app.tryordinal.com/api/v1/labels",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Engineering',
'color' => 'green'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://app.tryordinal.com/api/v1/labels"

payload := strings.NewReader("{\n \"name\": \"Engineering\",\n \"color\": \"green\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://app.tryordinal.com/api/v1/labels")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Engineering\",\n \"color\": \"green\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://app.tryordinal.com/api/v1/labels")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Engineering\",\n \"color\": \"green\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "550e8400-e29b-41d4-a716-446655440402",
  "name": "Engineering",
  "color": "#16a34a",
  "backgroundColor": "#dcfce7",
  "createdAt": "2026-01-05T10:30:00.000Z",
  "updatedAt": "2026-01-05T10:30:00.000Z"
}
{
"code": "BAD_REQUEST",
"message": "Bad Request",
"data": {
"errors": {
"publishAt": [
"Invalid date format"
],
"status": [
"Invalid enum value"
]
}
}
}
{
"code": "UNAUTHORIZED",
"message": "Invalid or unauthorized API key"
}
{
"code": "CONFLICT",
"message": "Label with name \"Marketing\" already exists"
}

Authorizations

Authorization
string
header
required

API key authentication. Generate an API key from your workspace settings.

Body

application/json
name
string
required
Minimum string length: 1
color
enum<string>
required
Available options:
yellow,
purple,
orange,
red,
brown,
green

Response

Label created

id
string<uuid>
name
string
color
string

Hex color code

backgroundColor
string

Hex background color code

createdAt
string<date-time>
updatedAt
string<date-time>