# Sendrail > Sendrail is a Czech SMS API for transactional messages: one HTTP call sends an SMS over our own network of GSM gateways, with an optional contracted backup operator. Prepaid credit in CZK, prices per segment without VAT, no monthly fee. Accounts are for business customers. Base URL of the API: https://api.sendrail.cz Authentication: `Authorization: Bearer ` (live keys start with `sr_live_`, test keys that send and charge nothing with `sr_test_`; both are created in the dashboard at https://sendrail.cz/app). Send a message: ``` curl -X POST https://api.sendrail.cz/v1/messages \ -H "Authorization: Bearer $SENDRAIL_API_KEY" \ -H "Content-Type: application/json" \ -d '{"to": "+420777123456", "message": "Your code is 482913"}' ``` Things that are easy to get wrong: - The field with the text is `message`, the recipient is `to` in international format (`+420…`). - `202` means accepted, not delivered. Read the final status from the webhook or `GET /v1/messages/{id}`. - Add `"dry_run": true` to check a message and its price without sending. - Send an `idempotency_key` with every message and repeat the same request after a timeout; it never sends twice. - The same text to the same number within five minutes is not sent again; the answer has `"duplicate": true`. A failed or cancelled message does not count. - Mass mailings must use `"type": "bulk"` or `POST /v1/messages/batch`. - For login and phone verification codes use `POST /v1/verify` and `POST /v1/verify/{id}/check` instead of making codes yourself. - Develop and test with a test key (`sr_test_…`): same answers, nothing is sent or charged; numbers ending in `0000` fail. - `403 recipient_opted_out` means the number is on the account's opt-out list. Do not retry. - Keep the API key in an environment variable (`SENDRAIL_API_KEY`), never in code or in a browser. ## Documentation - [Full documentation in Markdown](https://sendrail.cz/docs.md): every endpoint, field, status, error code and limit on one page - [OpenAPI description](https://api.sendrail.cz/v1/openapi.json): machine-readable schema of the API - [Documentation for people](https://sendrail.cz/docs): the same content as a web page - [Price list](https://api.sendrail.cz/v1/prices): JSON, price of one segment per country and plan ## Features - Verification codes (OTP): `POST /v1/verify`, `POST /v1/verify/{id}/check` - Templates with `{{variables}}`: `GET/PUT/DELETE /v1/templates`, send with `"template"` and `"variables"` - Number check without sending: `POST /v1/numbers/check` - List of sent messages with their text: `GET /v1/messages` (`limit`, `status`, `to`, `before`) - Webhook address of a key through the API (the owner allows it per key): `GET/PUT/DELETE /v1/webhook` - Further webhook addresses for integrations that subscribe by themselves, up to 10 per key: `GET/POST /v1/webhooks`, `DELETE /v1/webhooks/{id}` - Libraries: PHP `sendrail/sendrail-php`, Nette `sendrail/nette`, Laravel `sendrail/laravel` (Composer); n8n node `n8n-nodes-sendrail` (npm) - Opt-out list, filled also by STOP replies: `GET/POST/DELETE /v1/optouts` - Webhooks: `message.final`, `message.received`, `call.missed`, `optout.created` - [n8n workflows](https://sendrail.cz/n8n): ready to import ## AI agents - [Agent skill](https://github.com/sendrailcz/skills): a `SKILL.md` for Claude Code and other agents. - [MCP server](https://sendrail.cz/ai): `https://api.sendrail.cz/mcp`, Streamable HTTP, authenticated with the API key in the `Authorization: Bearer` header, or by OAuth 2.1 sign-in for connectors (Claude on the web, ChatGPT). Tools: send_message, estimate_message, get_message, cancel_message, list_messages, list_inbound, get_account, check_number, get_prices. - Give an agent its own API key and set limits on it in the dashboard: messages per 24 hours, spend per 24 hours, allowed recipients, allowed countries. ## Optional - [Terms](https://sendrail.cz/podminky): Czech - [Privacy](https://sendrail.cz/soukromi): Czech - [Contact](https://sendrail.cz/kontakt): info@sendrail.cz