This is the API V2 documentation. To switch out of beta revert back to our API V1.

Open SidemenuAPI Reference
API Reference
Close Sidemenu

Credential Connections

List credential connectionslistCredentialConnections

get https://api.telnyx.com/v2/credential_connections

Returns a list of your credential connections.

curl -X GET \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --globoff "https://api.telnyx.com/v2/credential_connections?page[number]=1&page[size]=20"
Parameters
In query
page[number]
integer (1)
optional

The page number to load

Default: 1
page[size]
integer (1 - 250)
optional

The size of the page

Default: 20
filter[connection_name][contains]
string
optional

If present, connections with connection_name containing the given value will be returned. Matching is not case-sensitive. Requires at least three characters.

Default: null
filter[outbound.outbound_voice_profile_id]
string (int64)
optional

Identifies the associated outbound voice profile.

Example: "1293384261075731499"
sort
string
optional

Specifies the sort order for results. By default sorting direction is ascending. To have the results sorted in descending order add the - prefix.

That is:

  • connection_name: sorts the result by the connection_name field in ascending order.
  • -connection_name: sorts the result by the connection_name field in descending order.

If not given, results are sorted by created_at in descending order.

Default: "created_at"
Example: "connection_name"
Options: [ "created_at", "connection_name", "active" ]
Responses
200

Successful response with a list of credential connections.

400

Bad request

401

Unauthorized

404

Resource not found

Success Response
{
  "data": [
    {
      "active": true,
      "anchorsite_override": "Latency",
      "connection_name": "string",
      "created_at": "2018-02-02T22:25:27.521Z",
      "default_on_hold_comfort_noise_enabled": true,
      "dtmf_type": "RFC 2833",
      "encode_contact_header_enabled": true,
      "encrypted_media": "SRTP",
      "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
      "inbound": {
        "ani_number_format": "+E.164",
        "channel_limit": 10,
        "codecs": [
          "G722"
        ],
        "dnis_number_format": "+e164",
        "generate_ringback_tone": true,
        "isup_headers_enabled": true,
        "prack_enabled": true,
        "privacy_zone_enabled": true,
        "sip_compact_headers_enabled": true,
        "timeout_1xx_secs": 10,
        "timeout_2xx_secs": "15"
      },
      "onnet_t38_passthrough_enabled": true,
      "outbound": {
        "ani_override": "string",
        "ani_override_type": "always",
        "call_parking_enabled": true,
        "channel_limit": 10,
        "generate_ringback_tone": true,
        "instant_ringback_enabled": true,
        "localization": "string",
        "outbound_voice_profile_id": "1293384261075731499",
        "t38_reinvite_source": "telnyx"
      },
      "password": "my123secure456password789",
      "record_type": "credential_connection",
      "rtcp_settings": {
        "capture_enabled": true,
        "port": "rtp+1",
        "report_frequency_seconds": 10
      },
      "sip_uri_calling_preference": "disabled",
      "updated_at": "2018-02-02T22:25:27.521Z",
      "user_name": "myusername123",
      "webhook_api_version": "1",
      "webhook_event_failover_url": "https://failover.example.com",
      "webhook_event_url": "https://example.com",
      "webhook_timeout_secs": 25
    }
  ],
  "meta": {
    "page_number": 2,
    "page_size": 25,
    "total_pages": 3,
    "total_results": 55
  }
}

Create a credential connectioncreateCredentialConnection

post https://api.telnyx.com/v2/credential_connections

Creates a credential connection.

curl -X POST \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --data '{"connection_name": "Test Connection", "user_name": "MyUser", "password":"my123secure456password789"}' \
  https://api.telnyx.com/v2/credential_connections
Parameters
In body
connection_name
string
required
password
string
required

The password to be used as part of the credentials. Must be 8 to 128 characters long.

Example: "my123secure456password789"
user_name
string
required

The user name to be used as part of the credentials. Must be 4-32 characters long and alphanumeric values only (no spaces or special characters).

Example: "myusername123"
active
boolean
optional

Defaults to true

anchorsite_override
string
optional

