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

# Move an agent's inline keys into a set

> Promotes an agent's inline extraction keys into a reusable set, attaches the set to that agent, and clears the moved keys from the agent's inline config — so each key still reaches the agent exactly once.

Send exactly one of `name` (create a new set) or `set_id` (merge into an existing set). When merging, an inline key whose name already exists in the target set is a **conflict and the request is rejected with `409 EXTRACTION_KEY_CLASH`**. Pass `on_conflict: "keep_set_definition"` to opt in to dropping those inline keys in favour of the set's definition; they are then reported in `dropped_inline_keys`. Omitting `on_conflict` is *not* the same as passing it.



## OpenAPI

````yaml /openapi.json post /extraction-sets/from-agent
openapi: 3.1.0
info:
  title: Vocobase API
  version: '2.0'
  description: >-
    API for managing voice AI agents, documents, and calls on the Vocobase
    platform.
servers:
  - url: https://api.vocobase.com/api/v2
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Config
    description: >-
      Read and update account configuration, webhook settings, and telephony
      credentials.
  - name: Agents
    description: Create, read, update, and delete voice AI agents.
  - name: Voices
    description: >-
      List voice tiers, available voices, and stream preview audio for agent
      configuration.
  - name: Documents
    description: Upload, manage, and delete knowledge base documents.
  - name: Agent Documents
    description: Link and unlink documents to agents for knowledge base integration.
  - name: Calls
    description: Initiate outbound calls and view call history.
  - name: Phone Numbers
    description: >-
      Import DIDs, assign agents for inbound routing, and re-sync carrier
      Application bindings.
  - name: Inbound Routing Policies
    description: >-
      Define pre-answer routing decisions for inbound calls before AI sessions
      are created.
  - name: Telephony Connections
    description: Create, list, rename, and disconnect named V2 telephony connections.
  - name: VoiceLink Management
    description: Manage VoiceLink reseller clients, DID mapping, and readiness sync.
  - name: Projects
    description: Organize agents into projects. Every agent belongs to exactly one project.
  - name: Dictionaries
    description: Speech-recognition dictionary CRUD and agent attachment.
  - name: Sessions
    description: Browser-initiated WebRTC voice sessions for in-app voice agents.
  - name: Campaigns
    description: Batch outbound calling.
  - name: Billing
    description: Balance, transactions, and usage summaries.
  - name: Custom Functions
    description: HTTP endpoints the agent can call mid-conversation.
  - name: Extraction Sets
    description: Reusable sets of post-call extraction fields.
  - name: Lifecycle Hooks
    description: Automatic pre-call and post-call integration steps.
  - name: Messaging
    description: Bring-your-own WhatsApp sending.
  - name: Integration Logs
    description: Audit trail for integration calls.
  - name: Connectors
    description: Catalog of tools an agent can be connected to.
  - name: Customers
    description: B2B2B sub-tenants and their tool connections.
  - name: Agent Tools
    description: Binding connectors and connections to an agent.
paths:
  /extraction-sets/from-agent:
    post:
      tags:
        - Extraction Sets
      summary: Move an agent's inline keys into a set
      description: >-
        Promotes an agent's inline extraction keys into a reusable set, attaches
        the set to that agent, and clears the moved keys from the agent's inline
        config — so each key still reaches the agent exactly once.


        Send exactly one of `name` (create a new set) or `set_id` (merge into an
        existing set). When merging, an inline key whose name already exists in
        the target set is a **conflict and the request is rejected with `409
        EXTRACTION_KEY_CLASH`**. Pass `on_conflict: "keep_set_definition"` to
        opt in to dropping those inline keys in favour of the set's definition;
        they are then reported in `dropped_inline_keys`. Omitting `on_conflict`
        is *not* the same as passing it.
      operationId: extractionSetFromAgent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - agent_id
              properties:
                agent_id:
                  type: string
                  format: uuid
                name:
                  type: string
                  description: >-
                    Create a new set with this name. Mutually exclusive with
                    `set_id`.
                description:
                  type: string
                  nullable: true
                  description: Only used when creating a new set.
                set_id:
                  type: string
                  format: uuid
                  description: >-
                    Merge into this existing set. Mutually exclusive with
                    `name`.
                on_conflict:
                  type: string
                  enum:
                    - keep_set_definition
                  description: >-
                    Optional; `keep_set_definition` is the only accepted value.
                    Opt in to dropping clashing inline keys. Omit it and any
                    clash returns `409 EXTRACTION_KEY_CLASH` instead.
            example:
              agent_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
              name: Renewal outcomes
      responses:
        '201':
          description: Keys moved into the set.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    const: true
                  data:
                    allOf:
                      - $ref: '#/components/schemas/ExtractionSet'
                      - type: object
                        properties:
                          attached_agents:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                  format: uuid
                                name:
                                  type: string
                          attached_campaigns:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                  format: uuid
                                name:
                                  type: string
                          dropped_inline_keys:
                            type: array
                            items:
                              type: string
                            description: >-
                              Inline keys whose name already existed in the
                              target set. The set's definition was kept.
              example:
                success: true
                data:
                  id: es_8c7b6a59-4837-2615-0493-8271605948af
                  name: Renewal outcomes
                  description: Fields every renewal call should return
                  keys:
                    - name: will_renew
                      type: boolean
                      description: Did the customer commit to renewing?
                    - name: objection
                      type: string
                      description: Main reason given for not renewing.
                    - name: callback_date
                      type: date
                      description: Date the customer asked to be called back.
                  created_at: '2026-08-01T12:00:00.000Z'
                  updated_at: '2026-08-14T15:30:00.000Z'
                  attached_agents:
                    - id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                      name: Renewals Agent
                  attached_campaigns: []
                  dropped_inline_keys: []
        '400':
          description: '`agent_id` missing, or neither/both of `name` and `set_id` supplied.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: VALIDATION_ERROR
                  message: >-
                    Provide exactly one of name (new set) or set_id (existing
                    set)
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: >-
            `DUPLICATE_NAME` when a set with this name already exists, or
            `EXTRACTION_KEY_CLASH` when an inline key name already exists in the
            target set and `on_conflict` was not supplied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: EXTRACTION_KEY_CLASH
                  message: >-
                    'renewal_date' already defined by set 'Renewal outcomes'
                    with a possibly different type or description. Rename the
                    agent's key, or pass on_conflict: 'keep_set_definition'.
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          description: Another change to these keys is in flight. Retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: WRITE_CONFLICT
                  message: Busy — another change to these keys is in flight. Retry.
components:
  schemas:
    ExtractionSet:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type: string
          nullable: true
        keys:
          type: array
          items:
            $ref: '#/components/schemas/ExtractionKeyDef'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          const: false
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
      required:
        - success
        - error
    ExtractionKeyDef:
      type: object
      required:
        - name
        - type
      properties:
        name:
          type: string
          description: Field name in the extraction result.
        type:
          type: string
          enum:
            - string
            - number
            - integer
            - boolean
            - array
            - date
            - datetime
        description:
          type: string
          description: Tells the model what to look for.
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: UNAUTHORIZED
              message: Invalid or missing API key
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: NOT_FOUND
              message: Resource not found
    RateLimitExceeded:
      description: Per-account rate limit exceeded. Retry after a short backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: RATE_LIMITED
              message: Rate limit exceeded. Retry after 60 seconds.
    InternalError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: INTERNAL_ERROR
              message: An unexpected error occurred
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key in format: `rg_live_xxxx`. Pass as a Bearer token in the
        Authorization header.

````