Skip to main content
POST
/
api
/
v2
/
platform
/
telephony
/
providers-configurations
Create Provider
curl --request POST \
  --url http://localhost:3001/api/v2/platform/telephony/providers-configurations/ \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Org-Handle: <org-handle>' \
  --data '
{
  "provider": "twilio",
  "account_sid": "ACxxxxxxxxxxxxxxxx",
  "auth_token": "your_auth_token"
}
'
{
  "status_code": 201,
  "message": "Provider configuration created successfully.",
  "data": {
    "id": 42,
    "provider": "twilio",
    "account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "created_at": "2026-02-07T10:00:00Z"
  }
}
{
  "status_code": 201,
  "message": "Provider configuration created successfully.",
  "data": {
    "id": 42,
    "provider": "twilio",
    "account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "created_at": "2026-02-07T10:00:00Z"
  }
}

Create Provider Configuration

Create a new telephony provider configuration by linking your provider credentials (Account SID and Auth Token) to your organization. These configurations are used to connect telephony providers to bridges.
Prerequisites: Make sure you have your API Token, Org-Handle, and telephony provider credentials ready. See Authentication for details.

Headers

NameTypeRequiredDescription
AuthorizationstringYesAPI Key format: Token <token>
Org-HandlestringYesOrganization domain handle
Content-TypestringYesapplication/json
You can get the Org-Handle by hitting the Get All Organizations API. The domain_handle field in the response is your Org-Handle.

Request Body

FieldTypeRequiredDescription
providerstringYesProvider identifier (slug or ID from Get Providers API)
account_sidstringYesProvider Account SID / Account identifier
auth_tokenstringYesProvider Auth Token / Secret key

Response Fields

FieldTypeDescription
status_codeintegerHTTP status code
messagestringResponse message
dataobjectCreated provider config details

Provider Config Object Fields

FieldTypeDescription
idintegerUnique provider configuration identifier
providerstringProvider slug/identifier
account_sidstringAccount SID (auth_token is not returned)
created_atstringCreation timestamp (ISO 8601)

Common Error Codes

Status CodeDescription
201Created - Provider configuration created
400Bad Request - Invalid credentials or parameters
401Unauthorized - Invalid or missing API token
403Forbidden - Invalid organization handle
409Conflict - Configuration already exists
500Internal Server Error - Server-side error

Code Examples

const axios = require('axios');

const headers = {
  'Authorization': 'Token your-api-token',
  'Org-Handle': 'your-org-handle',
  'Content-Type': 'application/json'
};

// Create a provider configuration
const createProvider = async (provider, accountSid, authToken) => {
  const response = await axios.post(
    'https://unpod.dev/api/v2/platform/telephony/providers-configurations/',
    { provider, account_sid: accountSid, auth_token: authToken },
    { headers }
  );
  console.log(`Provider created with ID: ${response.data.data.id}`);
  return response.data.data;
};

// Example usage
createProvider('twilio', 'ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'your-auth-token');

Best Practices

  1. Provider Slug: Use the slug from the Get Telephony Providers endpoint to identify the provider
  2. Credential Security: Never log or expose auth_token values — treat them as secrets
  3. Credential Rotation: Use the Update Provider endpoint to rotate credentials without deleting the configuration
  4. Configuration ID: Store the returned id to reference this configuration when connecting to bridges
  5. Error Handling: Handle 400 errors that indicate invalid credentials before they cause production issues
  6. Security: Keep API tokens secure and rotate them regularly

Authorizations

Authorization
string
header
required

Format: Token

Headers

Org-Handle
string
required

Organization domain handle

Example:

"unpod"

Body

application/json
provider
string
required
Example:

"twilio"

account_sid
string
required
Example:

"ACxxxxxxxxxxxxxxxx"

auth_token
string
required
Example:

"your_auth_token"

Response

Provider created