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

# Create Extraction Category API

> Create an extraction category and attach it to an agent via POST /agent/{agent_id}/extraction-categories; the category owns the model used for its LLM pass.

<Note>
  The category name must be unique among the agent's attached categories. Add dispositions to the category with the [Create Disposition](/docs/api-reference/dispositions/create) endpoint, passing this category's `id` as `category_id`.
</Note>


## OpenAPI

````yaml POST /agent/{agent_id}/extraction-categories
openapi: 3.1.0
info:
  title: Bolna API
  description: >-
    Use and leverage Bolna Voice AI using APIs through HTTP requests from any
    language in your applications and workflows.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.bolna.ai
    description: Production server
security:
  - bearerAuth: []
paths:
  /agent/{agent_id}/extraction-categories:
    post:
      description: >
        Create an extraction category and attach it to the agent. Attaching a
        category gives the agent all of the category's dispositions;
        dispositions are added to the category via the Dispositions API using
        `category_id`.


        The category name must be unique among the agent's attached categories.
        The `model` applies to the category's entire extraction pass — one
        category is evaluated in one LLM call.
      parameters:
        - in: path
          name: agent_id
          schema:
            type: string
            format: uuid
          required: true
          description: The agent the category is attached to.
      requestBody:
        description: Category to create.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtractionCategoryCreate'
        required: true
      responses:
        '201':
          description: Category created and attached to the agent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtractionCategory'
        '400':
          description: A category with this name is already attached to the agent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Access denied — `agent_id` is unknown or does not belong to your
            account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            Validation error — `name` or `model` is missing, `model` is not one
            of the supported extraction models, or the body carries an
            unrecognised field
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ExtractionCategoryCreate:
      type: object
      description: >-
        Request body for creating an extraction category. The category is
        attached to the agent in the URL path; attaching a category gives the
        agent all of the category's dispositions.
      required:
        - name
        - model
      properties:
        name:
          type: string
          description: Category name. Must be unique among the agent's attached categories.
          example: Lead Quality
        model:
          type: string
          description: LLM model for the category's extraction pass.
          enum:
            - gpt-4.1-mini
            - gpt-4.1-nano
            - gpt-4o-mini
            - gpt-5-mini
            - gpt-5-nano
            - gpt-5.4-mini
            - gpt-5.6-luna
            - gemini-3.5-flash
            - gemini-3.5-flash-lite
          example: gpt-4.1-mini
    ExtractionCategory:
      type: object
      description: >-
        A named set of dispositions evaluated together in a single LLM pass. The
        category owns the model used for that pass.
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the category.
          example: 9b2e8f10-4c7d-4e2a-9f31-6a8d5c1b0e42
        name:
          type: string
          description: >-
            Category name. Unique among the categories attached to the same
            agent.
          example: Lead Quality
        model:
          type: string
          description: >-
            LLM model used for the category's extraction pass. Applies to every
            disposition in the category.
          example: gpt-4.1-mini
        agent_id:
          type: string
          format: uuid
          description: The agent this category is attached to.
          example: 123e4567-e89b-12d3-a456-426614174000
        created_at:
          type: string
          format: date-time
          description: ISO timestamp when the category was created.
          example: '2026-03-01T10:00:00Z'
        updated_at:
          type: string
          format: date-time
          description: ISO timestamp when the category was last updated.
          example: '2026-03-15T14:30:00Z'
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````