`Latency` directs Telnyx to route media through the site with the lowest round-trip time to the user's connection. Telnyx calculates this time using ICMP ping messages. This can be disabled by specifying a site to handle all media.

Default: "Latency"
Example: "Amsterdam, Netherlands"
Options: [ "Latency", "Chicago, IL", "Ashburn, VA", "San Jose, CA", "Sydney, Australia", "Amsterdam, Netherlands", "London, UK", "Toronto, Canada", "Vancouver, Canada", "Frankfurt, Germany" ]
default_on_hold_comfort_noise_enabled
boolean
optional

When enabled, Telnyx will generate comfort noise when you place the call on hold. If disabled, you will need to generate comfort noise or on hold music to avoid RTP timeout.

Default: false
dtmf_type
string
optional

Sets the type of DTMF digits sent from Telnyx to this Connection. Note that DTMF digits sent to Telnyx will be accepted in all formats.

Default: "RFC 2833"
Example: "Inband"
Options: [ "RFC 2833", "Inband", "SIP INFO" ]
encode_contact_header_enabled
boolean
optional

Encode the SIP contact header sent by Telnyx to avoid issues for NAT or ALG scenarios.

Default: false
encrypted_media
string
optional

Enable use of SRTP or ZRTP for encryption. Valid values are those listed or null. Cannot be set to non-null if the transport_portocol is TLS.

Example: "SRTP"
Options: [ "SRTP", "ZRTP" ]
inbound
object
optional
Example: { "ani_number_format": "+E.164", "channel_limit": 10, "codecs": "G722", "default_routing_method": "sequential", "dnis_number_format": "+e164", "generate_ringback_tone": true, "isup_headers_enabled": true, "prack_enabled": true, "privacy_zone_enabled": true, "sip_compact_headers_enabled": true, "timeout_1xx_secs": 10, "timeout_2xx_secs": 20 }
onnet_t38_passthrough_enabled
boolean
optional

Enable on-net T38 if you prefer the sender and receiver negotiating T38 directly if both are on the Telnyx network. If this is disabled, Telnyx will be able to use T38 on just one leg of the call depending on each leg's settings.

Default: false
outbound
object
optional
Example: { "ani_override": "always", "call_parking_enabled": true, "channel_limit": 10, "generate_ringback_tone": true, "instant_ringback_enabled": true, "localization": "US", "outbound_voice_profile_id": "1293384261075731499", "t38_reinvite_source": "telnyx" }
rtcp_settings
object
optional
Example: { "capture_enabled": true, "port": "rtcp-mux", "report_frequency_secs": 10 }
sip_uri_calling_preference
string
optional

This feature enables inbound SIP URI calls to your Credential Auth Connection. If enabled for all (unrestricted) then anyone who calls the SIP URI @telnyx.com will be connected to your Connection. You can also choose to allow only calls that are originated on any Connections under your account (internal).

Default: "disabled"
Options: [ "disabled", "unrestricted", "internal" ]
webhook_api_version
string
optional

Determines which webhook format will be used, Telnyx API v1 or v2.

Default: "1"
Example: "1"
Options: [ "1", "2" ]
webhook_event_failover_url
string (url)
optional

The failover URL where webhooks related to this connection will be sent if sending to the primary URL fails. Must include a scheme, such as 'https'.

Default: ""
Example: "https://failover.example.com"
webhook_event_url
string (url)
optional

The URL where webhooks related to this connection will be sent. Must include a scheme, such as 'https'.

Example: "https://example.com"
webhook_timeout_secs
integer (0 - 30)
optional

Specifies how many seconds to wait before timing out a webhook.

Default: null
Example: 25
Responses
201

Successful response with details about a credential connection.

422

Bad request

