API Overview
Overview of the Transactional REST API.
API Overview
The Transactional API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes.
Base URL
All API requests should be made to:
https://api.usetransactional.com/v1Authentication
The Transactional API uses API keys to authenticate requests. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEYOr use the X-API-Key header:
X-API-Key: YOUR_API_KEYSee Authentication for detailed information.
Request Format
All requests should include the following headers:
Content-Type: application/json
Authorization: Bearer YOUR_API_KEYExample Request
curl -X POST https://api.usetransactional.com/v1/emails \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "sender@example.com",
"to": "recipient@example.com",
"subject": "Hello!",
"html": "<h1>Hello World</h1>"
}'Response Format
All responses are returned in JSON format:
Success Response
{
"success": true,
"data": {
"messageId": "msg_abc123",
"status": "QUEUED"
}
}List Response
{
"success": true,
"data": [...],
"meta": {
"count": 20,
"offset": 0,
"total": 150,
"hasMore": true
}
}Error Response
{
"success": false,
"error": {
"code": "INVALID_API_KEY",
"message": "The API key provided is invalid."
}
}See Error Handling for detailed error codes.
SDK Quickstart
TypeScript SDK
npm install transactional-sdkimport { Transactional } from 'transactional-sdk';
const client = new Transactional({
apiKey: process.env.TRANSACTIONAL_API_KEY,
});
// Send an email
const email = await client.emails.send({
from: 'sender@example.com',
to: 'recipient@example.com',
subject: 'Hello!',
html: '<h1>Hello World</h1>',
});
console.log(`Email sent: ${email.messageId}`);
// Send an SMS
const sms = await client.sms.send({
to: '+14155551234',
templateAlias: 'otp-verification',
templateModel: { code: '123456' },
});
console.log(`SMS sent: ${sms.messageId}`);Python SDK
pip install transactionalfrom transactional import Transactional
import os
client = Transactional(api_key=os.environ["TRANSACTIONAL_API_KEY"])
# Send an email
email = client.emails.send(
from_email="sender@example.com",
to="recipient@example.com",
subject="Hello!",
html="<h1>Hello World</h1>",
)
print(f"Email sent: {email.message_id}")
# Send an SMS
sms = client.sms.send(
to="+14155551234",
template_alias="otp-verification",
template_model={"code": "123456"},
)
print(f"SMS sent: {sms.message_id}")API Modules
The API is organized into modules:
| Module | Description | Base Path |
|---|---|---|
| Transactional email sending | /v1/emails | |
| SMS | SMS messaging | /v1/sms |
| Forms | Form builder & submissions | /v1/forms |
| Support | Live chat & conversations | /v1/support |
| Auth | Authentication as a service | /v1/auth |
| Calendar | Scheduling & bookings | /v1/calendar |
| Domains | Domain registration & DNS | /v1/domains |
Rate Limits
The API is rate limited to ensure fair usage. The current limits are:
| Plan | Requests per second |
|---|---|
| Starter | 50 |
| Growth | 200 |
| Scale | 1,000 |
| Enterprise | Custom |
Rate limit information is included in the response headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1609459200See Rate Limiting for detailed information.
Pagination
List endpoints support pagination:
curl "https://api.usetransactional.com/v1/emails/messages?count=50&offset=100" \
-H "Authorization: Bearer YOUR_API_KEY"See Pagination for detailed information.
Webhooks
Receive real-time notifications when events occur:
curl -X POST https://api.usetransactional.com/v1/webhooks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.com/webhooks",
"events": ["email.delivered", "email.bounced"]
}'See Webhooks for detailed information.
API Versioning
The current API version is v1. The version is included in the URL path:
https://api.usetransactional.com/v1/...We follow semantic versioning and will notify you of any breaking changes in advance.
Support
Need help? Here's how to get support:
- Documentation: Browse our comprehensive docs at usetransactional.com/docs
- Email: Contact support@usetransactional.com
- Status: Check system status at status.usetransactional.com
When contacting support, please include:
- Your organization ID
- The API endpoint you're calling
- The request ID from the
X-Request-Idheader - The full error response
Next Steps
- Authentication - Set up API keys
- Error Handling - Handle errors gracefully
- Email API - Send transactional emails
- SMS API - Send SMS messages