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

# Unassign Phone Number to a Voice Agent Route



## OpenAPI

````yaml /api-reference/openapi.json post /v1/voice-agents/unassign
openapi: 3.0.1
info:
  title: Hamsa API
  description: Trying out our transcription and media-to-text APIs
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tryhamsa.com
security: []
paths:
  /v1/voice-agents/unassign:
    post:
      summary: Unassign a phone number from Voice Agents.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UnassignPhoneNumberRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnassignPhoneNumberResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '500':
          description: Server Side Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    UnassignPhoneNumberRequest:
      type: object
      properties:
        phoneNumber:
          type: string
          description: >-
            Phone number to assign to voice agent, should start with + and the
            country code.
          example: '+9700000000'
      required:
        - twilioPhoneNumber
    UnassignPhoneNumberResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: Success
        data:
          type: string
          example: Voice agents were successfully unassigned from the phone number.
    ErrorSchema:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Pass the API key in the Authorization header, You need to put Token
        keyword before the API key. e.g. 'Authorization: Token <api-key>'

````