Categories API

Endpoints for retrieving categories and their associated posts.

GET/categories

Retrieves a list of all categories for your organization.

Response

Returns an array of category objects, each with a name and a slug.

json
[
  {
    "name": "Featured",
    "slug": "featured"
  },
  {
    "name": "Tech Guides",
    "slug": "tech-guides"
  },
  {
    "name": "Announcements",
    "slug": "announcements"
  }
]
GET/categories/{slug}

Retrieves a single category and a paginated list of its published posts.

Path Parameters

  • slugRequiredThe unique slug of the category.

Query Parameters

  • pageOptionalPage number for post pagination. Defaults to 1.
  • limitOptionalNumber of posts per page. Defaults to 10.

Response

Returns an object containing the category details and a paginated list of posts.

json
{
  "category": {
    "name": "Tech Guides",
    "slug": "tech-guides",
    "description": "In-depth tutorials and guides on modern technology."
  },
  "posts": [
    {
      "title": "How to Set Up a Production-Ready API",
      "slug": "production-api-guide",
      "excerpt": "A step-by-step guide to deploying your API with confidence...",
      "publishedAt": "2025-08-10T11:00:00.000Z",
      "author": { "name": "Admin User" }
    }
  ],
  "pagination": {
    "total": 1,
    "page": 1,
    "limit": 10,
    "pages": 1
  }
}