Base URLs
The API has two main components:Public API
/v2/* endpoints for sending notifications and managing templatesInternal API
Internal endpoints for service management (admin app only)
API Versions
Version 2 (Current)
All public API endpoints are under the/v2 prefix:
- Notifications:
/v2/notifications/{type} - Templates:
/v2/template/{id}and/v2/templates - Inbound SMS:
/v2/received-text-messages
Version 1 endpoints are deprecated and internal-only. All new integrations should use v2 endpoints.
API Characteristics
RESTful Design
- Standard HTTP methods:
GET,POST,DELETE - JSON request and response bodies
- HTTP status codes for success and error indication
- Resource-based URL structure
Authentication
All API requests require JWT authentication in theAuthorization header:
Content Type
All requests and responses use JSON:Response Format
Success Responses
Successful responses return the appropriate HTTP status code:200 OK- Successful GET request201 Created- Successful POST request that creates a resource204 No Content- Successful DELETE request
Example success response
Error Responses
Error responses include:- Status code - HTTP error code
- Errors array - List of error objects with details
Example error response
Common HTTP Status Codes
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Request successful |
| 201 | Created | Resource created successfully |
| 400 | Bad Request | Invalid request parameters |
| 401 | Unauthorized | Missing or invalid authentication |
| 403 | Forbidden | Service lacks required permissions |
| 404 | Not Found | Resource not found |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server error |
| 504 | Gateway Timeout | Request timed out |
Error Types
Common error types returned by the API:ValidationError
ValidationError
Request validation failed. Check the
message field for specific validation errors.Common causes:- Missing required fields
- Invalid field formats
- Invalid enum values
InvalidPhoneError
InvalidPhoneError
Phone number format is invalid.Common causes:
- Phone number not in E.164 format
- Invalid country code
- Landline number for SMS
InvalidEmailError
InvalidEmailError
Email address format is invalid.
AuthError
AuthError
Authentication failed.Common causes:
- Missing Authorization header
- Invalid JWT token
- Expired token
- Clock skew (token time > 30 seconds from server time)
RateLimitError
RateLimitError
API rate limit exceeded.Common causes:
- Too many requests per minute
- Exceeded daily message limit
BadRequestError
BadRequestError
Generic request error.Common causes:
- Invalid template ID
- Service lacks permission for notification type
- Recipient not allowed in trial mode
Client Libraries
Official client libraries are available for common programming languages:Python
pip install notifications-python-clientRuby
gem install notifications-ruby-clientJava
Maven/Gradle dependency
Node.js
npm install notifications-node-clientRate Limits
The API enforces rate limits to ensure fair usage:- Per-minute limit: Based on service configuration (default varies by key type)
- Daily limits: Separate limits for SMS, email, and letters
Next Steps
Authentication
Learn how to authenticate API requests
Send a notification
Start sending notifications
Rate limits
Understand rate limiting
Client libraries
Use official client libraries