Skip to content

POST/categories

Create category

Create a new category. Fields `id`, `createdAt`, `updatedAt` are auto-generated. Triggers `categories.created` webhook.

ReturnsCategory

AcceptsCategoryInput

Bearer token required

Response examples

201Category created

application/json example derived from schema

{
  "id": 1,
  "name": "Electronics",
  "slug": "electronics",
  "description": "Gadgets, devices, and electronic accessories",
  "image": "https://picsum.photos/seed/cat1/300/200",
  "productCount": 5,
  "createdAt": "2022-01-06T04:19:58.076Z"
}
400400 — invalid input or malformed JSON

application/json

{
  "error": {
    "status": 400,
    "message": "Request body required"
  }
}
413413 — body exceeds 64 KB

application/json

{
  "error": {
    "status": 413,
    "message": "Request body too large",
    "details": {
      "maxSize": "64 KB"
    }
  }
}
429429 — rate limit exceeded (120/60s)

application/json

{
  "error": {
    "status": 429,
    "message": "Too many requests",
    "details": {
      "retryAfter": 45
    }
  }
}

Released under the MIT License.