Skip to main content
POST
/
categories
Create category
curl --request POST \
  --url https://apigcp.trynia.ai/v2/categories \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "ML Papers",
  "color": "#4CAF50",
  "order": 1
}
'
{
  "id": "<string>",
  "name": "<string>",
  "user_id": "<string>",
  "organization_id": "<string>",
  "color": "<string>",
  "order": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

API key must be provided in the Authorization header

Body

application/json
name
string
required

Category name

Required string length: 1 - 50
Example:

"ML Papers"

color
string

Hex color code (e.g.,

Maximum string length: 7
Example:

"#4CAF50"

order
integer

Display order for sorting categories

Required range: x >= 0

Response

Category created successfully

id
string

Unique identifier for the category

name
string

Category name

user_id
string

Owner user ID

organization_id
string | null

Organization ID if category belongs to an organization

color
string | null

Hex color code

order
integer

Display order

created_at
string<date-time>
updated_at
string<date-time>