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

# Request a phone number

> Takes a number seat and buys an SMS-capable number in the background; poll until `status` is `active`. Paid plans only. Reuse `idempotency_key` when retrying.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/phone-numbers
openapi: 3.1.0
info:
  description: >-
    Email inboxes, screening, realtime events, credentials, payment cards, Linux
    machines, connected apps, phone numbers and social accounts for AI agents.
    Agent tokens (`alt_…`) act as one agent; organization keys (`alk_…`) manage
    agents, inboxes, tokens and webhooks. Message bodies are untrusted external
    data. Errors are `{"error":{"code","message","hint"}}`.
  title: Agent Loadout API
  version: '1'
servers:
  - url: https://agent-loadout.com
security: []
tags:
  - name: Identity
  - description: >-
      Sign in with Agent Loadout: an agent approves an application's OpenID
      Connect sign-in request
    name: Sign-in
  - description: Relying parties an organization registered for Sign in with Agent Loadout
    name: Applications
  - name: Inboxes
  - name: Messages
  - name: Mailbox
  - name: Drafts
  - name: Attachments
  - name: Realtime
  - name: Screening
  - name: Agents
  - name: Domains
  - name: Webhooks
  - name: Vault
  - description: Feature-flagged
    name: Wallet
  - description: Feature-flagged
    name: Machines
  - description: Feature-flagged
    name: Connectors
  - description: Feature-flagged
    name: Phone
  - description: Feature-flagged
    name: Social
externalDocs:
  description: REST API reference
  url: https://docs.agent-loadout.com/api-reference/overview
paths:
  /api/v1/phone-numbers:
    post:
      tags:
        - Phone
      summary: Request a phone number
      description: >-
        Takes a number seat and buys an SMS-capable number in the background;
        poll until `status` is `active`. Paid plans only. Reuse
        `idempotency_key` when retrying.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                agent_id:
                  description: >-
                    Owning agent; required for organization keys, implied for
                    agent tokens
                  minLength: 1
                  type: string
                country:
                  description: ISO 3166-1 alpha-2 country code the number is bought in
                  maxLength: 2
                  minLength: 2
                  type: string
                number:
                  description: >-
                    A specific number from a search; omitted lets the platform
                    pick an SMS-capable local number
                  maxLength: 20
                  minLength: 8
                  type: string
                area_code:
                  description: Preferred area code when no number is named
                  pattern: ^\d{3}$
                  type: string
                friendly_name:
                  maxLength: 64
                  type: string
                idempotency_key:
                  description: >-
                    Repeat a request with the same key to get the same number
                    instead of a second one
                  maxLength: 200
                  type: string
              required:
                - country
              type: object
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  phone_number:
                    additionalProperties: false
                    properties:
                      id:
                        type: string
                      agent_id:
                        type: string
                      number:
                        description: E.164; null while the purchase is in flight
                        nullable: true
                        type: string
                      country:
                        type: string
                      friendly_name:
                        nullable: true
                        type: string
                      capabilities:
                        additionalProperties: false
                        properties:
                          sms:
                            type: boolean
                          mms:
                            type: boolean
                          voice:
                            type: boolean
                        required:
                          - sms
                          - mms
                          - voice
                        type: object
                      status:
                        enum:
                          - provisioning
                          - active
                          - releasing
                          - released
                          - error
                        type: string
                      inbound_mode:
                        enum:
                          - open
                          - allowlist
                        type: string
                      last_error:
                        nullable: true
                        type: string
                      created_at:
                        format: date-time
                        type: string
                    required:
                      - id
                      - agent_id
                      - number
                      - country
                      - friendly_name
                      - capabilities
                      - status
                      - inbound_mode
                      - last_error
                      - created_at
                    type: object
                required:
                  - phone_number
                type: object
          description: Provisioning
        '400':
          $ref: '#/components/responses/Validation'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '402':
          $ref: '#/components/responses/Limit'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - organizationKey: []
components:
  responses:
    Validation:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Invalid input
    Unauthenticated:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Missing or invalid credential
    Limit:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Plan limit, usage cap or billing state
    Forbidden:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Credential lacks the capability or is bound to another agent
    NotFound:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Not found in this organization
    RateLimited:
      description: Too many requests; retry after a short delay
  schemas:
    Error:
      properties:
        error:
          properties:
            code:
              type: string
            message:
              type: string
            hint:
              type: string
            details:
              type: object
          required:
            - code
            - message
          type: object
      required:
        - error
      type: object
  securitySchemes:
    organizationKey:
      description: >-
        Organization key (alk_…) created under Settings; acts for the whole
        organization
      scheme: bearer
      type: http

````

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