Documentation

Category Routes

These pages document the live category endpoints mounted under /api/categories.

GET /api/categories

Lists categories in the authenticated account's organization.

Response 200
{
  "categories": [
    {
      "id": "uuid",
      "orgId": "uuid",
      "name": "General",
      "parentId": null,
      "createdAt": "2026-03-28T00:00:00.000Z"
    }
  ]
}

GET /api/categories/:categoryId

Returns a single category in the authenticated account's organization.

Response 200
{
  "category": {
    "id": "uuid",
    "orgId": "uuid",
    "name": "General",
    "parentId": null,
    "createdAt": "2026-03-28T00:00:00.000Z"
  }
}

POST /api/categories

Creates a category in the authenticated account's organization.

Request
{
  "name": "General",
  "parentId": null
}

Response 201
{
  "category": {
    "id": "uuid",
    "orgId": "uuid",
    "name": "General",
    "parentId": null,
    "createdAt": "2026-03-28T00:00:00.000Z"
  }
}

PUT /api/categories/:categoryId

Updates a category in the authenticated account's organization.

Request
{
  "name": "Electronics",
  "parentId": "uuid"
}

Response 200
{
  "category": {
    "id": "uuid",
    "orgId": "uuid",
    "name": "Electronics",
    "parentId": "uuid",
    "createdAt": "2026-03-28T00:00:00.000Z"
  }
}

DELETE /api/categories/:categoryId

Deletes a category when no products or child categories still reference it.

Response 200
{
  "category": {
    "id": "uuid",
    "orgId": "uuid",
    "name": "General",
    "parentId": null,
    "createdAt": "2026-03-28T00:00:00.000Z"
  }
}