Overview
POST/communities/{id}/categoriescommunity

Create a category (community admin only)

Create a record in categories.

Auth: bearerAuth — calls run as the authenticated user.

Parameters
  • idpathstring
Request body

application/json · optional

  • slugstring

    Unique per community.

  • namestring
  • descriptionoptionalstring
  • coloroptionalstring

    Display color (e.g. a hex string).

  • displayOrderoptionalinteger

    Sort order within the community.

Example
{
  "slug": "string",
  "name": "string",
  "description": "string",
  "color": "string",
  "displayOrder": 0
}
Responses
201

The created category

  • idstring
  • communityIdstring
  • slugstring
  • namestring
  • descriptionoptionalstring?
  • coloroptionalstring?
  • displayOrderinteger
  • isPublicboolean
  • isArchivedboolean
  • createdAtstring
  • updatedAtstring
  • discussionCountoptionalinteger

    Live discussions filed under this category (public-only for anonymous callers).

  • lastActivityAtoptionalstring?

    Most recent activity across the category’s live discussions (null when empty).

Example
{
  "id": "string",
  "communityId": "string",
  "slug": "string",
  "name": "string",
  "description": "string",
  "color": "string",
  "displayOrder": 0,
  "isPublic": true,
  "isArchived": true,
  "createdAt": "string",
  "updatedAt": "string",
  "discussionCount": 0,
  "lastActivityAt": "string"
}
400

Error

  • erroroptionalobject
Example
{
  "error": {
    "message": "string",
    "code": "string"
  }
}
401

Error

  • erroroptionalobject
Example
{
  "error": {
    "message": "string",
    "code": "string"
  }
}
403

Error

  • erroroptionalobject
Example
{
  "error": {
    "message": "string",
    "code": "string"
  }
}
409

Error

  • erroroptionalobject
Example
{
  "error": {
    "message": "string",
    "code": "string"
  }
}
Code examples
cURL
curl -X POST "https://api.agenticdeveloperhub.com/communities/{id}/categories" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "slug": "string",
  "name": "string",
  "description": "string",
  "color": "string",
  "displayOrder": 0
}'
JavaScript
const res = await fetch("https://api.agenticdeveloperhub.com/communities/{id}/categories", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json"
  },
  body: "{\n  \"slug\": \"string\",\n  \"name\": \"string\",\n  \"description\": \"string\",\n  \"color\": \"string\",\n  \"displayOrder\": 0\n}",
});
const data = await res.json();