Authentication
Txtly uses API keys for authentication. All requests must include a valid API key in the Authorization header.
API Keys
API keys start with the tx_ prefix and can be found in your Txtly dashboard. Treat them like passwords and never share them publicly.
Include your API key in the Authorization header using the Bearer scheme:
Authorization: Bearer tx_live_your_api_key_herePermission Levels
API keys support different permission levels to control what actions they can perform:
| Parameter | Type | Description |
|---|---|---|
full_access | permission | Full access to all API endpoints and resources. Can read, create, update, and delete any resource. |
sending_access | permission | Limited to sending emails and viewing send history. Cannot manage domains, contacts, or other resources. |
Domain-Scoped Keys
For enhanced security, you can create API keys that are restricted to specific domains. These keys can only send emails from the configured domain.
Example Request
Here's how to include your API key in a request:
curl -X GET https://api.txtly.com.au/me \
-H "Authorization: Bearer tx_live_your_api_key_here" \
-H "Content-Type: application/json"Error Responses
If authentication fails, you'll receive a 401 or 403 error response:
401 Unauthorized
{
"status_code": 401,
"name": "authentication_error",
"message": "Missing or invalid API key"
}403 Forbidden
{
"status_code": 403,
"name": "authorization_error",
"message": "Your API key does not have permission to access this resource"
}SMTP Authentication
If you prefer to send emails via SMTP, use the following credentials:
| Parameter | Type | Description |
|---|---|---|
host | string | smtp.txtly.com.au |
port | number | 587 (TLS) or 465 (SSL) |
username | string | Your API key (starts with tx_) |
password | string | Leave blank or use your API key |