This is the current API V1 documentation. Explore our API V2 beta if you’d like to test new features.

Getting Started

Introduction

Telnyx is a real-time communications platform with full, feature-rich functionality, making it quick and easy to set up and port numbers around the world, configure messaging, control VoIP and IP network functions, and define how and where communications can be used in real time. The Telnyx API can power a host of specialty applications, from call tracking to cloud-based PBX, dynamic security, and authentication use cases.

Our API Reference is organized by topics, such as NumbersAPI or MessagingAPI. Each topic is prefaced with a general overview that describes how our API can be used within the context of that topic, followed by reference documentation of specific API endpoints.

Telnyx strives to create a developer-first platform with first-rate interactive documentation and 24/7 support. Explore our API capabilities and please let us know how we can better empower your development team to better serve your customers.

Hosts

https://api.telnyx.com
https://sms.telnyx.com
https://data.telnyx.com
https://lrnlookup.telnyx.com


API Explorer

You can use the API Explorer to try out API endpoints, side-by-side with the endpoint reference.

Telnyx does not offer a sandbox environment for the API Explorer at this time. You can create a separate, development-only Mission Control Portal account to test out API endpoints. The API Explorer triggers real API calls, so do not use your production Mission Control account credentials when testing.

Overview

Mission Control Portal

You will need a Mission Control PortalTelnyx Developers account in order to access our API. Most of the API Reference topics will be familiar to you if you've used the Portal interface before; for example, the Connections pagePORTAL corresponds to the Connections APIAPI topic. You will be able to perform all the same Portal actions through the API.


Protocols

Telnyx HTTP endpoints are RESTfulTelnyx Developers, and consume and return JSONTelnyx Developers. All HTTP endpoints except sms.telnyx.com/messages require an API token value in the request header.

More information on API tokens, Authorization headers and IP Authentication will be covered in the AuthenticationAPI section below.

CNAM Data and LRN Data may be retrieved with HTTP, as well as DNS ENUMTelnyx Developers, SIPTelnyx Developers (LRN only) or XML UDPTelnyx Developers (LRN only) protocols. DNS ENUM, SIP and XML UDP requests must be set up to use an IP authenticated profile. More information on IP Authentication will be covered in the AuthenticationAPI section below.


Versioning

Our API is currently at v1. A new version of the API will be released when backwards-incompatible changes are made to the API.


Glossary

  
NumbersDIDs and toll-free numbers that can be purchased and managed in order to receive calls (inbound/origination)
MessagingShort Message Service (SMS) text messaging. Long code
PortingTransferring of DIDs and toll-free numbers onto the Telnyx network from another carrier
ConnectionsProvisions SIP trunks
ReportsAccess Call and Messaging Detail Records, and generate usage reports
AccountYour Mission Control Portal account
CNAM DataCaller ID Name information
LRN DataLocal Routing Number information
Switch DataTelephone switch information
HTTP Endpoints

https://api.telnyx.com/origination
https://api.telnyx.com/termination
https://api.telnyx.com/messaging
https://api.telnyx.com/reporting
https://api.telnyx.com/security
https://api.telnyx.com/account
https://data.telnyx.com/caller-information
https://data.telnyx.com/LRN
https://data.telnyx.com/LRNLookup
https://sms.telnyx.com/messages


DNS ENUM Endpoints

data.telnyx.com lrnlookup.telnyx.com


SIP Endpoints

lrnlookup.telnyx.com


XML UDP Endpoints

lrnlookup.telnyx.com

Authentication

Log in to your Mission Control PortalTelnyx Developers account in order to obtain the API access keys needed to authenticate your application.


API User and Token

API User may either be your Portal email address or your 24-character API Access Key. You can find your API Access Key and API token under AuthPORTAL in the Portal.

Add an API Token if you have not done so already. Once you have your API user and token, you may use them as header values in HTTP requests.


IP Authentication

CNAM & LRN Data endpoints that do not use HTTP will require IP authentication. You will need to add IPs to a connection. You can then create a data profile through the Portal Telco Data interfacePORTAL and choose IP Address as the authentication method, and then select the connection with the IPs you’d like to whitelist. You can read more on how to authenticate specific endpoints in the CNAM DataAPI and LRN DataAPI Overviews.


Sending SMS

An API token is not required to send SMS. Create a new Messaging profile to obtain a messaging profile secret to add to your HTTP headers. More in-depth information on sending SMS can be found in the Messaging OverviewAPI.


Glossary
  
API UserYour Portal account email address or API Access Key
API Access KeyAccess key used in place of your Portal email address as the API user
API TokenToken generated within your Telnyx account to use with API requests
IP AuthenticationUses IP addresses as the authentication method, as opposed to token-based authentication
Profile SecretMessaging profile token used to authenticate SMS send requests
Example User & Token Request Header
x-api-user: example@telnyx.com
x-api-token: MY_TOKEN
Example SMS (Send) Request Header
x-profile-secret: MY_TOKEN

Rate Limits

Requests to api.telnyx.com are rate limitedTelnyx Developers to ensure that the API remains responsive for all users. The rate limits per user are:

ActionPathLimit
Global (all requests)/*~40 requests per second
Number Search (unauthenticated)/origination/number_searches~10 requests per minute
Number Search (authenticated)/origination/number_searches~40 requests per second
Number Update/origination/numbers/{id}~60 requests per minute

When the rate limit is exceeded responses with status code 429 will be returned indicating that you have exhausted the number of requests allowed in the current window.

To avoid exceeding the limits we recommend that you proactively limit the rate of requests made by your application.

These limits are subject to change based on usage and may be adjusted to align with changes in capacity.


Over your rate limit?

Contact support@telnyx.comTelnyx Developers if you find you are exceeding the rate limit.

Rate Limit Response Body
{
  "errors": [
    {
      "code": "10011",
      "title": "Too many requests",
      "detail": "You have exceeded the maximum number of allowed requests."
    }
  ]
}

The status code of this response is 429Telnyx Developers.

Errors

CodeDescription