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_here

Permission Levels

API keys support different permission levels to control what actions they can perform:

ParameterTypeDescription
full_accesspermissionFull access to all API endpoints and resources. Can read, create, update, and delete any resource.
sending_accesspermissionLimited 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:

ParameterTypeDescription
hoststringsmtp.txtly.com.au
portnumber587 (TLS) or 465 (SSL)
usernamestringYour API key (starts with tx_)
passwordstringLeave blank or use your API key