API Authentication
How to authenticate your API requests with Bearer tokens.
Bearer Token Authentication
All API requests to Sakura SMS require authentication via a Bearer token in the Authorization header.
Generating an API Key
- Go to Developer > API Keys in the portal
- Click Generate and give your key a descriptive name (e.g., "Production", "Staging")
- Copy the key immediately — it will not be shown again
Using the Key
Include the key in every request as a Bearer token:
Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxx
Security Best Practices
- Never expose keys in client-side code (browsers, mobile apps)
- Store keys in environment variables, not in source code
- Use separate keys for production and staging environments
- Rotate keys periodically and revoke unused ones
- If a key is compromised, revoke it immediately in the API Keys tab
Rate Limits
API requests are rate-limited to 50 requests per second per API key. If you exceed this limit, you'll receive a 429 Too Many Requests response. Implement exponential backoff in your retry logic.
Related in Developer API
Sending SMS via API
Complete guide to sending SMS programmatically using the REST API.
Webhooks & Callbacks
Receive real-time delivery notifications and event callbacks.
SDKs & Libraries
Quick-start code examples in Node.js, Python, PHP, and Java.
Rate Limits & API Best Practices
Understand rate limits and build resilient API integrations.