Skip to content

Create a SIP user

POST
/v1/Accounts/{auth_id}/Sip/endpoint
curl --request POST \
--url https://api.siprtc.io/v1/Accounts/example/Sip/endpoint \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "codec_list": "PCMU,PCMA,OPUS", "domain": "acme.sip.siprtc.io", "name": "Reception", "password": "S3cretPassw0rd!", "prefix": "acme", "presence": false, "status": true }'

Creates a SIP user that phones and softphones can register with and provisions it on the SIP registrar. The SIP username is generated as prefix followed by the current Unix time in milliseconds. When your account belongs to a vendor with its own SIP domain, domain is replaced by that domain unless it already ends with the vendor’s host. New users have no application attached (application_id -1); attach one with PATCH. The response is the registrar record, including the password and its digest hashes.

auth_id
required
string

Auth ID of your account.

The SIP user to create.

Media type application/json
object
codec_list

Comma-separated codec preference list stored with the user.

string

Example

PCMU,PCMA,OPUS
domain
required

SIP domain (FQDN) the user registers on. Replaced by the vendor’s SIP domain unless it ends with the vendor’s host.

string

Example

acme.sip.siprtc.io
name
required

Display name of the SIP user: letters and digits only, at least 2 characters.

string

Example

Reception
password
required

SIP digest password, at least 6 characters.

string

Example

S3cretPassw0rd!
prefix
required

Prefix of the generated SIP username: 3 to 8 letters or digits. The username becomes the prefix followed by the current Unix time in milliseconds.

string

Example

acme
presence

Whether presence is enabled for the user.

boolean

Example

false
status

Whether the SIP user may register and place calls.

boolean

Example

true

The SIP user as provisioned on the registrar.

Media type application/json
object
domain

SIP domain the user registers on.

string
ha1

MD5 of username:domain:password, used for SIP digest authentication.

string
ha1b

MD5 of username@domain:domain:password.

string
id

ID of the new SIP user; use it as endpoint_id.

integer
password

SIP digest password as stored.

string
username

Generated SIP username (prefix plus a millisecond timestamp).

string

Example

{
"domain": "acme.sip.siprtc.io",
"ha1": "0f1e2d3c4b5a69788796a5b4c3d2e1f0",
"ha1b": "a1b2c3d4e5f60718293a4b5c6d7e8f90",
"id": 5012,
"password": "S3cretPassw0rd!",
"username": "acme1768473000000"
}

A field failed validation (code 21213). When the gateway did not supply your company, the body is {status, message} with message “company id is empty” instead.

Media type application/json
object
code

SIPRTC error code, for example 21213 (invalid field) or 20404 (not found).

integer
message

Human-readable description of the error.

string
more_info

Link to more information.

string
status

HTTP status the error is meant to map to. It can differ from the actual response status.

integer

Example

{
"code": 21213,
"message": "validation failed on field Password is not valid",
"more_info": "https://api.siprtc.io",
"status": 400
}

Missing or wrong Basic-auth credentials (returned by the API gateway).

Media type application/json
string

Example generated

example

The SIP user could not be stored (code 20404).

Media type application/json
object
code

SIPRTC error code, for example 21213 (invalid field) or 20404 (not found).

integer
message

Human-readable description of the error.

string
more_info

Link to more information.

string
status

HTTP status the error is meant to map to. It can differ from the actual response status.

integer

Example

{
"code": 21213,
"message": "validation failed on field Password is not valid",
"more_info": "https://api.siprtc.io",
"status": 400
}