Build with Telnyx
Explore our guides and examples to implement connectivity into your business.
Purchase a phone number
curl -i -X POST "https://api.telnyx.com/v2/number_orders" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TELNYX_API_KEY" \
-d '{
"phone_numbers": [
{"phone_number": "+15558675309"}
]
}'
Make a phone call
curl -i -X POST "https://api.telnyx.com/v2/calls" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TELNYX_API_KEY" \
-d '{
"connection_id": "YOUR_CONNECTION_ID",
"to": "+15551234567",
"from": "+15557654321",
"webhook_url": "https://your-webhook.url/events"
}'
Send a message
curl -i -X POST "https://api.telnyx.com/v2/messages" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TELNYX_API_KEY" \
-d '{
"from": "+15557654321",
"to": "+15551234567",
"text": "Hello world, this is a test message from Telnyx!"
}'
Purchase an ESIM
curl -i -X POST \
https://api.telnyx.com/v2/sim_card_orders \
-H 'Authorization: Bearer YOUR_TELNYX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"address_id": "1293384261075731499",
"quantity": 210
}'
Create a storage bucket
PUT /mybucket HTTP/1.1
Host: [region].telnyxstorage.com
Accept: text/xml
x-amz-acl: private
Content-Type: application/xml
X-Amz-Content-Sha256: beaead3198f7da1e70d03ab969765e0821b24fc913697e929e726aeaebf0eba3
X-Amz-Date: 20230927T152207Z
Authorization: AWS4-HMAC-SHA256 Credential=YOUR_TELNYX_API_KEY/20230927/test/execute-api/aws4_request, SignedHeaders=accept;content-length;content-type;host;x-amz-acl;x-amz-content-sha256;x-amz-date, Signature=eb67629c5cd507c56c5c5447323cc0190c605ab87c2b2fd3046825ca09a28425
Content-Length: 197
<?xml version="1.0" encoding="UTF-8"?>
<CreateBucketConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<LocationConstraint>us-east-1</LocationConstraint>
</CreateBucketConfiguration>
Chat with a language model
curl -i -X POST \
https://api.telnyx.com/v2/ai/chat/completions \
-H 'Authorization: Bearer YOUR_TELNYX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"messages": [
{
"role": "user",
"content": "Hello, World!"
}
],
"model": "mistralai/Mistral-7B-Instruct-v0.1"
}'
Join our community on Slack
Ask questions, receive updates and connect with other developers in our community.
Join Community