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

# Create phone number

> Create a phone number attached to a SIP trunk. LiveKit trunks are synchronized automatically; FusionPBX linking is performed when applicable.



## OpenAPI

````yaml https://api.itellico.ai/v1/openapi.json post /v1/accounts/{account_id}/phone-numbers
openapi: 3.1.0
info:
  title: itellicoAI API v1
  version: 1.0.0
  description: >-
    Public REST API for managing accounts, agents, telephony resources, and
    conversations.


    Authentication is via API key in the `X-API-Key` header.
  termsOfService: https://itellico.ai/legal/terms-and-conditions/
  contact:
    name: itellicoAI Support
    email: support@itellico.ai
  license:
    name: Proprietary
servers:
  - url: https://api.itellico.ai
    description: Production
security:
  - APIKeyAuth: []
tags:
  - name: Accounts
    description: >-
      Identify the current account context and fetch core account metadata to
      bootstrap API usage.
  - name: Subaccounts
    description: >-
      Create and manage child accounts under a parent to model tenant
      hierarchies and delegated access.
  - name: Agents
    description: >-
      Define and configure conversational agents (model, transcriber, voice,
      behavior) used in calls and automations.
  - name: Providers
    description: >-
      Discover available AI model, transcriber, and voice catalogs for the
      current account when configuring agents.
  - name: Phone Numbers
    description: >-
      Manage BYOC phone numbers bound to your account; route inbound calls to
      agents and enable outbound calling.
  - name: SIP Trunks
    description: >-
      Manage BYOC SIP trunk connectivity (origination/termination endpoints and
      allowed IPs) used by phone numbers.
  - name: Calls
    description: >-
      Create, list, inspect, and connect voice calls across phone and web
      channels.
  - name: Conversations
    description: List and inspect conversation activity across web and telephony channels.
  - name: Analytics
    description: Usage analytics and reporting endpoints for conversation activity.
paths:
  /v1/accounts/{account_id}/phone-numbers:
    post:
      tags:
        - Phone Numbers
      summary: Create phone number
      description: >-
        Create a phone number attached to a SIP trunk. LiveKit trunks are
        synchronized automatically; FusionPBX linking is performed when
        applicable.
      operationId: createPhoneNumber
      parameters:
        - in: path
          name: account_id
          schema:
            format: uuid4
            title: Account Id
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateByocPhoneNumberDTO'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneNumberV1Out'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '502':
          description: Bad Gateway
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
      security:
        - APIKeyAuth: []
components:
  schemas:
    CreateByocPhoneNumberDTO:
      properties:
        sip_trunk_id:
          description: SIPTrunk UUID
          title: Sip Trunk Id
          type: string
        number:
          anyOf:
            - type: string
            - type: 'null'
          description: E.164 phone number
          title: Number
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: Friendly name
          title: Name
        inbound_agent_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Inbound Agent UUID
          title: Inbound Agent Id
      required:
        - sip_trunk_id
      title: CreateByocPhoneNumberDTO
      type: object
    PhoneNumberV1Out:
      properties:
        id:
          format: uuid4
          title: Id
          type: string
        number:
          anyOf:
            - type: string
            - type: 'null'
          title: Number
        sip_trunk:
          anyOf:
            - $ref: '#/components/schemas/SIPTrunkBaseV1Out'
            - type: 'null'
        inbound_agent:
          anyOf:
            - $ref: '#/components/schemas/NumberAgentV1Out'
            - type: 'null'
        spam_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Spam Data
        friendly_name:
          anyOf:
            - maxLength: 100
              type: string
            - type: 'null'
          title: Friendly Name
        tellows_data:
          anyOf:
            - type: object
            - type: 'null'
          description: >-
            Tellows spam check data including score, complaints, caller info,
            and check timestamp
          title: Tellows Data
      required:
        - id
      title: PhoneNumberV1Out
      type: object
    ErrorSchema:
      description: |-
        Standard error response payload for all API endpoints.

        Follows industry best practices (similar to Stripe, RetellAI):
        - code: Machine-readable error identifier for programmatic handling
        - message: Human-readable description for display
        - detail: Optional additional context for debugging
        - errors: Optional list of field-level validation errors
      examples:
        - code: not_found
          detail: Agent with UUID 123e4567-e89b-12d3-a456-426614174000 does not exist
          message: Resource not found
        - code: validation_error
          errors:
            - field: body.email
              message: Invalid email format
              type: value_error
            - field: body.name
              message: Field required
              type: missing
          message: Validation failed
      properties:
        code:
          description: Machine-readable error code (e.g., 'not_found', 'validation_error')
          title: Code
          type: string
        message:
          description: Human-readable error message
          title: Message
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          description: Optional detailed context for debugging
          title: Detail
        errors:
          anyOf:
            - items:
                $ref: '#/components/schemas/FieldErrorSchema'
              type: array
            - type: 'null'
          description: Field-level validation errors (for 422 responses)
          title: Errors
      required:
        - code
        - message
      title: ErrorSchema
      type: object
    SIPTrunkBaseV1Out:
      properties:
        id:
          format: uuid4
          title: Id
          type: string
        is_managed:
          title: Is Managed
          type: boolean
        name:
          description: Display name for this SIP trunk
          maxLength: 100
          title: Name
          type: string
      required:
        - id
        - is_managed
        - name
      title: SIPTrunkBaseV1Out
      type: object
    NumberAgentV1Out:
      properties:
        id:
          format: uuid4
          title: Id
          type: string
        name:
          maxLength: 200
          title: Name
          type: string
        avatar:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar
      required:
        - id
        - name
      title: NumberAgentV1Out
      type: object
    FieldErrorSchema:
      description: Schema for individual field validation errors.
      properties:
        field:
          description: Field path (e.g., 'body.name', 'query.page')
          title: Field
          type: string
        message:
          description: Human-readable error message
          title: Message
          type: string
        type:
          description: Error type (e.g., 'value_error', 'type_error')
          title: Type
          type: string
      required:
        - field
        - message
        - type
      title: FieldErrorSchema
      type: object
  securitySchemes:
    APIKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````