Create credentials (digest auth) API for a Trunk
9 min
1\ create credentials (sip digest) creates a username/password pair for sip digest authentication on the trunk configure the same values on your voice ai platform’s sip trunk settings http request post https //\<api key> \<api token>@\<subdomain>/v2/accounts/\<account sid>/trunks/\<trunk sid>/credentials request headers header value content type application/json request parameters the following parameters are sent as json in the body of the request parameter name mandatory/optional value user name mandatory string; sip digest username example voice ai user password mandatory string; sip digest password use a strong secret friendly name optional string; label to identify where the creds are used (max 32 chars) example elevenlabs prod, livekit staging example request curl s x post "https //\<api key> \<api token>@\<subdomain>/v2/accounts/\<account sid>/trunks/\<trunk sid>/credentials" \\ h "content type application/json" \\ d '{ "user name" "voice ai user", "password" "replace with strong password", "friendly name" "voice ai platform" }' http response on success, the http response status code will be 200 ok example response { "request id" "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "method" "post", "http code" 200, "response" { "code" 200, "error data" null, "status" "success", "data" { "id" "1234", "trunk sid" "trmum17d8e9a37a3732ecbf91a3u", "user name" "voice ai user", "friendly name" "voice ai platform", "date created" "2026 01 23t11 37 36z", "date updated" "2026 01 23t11 37 36z" } } } response parameters parameter name type & value request id string; unique identifier for this api request method string; http method used (post) http code integer; http status code (200 for success) id string; unique identifier for this credential entry example 1234 trunk sid string; the trunk these credentials are associated with user name string; the sip digest username you set friendly name string or null; optional label date created string; iso 8601 timestamp when credentials were created date updated string; iso 8601 timestamp when credentials were last updated 2\ list credentials (verify) lists credentials configured for the trunk http request get https //\<api key> \<api token>@\<subdomain>/v2/accounts/\<account sid>/trunks/\<trunk sid>/credentials example request curl s "https //\<api key> \<api token>@\<subdomain>/v2/accounts/\<account sid>/trunks/\<trunk sid>/credentials" http response on success, the http response status code will be 200 ok example response { "request id" "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "method" "get", "http code" 200, "metadata" { "total" 1, "page size" 50, "page" 1, "first page uri" "/v2/accounts/exotelveenotesting1m/trunks/trmum17d8e9a37a3732ecbf91a3u/credentials?page size=50\&offset=0", "prev page uri" null, "next page uri" null }, "response" \[ { "code" 200, "error data" null, "status" "success", "data" { "id" "1234", "trunk sid" "trmum17d8e9a37a3732ecbf91a3u", "user name" "voice ai user", "friendly name" "voice ai platform", "date created" "2026 01 23t11 37 36z", "date updated" "2026 01 23t11 37 36z" } } ] } response parameters parameter name type & value request id string; unique identifier for this api request method string; http method used (get) http code integer; http status code (200 for success) metadata total integer; total credential records available metadata page size integer; page size applied metadata page integer; page number (if present) metadata first page uri string; uri for first page metadata prev page uri string or null; uri for previous page metadata next page uri string or null; uri for next page response array; list of credential objects response\[] data id string; unique identifier for the credential entry response\[] data trunk sid string; the trunk these credentials are associated with response\[] data user name string; sip digest username response\[] data friendly name string or null; optional label response\[] data date created string; iso 8601 timestamp when created response\[] data date updated string; iso 8601 timestamp when updated 3\ delete credentials (rotate / revoke) deletes a credential entry when rotating credentials or removing access for a provider environment http request delete https //\<api key> \<api token>@\<subdomain>/v2/accounts/\<account sid>/trunks/\<trunk sid>/credentials?id=\<credential id> important credential id is passed as query param id (not /credentials/\<credential id>) example request curl s x delete "https //\<api key> \<api token>@\<subdomain>/v2/accounts/\<account sid>/trunks/\<trunk sid>/credentials?id=\<credential id>" http response on success, the http response status code will be 200 ok example response { "request id" "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "method" "delete", "http code" 200, "response" { "code" 200, "error data" null, "status" "success", "data" { "id" "1234", "trunk sid" "trmum17d8e9a37a3732ecbf91a3u", "user name" "voice ai user", "friendly name" "voice ai platform", "date created" "2026 01 23t11 37 36z", "date updated" "2026 01 23t11 37 36z" } } } response parameters parameter name type & value request id string; unique identifier for this api request method string; http method used (delete) http code integer; http status code (200 for success) id string; deleted credential identifier trunk sid string; trunk sid this credential belonged to user name string; sip digest username that was deleted friendly name string or null; optional label date created string; iso 8601 timestamp when credential was originally created date updated string; iso 8601 timestamp when credential was last updated
