> ## Documentation Index
> Fetch the complete documentation index at: https://cobo.com/products/agentic-wallet/manual/llms.txt
> Use this file to discover all available pages before exploring further.

# Provision agent

> This operation provisions an agent by creating an API key. In token-based flows it also binds the agent to an owner.

Supply `token` to use the pairing code from the Cobo Agentic Wallet app (token-based provisioning). If `token` is omitted, provisioning runs in agent-first mode and returns an active agent credential.



## OpenAPI

````yaml post /api/v1/principals/provision
openapi: 3.1.0
info:
  title: Cobo Agentic Wallet Service
  description: Unified wallet engine for human and agent principals
  version: 1.3.0
servers: []
security: []
paths:
  /api/v1/principals/provision:
    post:
      tags:
        - Identity
      summary: Provision agent
      description: >-
        This operation provisions an agent by creating an API key. In
        token-based flows it also binds the agent to an owner.


        Supply `token` to use the pairing code from the Cobo Agentic Wallet app
        (token-based provisioning). If `token` is omitted, provisioning runs in
        agent-first mode and returns an active agent credential.
      operationId: provision_agent
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProvisionRequest'
        required: true
      responses:
        '200':
          description: Already exists (idempotent). Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardResponse_ProvisionResponse_'
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardResponse_ProvisionResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WrappedValidationError'
components:
  schemas:
    ProvisionRequest:
      properties:
        token:
          title: Token
          description: >-
            The pairing code from the Cobo Agentic Wallet app. If provided, runs
            token-based provisioning and binds the agent to the owner
            immediately. If omitted, runs agent-first provisioning and returns
            an active agent credential.
          type: string
          nullable: true
        invitation_code:
          title: Invitation Code
          description: An optional invitation code to apply during provisioning.
          type: string
          nullable: true
        name:
          title: Name
          description: >-
            An optional display name for the provisioned agent. Defaults to
            'Provisioned Agent' if omitted.
          type: string
          nullable: true
      type: object
      title: ProvisionRequest
      description: Request payload for agent provisioning.
    StandardResponse_ProvisionResponse_:
      properties:
        success:
          type: boolean
          title: Success
          default: true
        result:
          $ref: '#/components/schemas/ProvisionResponse'
        suggestion:
          type: string
          title: Suggestion
          default: ''
        message:
          type: string
          title: Message
          default: ''
        meta:
          $ref: '#/components/schemas/PaginationMeta'
          nullable: true
      type: object
      required:
        - result
      title: StandardResponse[ProvisionResponse]
    WrappedValidationError:
      title: WrappedValidationError
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
          default: false
          title: Success
        error:
          type: object
          title: Error
          required:
            - detail
          properties:
            detail:
              type: array
              title: Detail
              items:
                $ref: '#/components/schemas/ValidationError'
    ProvisionResponse:
      properties:
        agent_id:
          type: string
          title: Agent Id
          description: The agent's principal ID.
        api_key:
          type: string
          title: Api Key
          description: >-
            The API key for the provisioned agent. Store it securely — it is
            only returned once.
        status:
          type: string
          enum:
            - active
            - temporary
          title: Status
          description: >-
            The agent's current status. `active`: the agent is ready for use.
            `temporary`: deprecated legacy value kept for backward compatibility
            and planned for removal in a future major release.
        owner_id:
          title: Owner Id
          description: >-
            The ID of the owner principal when available (for example in
            token-based provisioning).
          type: string
          format: uuid
          nullable: true
        onboarding_session_id:
          title: Onboarding Session Id
          description: >-
            The onboarding session ID. Only set during Cobo Agentic Wallet app
            provisioning flows.
          type: string
          format: uuid
          nullable: true
      type: object
      required:
        - agent_id
        - api_key
        - status
      title: ProvisionResponse
      description: Provisioning result for both token and agent-first modes.
    PaginationMeta:
      properties:
        total:
          title: Total
          type: integer
          nullable: true
        offset:
          title: Offset
          type: integer
          nullable: true
        limit:
          title: Limit
          type: integer
          nullable: true
        has_more:
          title: Has More
          type: boolean
          nullable: true
        after:
          title: After
          type: string
          nullable: true
        before:
          title: Before
          type: string
          nullable: true
      type: object
      title: PaginationMeta
      description: |-
        Pagination metadata for list responses.

        Supports both legacy offset-based and cursor-based pagination.
        Cursor fields (``has_more``, ``after``, ``before``) are populated for
        cursor-paginated endpoints.  Legacy fields (``offset``, ``limit``) are
        populated when the caller uses the deprecated ``offset`` parameter.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````