Phone numbers

Create a new phone number

Register a new phone number. For Twilio, provide account credentials. For SIP, choose between 'registration' mode (Somleng registers TO your PBX) or 'ip_allowlist' mode (your PBX IP is allowlisted). SIP numbers support outbound proxy and auth user options in registration mode.

POST
/phone-numbers
Authorization<token>

API key in the format: Bearer YOUR_API_KEY

In: header

name?string
numberstring
provider?string
Default"twilio"
Value in"twilio" | "sip" | "voximplant" | "jambonz"
sipMode?string

SIP trunk mode. Use 'registration' for username/password auth, 'ip_allowlist' for IP-based allowlisting. Only applicable when provider is 'sip'.

Default"registration"
Value in"registration" | "ip_allowlist"
agentId?string|null
Formatuuid
twilioAccountSid?string

Required if provider is 'twilio'

twilioAuthToken?string

Required if provider is 'twilio'

sipUsername?string

Required if provider is 'sip' and sipMode is 'registration'

Lengthlength <= 60
sipPassword?string

Required if provider is 'sip' and sipMode is 'registration'

sipProxy?string

SIP registrar host (e.g. 'pbx.example.com'). Required if provider is 'sip' and sipMode is 'registration'. In registration mode, this is the host Somleng registers TO.

Lengthlength <= 100
sipOutboundProxy?string|null

Optional SIP outbound proxy. Used when SIP traffic needs to route through a proxy instead of directly to the host. Only used in registration mode.

Lengthlength <= 100
sipAuthUser?string|null

Optional SIP authentication username, if different from sipUsername. Only used in registration mode.

Lengthlength <= 60
sipIp?string

IP address of your PBX/SBC. Required if provider is 'sip' and sipMode is 'ip_allowlist'.

Lengthlength <= 255
sipPort?integer

SIP port number. Used in both 'registration' and 'ip_allowlist' modes.

Default5060
Range1 <= value <= 65535
sipProtocol?string

SIP transport protocol. Used when sipMode is 'ip_allowlist'.

Default"udp"
Value in"udp" | "tcp" | "tls"
sipRegisterTransport?string

SIP registration transport protocol. Used when sipMode is 'registration'.

Default"udp"
Value in"udp" | "tcp" | "tls"
metadata?

Response Body

application/json

application/json

curl -X POST "https://api.chorus-ai.co/v1/phone-numbers" \  -H "Content-Type: application/json" \  -d '{    "number": "string"  }'
{
  "data": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "number": "string",
    "provider": "twilio",
    "sipMode": "registration",
    "agentId": "bc309ecf-5f66-4057-93c5-6611cc9cb7b2",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}
{
  "error": "string",
  "details": [
    {}
  ]
}

Last updated on