Skip to main content

Worked SIP credential samples

SIP credentials are usually the first calls a contact-center integration makes — they register each agent’s softphone or desk phone. Copy a request as written, substitute your own ids, and compare the response envelope. Successful writes return { data, meta }; failures return the { error, meta } envelope. The retry-vs-surface matrix for every class sits at the bottom of this page. A credential owns a softphone registration on the inbound SIP edge: the device REGISTERs against sip.orbit.devotel.io, inbound calls ring it, and outbound usage (if enabled) is tracked against the credential. The samples below pair cURL with Node — reads use a raw fetch; the SIP-credential surface has no typed Node SDK resource yet, so the write tabs use the orbit.request escape hatch pattern from the API recipes.

Page the credentials

GET /api/v1/sip-credentials
Lists non-deleted credentials newest-first with keyset pagination. limit defaults to 25 and caps at 200; a value above the cap is silently clamped, not rejected. When meta.pagination.has_more is true, pass meta.pagination.cursor back as the cursor query parameter for the next page. Request
Response
Every row carries the connection details a handset needs (sip_server, sip_realm, ports) so a per-row read is not required to configure a device. The plaintext password is never in a list row.

Create a SIP credential

POST /api/v1/sip-credentials
Issues a credential and returns the plaintext password exactly once — save it immediately; it is not recoverable. label is the only required field; it is lowercased and slugified into the SIP username, which stays stable across password rotations. This example wires a front-desk handset: an extension, a fixed caller ID, recording-on, and an IP allow-list. Request
Response
Point the handset at sip_server + username + the one-time password; the create response is the only place the password appears. defaultCallerIdE164 is ownership-checked — a number your organization does not own is rejected with a 403 (folded into the matrix below, since “pick a number you own” is obvious from the message).

Rotate a password

POST /api/v1/sip-credentials/{id}/rotate
Generates a new password and invalidates the old one instantly. The username does not change, so registered devices keep working after you update the password field. The new plaintext password is returned exactly once, same rule as create. Request
Response

Force-unregister a device

POST /api/v1/sip-credentials/{id}/unregister
Revokes the live registration binding — the handset drops off the network immediately, and will re-register on its next re-REGISTER (default ~60s) unless you also disable the credential with a PATCH enabled: false. Use this for a stolen phone or a sticky NAT binding. Request
Response

Errors worth branching on

These failures cover the create, rotate, unregister, and read calls above plus the update (PATCH) and delete calls on the same page. Each block is a full { error, meta } envelope as the API returns it, and the matrix at the bottom answers retry vs surface for the same classes. For the platform-wide decision table these branches plug into, see the error handling guide.

403 — scope or caller-id ownership

403
A 403 on create or rotate means the key lacks the write scope — developer and viewer roles can read credentials, and admin or owner is required to create or modify, so branch on the role and surface instead of retrying. The same 403 shape also fires when defaultCallerIdE164 names a number your organization does not own — the call is rejected before the credential is created.

409 — duplicate label or extension

409
Recreating the same label, or reusing an extension number already taken in your organization, returns this 409 CONFLICT — pick a new label or rotate the existing credential instead of blind-retrying. This is the same branch a teams-client codes on duplicate name: the client decides whether to label the device differently or PATCH the existing row.

404 — stale or foreign id

404
A 404 on get/update/rotate/unregister/delete means the sipcred_* id does not exist in your organization (or was soft-deleted) — re-list credentials and branch on the current id rather than retrying the stale one.

60-second retry matrix