Success Response
{
  "data": {
    "active": true,
    "anchorsite_override": "Latency",
    "connection_name": "string",
    "created_at": "2018-02-02T22:25:27.521Z",
    "default_on_hold_comfort_noise_enabled": true,
    "dtmf_type": "RFC 2833",
    "encode_contact_header_enabled": true,
    "encrypted_media": "SRTP",
    "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    "inbound": {
      "ani_number_format": "+E.164",
      "channel_limit": 10,
      "codecs": [
        "G722"
      ],
      "dnis_number_format": "+e164",
      "generate_ringback_tone": true,
      "isup_headers_enabled": true,
      "prack_enabled": true,
      "privacy_zone_enabled": true,
      "sip_compact_headers_enabled": true,
      "timeout_1xx_secs": 10,
      "timeout_2xx_secs": "15"
    },
    "onnet_t38_passthrough_enabled": true,
    "outbound": {
      "ani_override": "string",
      "ani_override_type": "always",
      "call_parking_enabled": true,
      "channel_limit": 10,
      "generate_ringback_tone": true,
      "instant_ringback_enabled": true,
      "localization": "string",
      "outbound_voice_profile_id": "1293384261075731499",
      "t38_reinvite_source": "telnyx"
    },
    "password": "my123secure456password789",
    "record_type": "credential_connection",
    "rtcp_settings": {
      "capture_enabled": true,
      "port": "rtp+1",
      "report_frequency_seconds": 10
    },
    "sip_uri_calling_preference": "disabled",
    "updated_at": "2018-02-02T22:25:27.521Z",
    "user_name": "myusername123",
    "webhook_api_version": "1",
    "webhook_event_failover_url": "https://failover.example.com",
    "webhook_event_url": "https://example.com",
    "webhook_timeout_secs": 25
  }
}

Retrieve a credential connectionretrieveCredentialConnection

get https://api.telnyx.com/v2/credential_connections/{id}

Retrieves the details of an existing credential connection.

curl -X GET \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --globoff "https://api.telnyx.com/v2/credential_connections/{id}"
Parameters
In path
id
string
required

Identifies the resource.

Responses
200

Successful response with details about a credential connection.

400

Bad request

401

Unauthorized

404

Resource not found

Success Response
{
  "data": {
    "active": true,
    "anchorsite_override": "Latency",
    "connection_name": "string",
    "created_at": "2018-02-02T22:25:27.521Z",
    "default_on_hold_comfort_noise_enabled": true,
    "dtmf_type": "RFC 2833",
    "encode_contact_header_enabled": true,
    "encrypted_media": "SRTP",
    "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    "inbound": {
      "ani_number_format": "+E.164",
      "channel_limit": 10,
      "codecs": [
        "G722"
      ],
      "dnis_number_format": "+e164",
      "generate_ringback_tone": true,
      "isup_headers_enabled": true,
      "prack_enabled": true,
      "privacy_zone_enabled": true,
      "sip_compact_headers_enabled": true,
      "timeout_1xx_secs": 10,
      "timeout_2xx_secs": "15"
    },
    "onnet_t38_passthrough_enabled": true,
    "outbound": {
      "ani_override": "string",
      "ani_override_type": "always",
      "call_parking_enabled": true,
      "channel_limit": 10,
      "generate_ringback_tone": true,
      "instant_ringback_enabled": true,
      "localization": "string",
      "outbound_voice_profile_id": "1293384261075731499",
      "t38_reinvite_source": "telnyx"
    },
    "password": "my123secure456password789",
    "record_type": "credential_connection",
    "rtcp_settings": {
      "capture_enabled": true,
      "port": "rtp+1",
      "report_frequency_seconds": 10
    },
    "sip_uri_calling_preference": "disabled",
    "updated_at": "2018-02-02T22:25:27.521Z",
    "user_name": "myusername123",
    "webhook_api_version": "1",
    "webhook_event_failover_url": "https://failover.example.com",
    "webhook_event_url": "https://example.com",
    "webhook_timeout_secs": 25
  }
}

Update a credential connectionupdateCredentialConnection

patch https://api.telnyx.com/v2/credential_connections/{id}

Updates settings of an existing credential connection.

curl -X PATCH \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --data '{"active": false}' \
  https://api.telnyx.com/v2/credential_connections/{id}
Parameters
In path
id
string
required

Identifies the resource.

In body
active
boolean
optional

Defaults to true

anchorsite_override
string
optional

