> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trychannel3.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Categories

> Paginated list of all categories.



## OpenAPI

````yaml get /v1/categories
openapi: 3.1.0
info:
  title: Channel3 API
  version: 0.1.0
servers:
  - url: https://api.trychannel3.com
    description: Production
security: []
paths:
  /v1/categories:
    get:
      tags:
        - v1
      summary: List Categories
      description: Paginated list of all categories.
      operationId: list_categories_public_v1_categories_get
      parameters:
        - name: roots_only
          in: query
          required: false
          schema:
            type: boolean
            description: If true, return only top-level (root) categories.
            default: false
            title: Roots Only
          description: If true, return only top-level (root) categories.
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: 1-indexed page number.
            default: 1
            title: Page
          description: 1-indexed page number.
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Items per page.
            default: 20
            title: Page Size
          description: Items per page.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedListCategoriesResponse'
        '401':
          description: Unauthorized - Invalid or missing authentication
          content:
            application/json:
              examples:
                missing_key:
                  summary: Missing API Key
                  value:
                    detail: >-
                      Unauthorized. Missing authentication key. Make sure to
                      attach an x-api-key with your request. Need help? Reach
                      out to support@trychannel3.com.
                invalid_key:
                  summary: Invalid API Key
                  value:
                    detail: >-
                      API key was provided but is invalid. Need help? Reach out
                      to support@trychannel3.com.
              schema:
                $ref: '#/components/schemas/app__routers__utils__ErrorResponse'
        '402':
          description: Payment required
          content:
            application/json:
              examples:
                credits_exhausted:
                  summary: API key out of credits
                  value:
                    detail: >-
                      You have used all of your free credits. Add a payment
                      method to continue.
                mpp_challenge:
                  summary: MPP Tempo payment required
                  value:
                    detail: >-
                      Payment required. Satisfy the MPP Tempo challenge in
                      WWW-Authenticate.
              schema:
                $ref: '#/components/schemas/app__routers__utils__ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/app__routers__utils__ErrorResponse'
              example:
                detail:
                  - loc:
                      - body
                      - query
                    msg: field required
                    type: value_error.missing
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/app__routers__utils__ErrorResponse'
              example:
                detail: Internal Server Error
      security:
        - APIKeyHeader: []
      x-codeSamples:
        - lang: python
          label: Python
          source: |
            from channel3_sdk import Channel3
            from channel3_sdk.environment import Channel3Environment

            client = Channel3(
                api_key="<value>",
                environment=Channel3Environment.PRODUCTION,
            )

            client.categories.list()
        - lang: typescript
          label: TypeScript
          source: |
            import { Channel3 } from "@channel3/sdk";

            const client = new Channel3({ apiKey: "YOUR_API_KEY" });

            const pageableResponse = await client.categories.list();
            for await (const item of pageableResponse) {
                console.log(item);
            }

            // Or you can manually iterate page-by-page
            let page = await client.categories.list();
            while (page.hasNextPage()) {
                page = page.getNextPage();
            }

            // You can also access the underlying response
            const response = page.response;
components:
  schemas:
    PaginatedListCategoriesResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/CategorySummary'
          type: array
          title: Items
          description: Categories in this page
        page:
          type: integer
          title: Page
          description: 1-indexed page number returned
        page_size:
          type: integer
          title: Page Size
          description: Number of items per page
        total:
          type: integer
          title: Total
          description: Total number of categories matching the query
      type: object
      required:
        - items
        - page
        - page_size
        - total
      title: PaginatedListCategoriesResponse
    app__routers__utils__ErrorResponse:
      properties:
        detail:
          anyOf:
            - type: string
            - items:
                additionalProperties: true
                type: object
              type: array
          title: Detail
      type: object
      required:
        - detail
      title: ErrorResponse
    CategorySummary:
      properties:
        slug:
          type: string
          title: Slug
          description: URL-friendly slug (e.g. 'sofas')
        title:
          type: string
          title: Title
          description: Human-readable category title
        path:
          items:
            $ref: '#/components/schemas/CategoryRef'
          type: array
          title: Path
          description: >-
            Hierarchical path as a structured list, root first; the last entry
            is this category itself
        has_children:
          type: boolean
          title: Has Children
          description: Whether this category has subcategories
      type: object
      required:
        - slug
        - title
        - has_children
      title: CategorySummary
      description: Lean category representation used in search hits and list rows.
    CategoryRef:
      properties:
        slug:
          type: string
          title: Slug
          description: URL-friendly slug (e.g. 'sofas')
        title:
          type: string
          title: Title
          description: Human-readable category title
      type: object
      required:
        - slug
        - title
      title: CategoryRef
      description: Lean reference to a category, used in path and children arrays.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.