Before you start
- Create an API key in the Rewrite dashboard.
- Keep the key server-side only.
- Use a valid destination number in E.164 format, for example
+5511999999999. - If you want deterministic test behavior, use Sandbox.
Send your first SMS
Common next steps
- Read the created resource later with
GET /messages/{id}. - Send batches with
POST /messages/batch. - Add webhooks to receive
message.sent,message.delivered,message.failed,message.received,message.batch, andsms.otp. - Use templates when you need locale-aware template reads and template-backed sends.
- Use Sandbox magic numbers to force deterministic outcomes while testing.
Troubleshooting
400 INVALID_JSON_BODY: request body, phone number, or route-specific validation failed.401 INVALID_OR_MISSING_API_KEY: bearer token is missing or invalid.403 API_KEY_MODE_MISMATCH: your API key mode does not match the current project mode.403 PROJECT_SUBSCRIPTION_REQUIREDorPROJECT_BILLING_PAYMENT_REQUIRED: project is blocked from sending.429 RATE_LIMITED: back off and honor the retry headers.