Getting Started
Build a REST API
Create a JSON API with routing, validation, and error handling.
Time: 15 min · Level: Beginner
Time: 15 min · Level: Beginner
SMS Webhook Handler
Process incoming SMS messages and send automated replies.
Time: 20 min · Level: Beginner
Time: 20 min · Level: Beginner
Voice Call Router
Route calls based on time of day and caller location.
Time: 25 min · Level: Intermediate
Time: 25 min · Level: Intermediate
Image Resizer
Resize and optimize images on-the-fly at the edge.
Time: 20 min · Level: Intermediate
Time: 20 min · Level: Intermediate
Build a REST API
Build a complete REST API with CRUD operations, input validation, and error handling. What you’ll learn:- Routing requests to different handlers
- Parsing JSON request bodies
- Returning proper HTTP status codes
- Error handling patterns
Prerequisites
- Telnyx account with Edge Compute enabled
telnyx-edgeCLI installed
Step 1: Create the Function
Step 2: Implement the API
Replacesrc/main.py:
Step 3: Test Locally
Step 4: Deploy
https://my-api-{orgId}.telnyxcompute.com.
SMS Webhook Handler
Process incoming SMS messages and respond automatically based on keywords. What you’ll learn:- Handling Telnyx webhooks
- Parsing SMS payloads
- Sending SMS responses via Telnyx API
Prerequisites
- Telnyx account with a phone number
- Phone number configured for SMS
Step 1: Create the Function
Step 2: Implement the Handler
Replacesrc/index.js:
Step 3: Configure Secrets
Get your API key from the Telnyx Portal under API Keys. Use your Telnyx phone number in E.164 format.
Step 4: Deploy and Configure Webhook
- Go to Messaging → Phone Numbers
- Select your number
- Set webhook URL to
https://sms-handler-{orgId}.telnyxcompute.com
Step 5: Test
Send an SMS with “HELP” to your Telnyx number. You should receive the help menu.Voice Call Router
Route incoming calls based on time of day, caller location, or custom logic. What you’ll learn:- TeXML for call control
- Time-based routing logic
- Geographic routing
Step 1: Create the Function
Step 2: Add Dependencies
Createrequirements.txt:
Step 3: Implement Call Routing
Step 4: Deploy
Image Resizer
Resize and optimize images on-the-fly based on URL parameters. What you’ll learn:- Processing binary data
- Query parameter handling
- Caching strategies
Step 1: Create the Function
Step 2: Add Dependencies
Create or updaterequirements.txt:
Step 3: Implement the Resizer
Step 4: Deploy and Test
More Tutorials
Authentication Middleware
Add JWT validation to protect your APIs.
Coming soon
Coming soon
Rate Limiter
Implement rate limiting with sliding windows.
Coming soon
Coming soon
A/B Testing
Route traffic between variants for experiments.
Coming soon
Coming soon
Webhook Validator
Verify signatures from third-party services.
Coming soon
Coming soon
Related Resources
- Quickstart — Deploy your first function
- Examples — Code snippets and patterns
- CLI Reference — Full command documentation