`Latency` directs Telnyx to route media through the site with the lowest round-trip time to the user's connection. Telnyx calculates this time using ICMP ping messages. This can be disabled by specifying a site to handle all media.

Default: "Latency"
Example: "Amsterdam, Netherlands"
Options: [ "Latency", "Chicago, IL", "Ashburn, VA", "San Jose, CA", "Sydney, Australia", "Amsterdam, Netherlands", "London, UK", "Toronto, Canada", "Vancouver, Canada", "Frankfurt, Germany" ]
connection_name
string
optional
default_on_hold_comfort_noise_enabled
boolean
optional

When enabled, Telnyx will generate comfort noise when you place the call on hold. If disabled, you will need to generate comfort noise or on hold music to avoid RTP timeout.

Default: false
dtmf_type
string
optional

Sets the type of DTMF digits sent from Telnyx to this Connection. Note that DTMF digits sent to Telnyx will be accepted in all formats.

Default: "RFC 2833"
Example: "Inband"
Options: [ "RFC 2833", "Inband", "SIP INFO" ]
encode_contact_header_enabled
boolean
optional

Encode the SIP contact header sent by Telnyx to avoid issues for NAT or ALG scenarios.

Default: false
encrypted_media
string
optional

Enable use of SRTP or ZRTP for encryption. Valid values are those listed or null. Cannot be set to non-null if the transport_portocol is TLS.

Example: "SRTP"
Options: [ "SRTP", "ZRTP" ]
inbound
object
optional
Example: { "ani_number_format": "+E.164", "channel_limit": 10, "codecs": "G722", "default_routing_method": "sequential", "dnis_number_format": "+e164", "generate_ringback_tone": true, "isup_headers_enabled": true, "prack_enabled": true, "privacy_zone_enabled": true, "sip_compact_headers_enabled": true, "timeout_1xx_secs": 10, "timeout_2xx_secs": 20 }
onnet_t38_passthrough_enabled
boolean
optional

Enable on-net T38 if you prefer the sender and receiver negotiating T38 directly if both are on the Telnyx network. If this is disabled, Telnyx will be able to use T38 on just one leg of the call depending on each leg's settings.

Default: false
outbound
object
optional
Example: { "ani_override": "always", "call_parking_enabled": true, "channel_limit": 10, "generate_ringback_tone": true, "instant_ringback_enabled": true, "localization": "US", "outbound_voice_profile_id": "1293384261075731499", "t38_reinvite_source": "telnyx" }
password
string
optional

The password to be used as part of the credentials. Must be 8 to 128 characters long.

Example: "my123secure456password789"
rtcp_settings
object
optional
Example: { "capture_enabled": true, "port": "rtcp-mux", "report_frequency_secs": 10 }
sip_uri_calling_preference
string
optional

This feature enables inbound SIP URI calls to your Credential Auth Connection. If enabled for all (unrestricted) then anyone who calls the SIP URI @telnyx.com will be connected to your Connection. You can also choose to allow only calls that are originated on any Connections under your account (internal).

Default: "disabled"
Options: [ "disabled", "unrestricted", "internal" ]
user_name
string
optional

The user name to be used as part of the credentials. Must be 4-32 characters long and alphanumeric values only (no spaces or special characters).

Example: "myusername123"
webhook_api_version
string
optional

Determines which webhook format will be used, Telnyx API v1 or v2.

Default: "1"
Example: "1"
Options: [ "1", "2" ]
webhook_event_failover_url
string (url)
optional

The failover URL where webhooks related to this connection will be sent if sending to the primary URL fails. Must include a scheme, such as 'https'.

Default: ""
Example: "https://failover.example.com"
webhook_event_url
string (url)
optional

The URL where webhooks related to this connection will be sent. Must include a scheme, such as 'https'.

Example: "https://example.com"
webhook_timeout_secs
integer (0 - 30)
optional

Specifies how many seconds to wait before timing out a webhook.

Default: null
Example: 25
Responses
200

Successful response with details about a credential connection.

401

Unauthorized

404

Resource not found

422

Bad request

