Skip to content

API Overview

The TextFlow API allows you to programmatically send SMS messages, manage contacts, and integrate TextFlow with your applications.

All API requests should be made to:

https://textflow.telair.net/api

The TextFlow API uses API keys for authentication. You must include your API key in every request using the X-API-Key header.

  1. Log in to your TextFlow account
  2. Navigate to Settings → API Keys
  3. Click Create API Key
  4. Give your key a descriptive name (e.g., “Production Integration”)
  5. Choose environment: Production or Test
  6. Copy the key immediately - it will only be shown once
  • Production keys: Start with sk_live_
  • Test keys: Start with sk_test_

Include your API key in the X-API-Key header with every request:

Terminal window
curl -X POST https://textflow.telair.net/api/v1/messages/send \
-H "X-API-Key: sk_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"to": "15551234567", "message": "Hello from TextFlow!"}'

API requests are subject to rate limits based on your subscription plan:

PlanDaily LimitPer-Minute Limit
Starter5,000100
Marketer25,000300
EnterpriseCustomCustom

When you exceed the rate limit, you’ll receive a 429 Too Many Requests response.

All API responses are returned in JSON format with a consistent structure:

{
"success": true,
"message": "Operation completed successfully",
"data": {
// Response data here
}
}
{
"success": false,
"error": "Error message describing what went wrong"
}
Status CodeMeaning
200Success - Request completed successfully
400Bad Request - Invalid parameters or missing required fields
401Unauthorized - Invalid or missing API key
403Forbidden - API key doesn’t have permission for this action
404Not Found - Resource doesn’t exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Something went wrong on our end
ErrorCauseSolution
API key requiredMissing X-API-Key headerAdd API key to request headers
Invalid API key formatKey doesn’t start with sk_live_ or sk_test_Check that you copied the full key
Invalid or inactive API keyKey is revoked or doesn’t existGenerate a new API key
Daily message limit reachedAccount has hit daily sending limitUpgrade plan or wait until next day
Invalid phone number formatPhone number is not in correct formatUse E.164 format: +1XXXXXXXXXX

Here’s a complete example of sending an SMS message using the API:

Terminal window
curl -X POST https://textflow.telair.net/api/v1/messages/send \
-H "X-API-Key: sk_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"to": "+15551234567",
"message": "Hello! This is a test message from TextFlow."
}'
{
"success": true,
"message": "Message sent successfully",
"data": {
"messageId": "msg_1234567890_abc123",
"to": "+15551234567",
"from": "+15559876543",
"status": "sent"
}
}

The TextFlow API provides the following endpoints:

  1. Rotate Keys Regularly: Generate new API keys every 90 days
  2. Use Test Keys for Development: Never use production keys in development environments
  3. Implement IP Whitelisting: If possible, restrict API access to known IP addresses
  4. Monitor Usage: Regularly check API key usage in your dashboard
  5. Revoke Compromised Keys: If a key is exposed, revoke it immediately

Before going live:

  1. Use a test API key (sk_test_*) for development
  2. Test with your own phone number first
  3. Verify error handling for common scenarios
  4. Check that rate limiting is handled gracefully
  5. Review all API responses for proper formatting

If you encounter issues with the API: