---
title: "Add a phone number for a user."
method: POST
path: "/v1/voice-agents/phone-number"
---

# Add a phone number for a user.

`POST /v1/voice-agents/phone-number`

## Request body

- union
  - object
    - `type` 'TWILIO', required — The type of phone number to add, TWILIO in this case.
    - `phoneNumber` string, required — The phone number to add to the Twilio numbers of a user.
    - `label` string, required — A label to identify the phone number.
    - `twilioAccountSid` string, required — The Twilio Account SID associated with the Twilio number.
    - `twilioAuthToken` string, required — The Twilio Auth Token for authenticating API requests.
  - object
    - `type` 'SIP', required — The type of phone number to add, SIP in this case.
    - `phoneNumber` string, required — The phone number to add to the SIP numbers of a user.
    - `label` string, required — A label to identify the phone number.
    - `sipInboundConfigs` object, required
      - `originationUri` 'sip:sip.eu.tryhamsa.com:5060;transport=tcp', required
    - `sipOutboundConfigs` object, required
      - `address` string, required
      - `transportType` 'UDP' | 'TCP', required
      - `customHeaders` object
      - `sipTrunkUsername` string
      - `sipTrunkPassword` string

## Response `200`

Successful response

- AddPhoneNumberResponse
  - `success` boolean
  - `message` string
  - `data` PhoneNumberRecord
    - `id` string
    - `number` string
    - `label` string
    - `type` 'TWILIO' | 'SIP'
    - `userId` string
    - `sipInboundConfigs` object
      - `originationUri` 'sip:sip.eu.tryhamsa.com:5060;transport=tcp'
    - `sipOutboundConfigs` object
      - `address` string
      - `transportType` 'TCP' | 'UDP'
      - `customHeaders` object
    - `voiceAgentId` string, nullable
    - `voiceAgent` object
      - `id` string
      - `name` string
    - `createdAt` string
    - `updatedAt` string

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `500` — Server Side Error

---

[API](https://skmtc.net/tryhamsa/apis/hamsa-api.md) · [All operations](https://skmtc.net/tryhamsa/apis/hamsa-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tryhamsa/hamsa-api/versions/ecbeb5d8dc13/schema)
