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

# Connect Phone Number

> Connect a phone number to an AI Assistant based on the ID supplied



## OpenAPI

````yaml openapi-phone-numbers PATCH /phone-numbers/{phone_number_id}
openapi: 3.0.1
info:
  title: Puretalk AI
  description: Api Documentation for Puretalk AI
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.puretalk.ai/api
security:
  - ApiKeyAuth: []
paths:
  /phone-numbers/{phone_number_id}:
    patch:
      description: Connect a phone number to an AI Assistant based on the ID supplied
      parameters:
        - name: phone_number_id
          in: path
          description: ID of phone number to connect
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ai_assistant:
                  type: string
                  description: The ID of the AI assistant to connect to the phone number
              required:
                - ai_assistant
      responses:
        '200':
          description: Phone number connected
          content:
            application/json:
              schema:
                type: object
                properties:
                  err:
                    type: boolean
                    description: Indicates if there was an error
                    example: false
                  msg:
                    type: string
                    example: AI Assistant assigned to phone number successfully.
                    description: A success message
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      required:
        - err
        - msg
      type: object
      properties:
        err:
          type: boolean
          example: true
          description: Indicates if there was an error
        msg:
          type: string
          example: An error occurred.
          description: A message describing the error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        Authorization header containing API key. You can find your API key in
        the dashboard under 'API Keys'.

````