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

# List categories

> Retrieve a paginated, searchable list of the store's product categories. Requires the READ_CATEGORIES scope.

Returns the store's product categories newest first, each with a `productCount`, plus optional free-text search across name and description. The store is bound to your app token server-side — never send a shop id.


## OpenAPI

````yaml GET /categories
openapi: 3.1.0
info:
  title: Salesive Apps API — Customers & Categories
  version: 1.0.0
  description: >-
    Read and manage the store's customers and product categories from an
    installed third-party app. Every endpoint authenticates with an
    installed-app access token (prefix `app_`) and requires a specific OAuth
    scope. The target store is bound to the token server-side from the
    installation — never send a shop id.
servers:
  - url: https://api.salesive.com/api/v1
    description: Production
security:
  - AppToken: []
paths:
  /categories:
    get:
      tags:
        - Categories
      summary: List categories
      description: >-
        Returns a paginated list of the store's product categories, newest
        first, each with a productCount of products assigned to it. Supports a
        free-text search across name and description. The store is bound to the
        app token server-side from the installation — never send a shop id.
        Requires the `READ_CATEGORIES` scope.
      operationId: listCategories
      parameters:
        - name: page
          in: query
          required: false
          description: 1-based page number.
          schema:
            type: integer
            default: 1
            minimum: 1
        - name: limit
          in: query
          required: false
          description: Items per page. Defaults to 5.
          schema:
            type: integer
            default: 5
            minimum: 1
        - name: search
          in: query
          required: false
          description: >-
            Case-insensitive substring match against category name and
            description.
          schema:
            type: string
      responses:
        '200':
          description: Paginated list of categories.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/EnvelopeBase'
                  - type: object
                    properties:
                      data:
                        allOf:
                          - $ref: '#/components/schemas/PageMeta'
                          - type: object
                            properties:
                              categories:
                                type: array
                                items:
                                  $ref: '#/components/schemas/Category'
              example:
                status: 200
                success: true
                message: Categories retrieved
                data:
                  categories:
                    - _id: 6651ab12cd34ef56ab78cd90
                      name: Electronics
                      slug: electronics
                      description: Phones, audio and accessories
                      image: https://cdn.example.com/c/electronics.png
                      deleted: false
                      deletedAt: null
                      shop: 664f0e2a1c2b3d4e5f6a7b8c
                      createdAt: '2026-04-10T12:00:00.000Z'
                      updatedAt: '2026-06-01T08:00:00.000Z'
                      id: 6651ab12cd34ef56ab78cd90
                      productCount: 24
                  page: 1
                  pages: 3
                  total: 12
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  schemas:
    EnvelopeBase:
      type: object
      description: >-
        Standard Salesive response envelope. The operation-specific payload is
        carried in `data`.
      required:
        - status
        - success
        - message
      properties:
        status:
          type: integer
          description: HTTP status code, echoed in the body.
        success:
          type: boolean
          description: Whether the request succeeded.
        message:
          type: string
          description: Human-readable result message.
    PageMeta:
      type: object
      description: >-
        Flat pagination metadata returned alongside the items array on list
        responses.
      properties:
        page:
          type: integer
          description: Current page (1-based).
        pages:
          type: integer
          description: Total number of pages.
        total:
          type: integer
          description: Total number of matching items.
    Category:
      type: object
      description: >-
        A store-scoped product category. The `productCount` field is included on
        list and get responses.
      properties:
        _id:
          type: string
        id:
          type: string
          description: Virtual alias of `_id`.
        name:
          type: string
        slug:
          type: string
          description: URL-friendly slug auto-generated from the name.
        description:
          type:
            - string
            - 'null'
        image:
          type:
            - string
            - 'null'
        deleted:
          type: boolean
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
        shop:
          type: string
          description: The store id (bound server-side).
        productCount:
          type: integer
          description: Number of products assigned to this category.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Envelope:
      allOf:
        - $ref: '#/components/schemas/EnvelopeBase'
        - type: object
          properties:
            data:
              description: Operation-specific payload (object, array, or null).
  responses:
    Unauthorized:
      description: Missing or invalid app access token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 401
            success: false
            message: Authentication required
            data: null
    Forbidden:
      description: The app token is missing the OAuth scope required for this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 403
            success: false
            message: Insufficient scope
            data: null
  securitySchemes:
    AppToken:
      type: http
      scheme: bearer
      description: >-
        Installed-app access token (prefix app_), issued by the OAuth install
        flow. The store is bound to the token server-side — never send a shop
        id.

````