Success Response
{
  "data": {
    "active": true,
    "anchorsite_override": "Latency",
    "connection_name": "string",
    "created_at": "2018-02-02T22:25:27.521Z",
    "default_on_hold_comfort_noise_enabled": true,
    "dtmf_type": "RFC 2833",
    "encode_contact_header_enabled": true,
    "encrypted_media": "SRTP",
    "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    "inbound": {
      "ani_number_format": "+E.164",
      "channel_limit": 10,
      "codecs": [
        "G722"
      ],
      "dnis_number_format": "+e164",
      "generate_ringback_tone": true,
      "isup_headers_enabled": true,
      "prack_enabled": true,
      "privacy_zone_enabled": true,
      "sip_compact_headers_enabled": true,
      "timeout_1xx_secs": 10,
      "timeout_2xx_secs": "15"
    },
    "onnet_t38_passthrough_enabled": true,
    "outbound": {
      "ani_override": "string",
      "ani_override_type": "always",
      "call_parking_enabled": true,
      "channel_limit": 10,
      "generate_ringback_tone": true,
      "instant_ringback_enabled": true,
      "localization": "string",
      "outbound_voice_profile_id": "1293384261075731499",
      "t38_reinvite_source": "telnyx"
    },
    "password": "my123secure456password789",
    "record_type": "credential_connection",
    "rtcp_settings": {
      "capture_enabled": true,
      "port": "rtp+1",
      "report_frequency_seconds": 10
    },
    "sip_uri_calling_preference": "disabled",
    "updated_at": "2018-02-02T22:25:27.521Z",
    "user_name": "myusername123",
    "webhook_api_version": "1",
    "webhook_event_failover_url": "https://failover.example.com",
    "webhook_event_url": "https://example.com",
    "webhook_timeout_secs": 25
  }
}

Delete a credential connectiondeleteCredentialConnection

delete https://api.telnyx.com/v2/credential_connections/{id}

Deletes an existing credential connection.

curl -X DELETE \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "Authorization: Bearer YOUR_API_KEY" \
  "https://api.telnyx.com/v2/credential_connections/{id}"
Parameters
In path
id
string
required

Identifies the resource.

Responses
200

Successful response with details about a credential connection.

401

Unauthorized

404

Resource not found

422

Bad request

Success Response
{
  "data": {
    "active": true,
    "anchorsite_override": "Latency",
    "connection_name": "string",
    "created_at": "2018-02-02T22:25:27.521Z",
    "default_on_hold_comfort_noise_enabled": true,
    "dtmf_type": "RFC 2833",
    "encode_contact_header_enabled": true,
    "encrypted_media": "SRTP",
    "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    "inbound": {
      "ani_number_format": "+E.164",
      "channel_limit": 10,
      "codecs": [
        "G722"
      ],
      "dnis_number_format": "+e164",
      "generate_ringback_tone": true,
      "isup_headers_enabled": true,
      "prack_enabled": true,
      "privacy_zone_enabled": true,
      "sip_compact_headers_enabled": true,
      "timeout_1xx_secs": 10,
      "timeout_2xx_secs": "15"
    },
    "onnet_t38_passthrough_enabled": true,
    "outbound": {
      "ani_override": "string",
      "ani_override_type": "always",
      "call_parking_enabled": true,
      "channel_limit": 10,
      "generate_ringback_tone": true,
      "instant_ringback_enabled": true,
      "localization": "string",
      "outbound_voice_profile_id": "1293384261075731499",
      "t38_reinvite_source": "telnyx"
    },
    "password": "my123secure456password789",
    "record_type": "credential_connection",
    "rtcp_settings": {
      "capture_enabled": true,
      "port": "rtp+1",
      "report_frequency_seconds": 10
    },
    "sip_uri_calling_preference": "disabled",
    "updated_at": "2018-02-02T22:25:27.521Z",
    "user_name": "myusername123",
    "webhook_api_version": "1",
    "webhook_event_failover_url": "https://failover.example.com",
    "webhook_event_url": "https://example.com",
    "webhook_timeout_secs": 25
  }
}

Was this section helpful?