Skip to main content
The Credentials API lets you create and manage username/password pairs for SIP digest authentication on outbound trunks.

API Endpoint

https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/

The Credentials Object

A credentials object contains username and password for SIP digest authentication when your PBX sends calls to Plivo.

Attributes

credential_uuid
string
Unique identifier for the credentials.
name
string
Friendly name for the credentials.
username
string
Username for SIP authentication.
password
string
Password for SIP authentication (only set on create/update, never returned in responses).

Example Object

{
  "credential_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6",
  "name": "my-credentials",
  "username": "sip_user_1"
}
The password is never returned in API responses for security. It is only used when creating or updating credentials.

List All Credentials

Get all credentials for your account.

HTTP Request

GET https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/

Query Parameters

ParameterTypeRequiredDefaultDescription
limitintegerNo20Results per page (1-20)
offsetintegerNo0Pagination offset

Response

{
  "api_id": "a04ad809-3b78-4bbe-9baf-acfc7800b10f",
  "meta": {
    "limit": 20,
    "offset": 0,
    "total_count": 109,
    "previous": null,
    "next": "v1/Account/{auth_id}/Zentrunk/Credential/?limit=20&offset=20"
  },
  "objects": [
    {
      "credential_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6",
      "name": "production-credentials",
      "username": "sipuser123"
    },
    {
      "credential_uuid": "c4773-4ae6-4b75-92ea-9cf3ea4227d6",
      "name": "staging-credentials",
      "username": "sipuser456"
    }
  ]
}

Example

curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/

Retrieve Credentials

Get details of specific credentials.

HTTP Request

GET https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/{credential_uuid}/

Response

{
  "credential_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6",
  "name": "my-credentials",
  "username": "sip_user_1"
}

Example

curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/f19c4773-4ae6-4b75-92ea-9cf3ea4227d6/

Create Credentials

Create a new credential set for SIP digest authentication.

HTTP Request

POST https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/

Request Parameters

ParameterTypeRequiredDefaultDescription
namestringNo-Friendly name for the credentials
usernamestringYes-Username for SIP authentication
passwordstringYes-Password for SIP authentication

Response

{
  "api_id": "4e1f954c-baf3-11ec-bafe-0242ac110003",
  "message": "credential created successfully.",
  "credential_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6"
}

Error Codes

CodeDescription
400Invalid request parameters
401Authentication failed
422Missing required parameters (username or password)

Example

curl -i --user AUTH_ID:AUTH_TOKEN \
    -H "Content-Type: application/json" \
    -d '{
      "name": "production-credentials",
      "username": "sipuser123",
      "password": "securepassword123!"
    }' \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/

Update Credentials

Modify an existing credential’s name, username, or password.

HTTP Request

POST https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/{credential_uuid}/

Request Parameters

ParameterTypeRequiredDefaultDescription
namestringNo-New friendly name
usernamestringNo-New username
passwordstringNo-New password

Response

{
  "api_id": "4e1f954c-baf3-11ec-bafe-0242ac110003",
  "message": "Credential updated successfully.",
  "credential_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6"
}

Example

curl -i --user AUTH_ID:AUTH_TOKEN \
    -H "Content-Type: application/json" \
    -d '{"username": "newuser", "password": "newpassword123!"}' \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/f19c4773-4ae6-4b75-92ea-9cf3ea4227d6/

Delete Credentials

Permanently delete credentials.

HTTP Request

DELETE https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/{credential_uuid}/

Response

HTTP 204 No Content
Deleting credentials that are attached to an active trunk will break authentication for that trunk.

Example

curl -X DELETE -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Credential/{credential_uuid}/

Usage with Trunks

After creating credentials, attach them to an outbound trunk.

Example

curl -i --user AUTH_ID:AUTH_TOKEN \
    -H "Content-Type: application/json" \
    -d '{
      "name": "outbound-trunk",
      "trunk_direction": "outbound",
      "credential_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6"
    }' \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Trunk/