TrainFog Developers
Categories

Crea una categoria

POST
/categories
AuthorizationBearer <token>

In: header

L'ID dello workspace è ereditato automaticamente dal contesto della richiesta API (es. autenticazione).

namestring
description?string
parent?string|null

ID della categoria padre, oppure null per una categoria radice.

Response Body

application/json

application/json

application/json

curl -X POST "https://api.trainfog.com/developers/v1.0/categories" \  -H "Content-Type: application/json" \  -d '{    "name": "New category name"  }'
{
  "id": "688874b1a08a60001dd72e1d",
  "name": "Test category",
  "fullPath": "Root Category > Test category",
  "description": "Second Child Category",
  "parent": "688874b1a08a60001dd72e11",
  "createdAt": "2025-07-29T07:13:53.474Z",
  "updatedAt": "2025-07-29T07:13:53.474Z"
}
{
  "error": "Unauthorized"
}
{
  "error": "Not found"
}