# REST API (SMS)

> An SMS REST API lets software send messages and read their status over HTTPS with JSON, using standard verbs and URLs, without a persistent connection or a telecom protocol.

REST maps messaging onto ordinary web requests. Resources such as messages, batches and rates have URLs; HTTP verbs say what to do with them, POST to create and GET to read; bodies are JSON; and outcomes are HTTP status codes, 2xx for success, 4xx for a problem with the request, 5xx for a problem on the server, with a machine-readable error code in the body. Each request is self-contained and carries its own credentials, so any language with an HTTP client can integrate without a special library, a persistent connection or a telecom protocol such as [SMPP](https://smsmeteor.io/glossary/smpp).

Sending SMS over REST is asynchronous by nature. The response to a POST confirms that the message was accepted, validated and priced; it cannot confirm delivery, which happens seconds or hours later on a carrier's network. Status arrives afterwards, by webhook or by reading the message again.

The qualities that separate a good SMS API show up under failure: [idempotency keys](https://smsmeteor.io/glossary/idempotency-key) so that retries never duplicate a send, stable error codes, signed webhooks, rate-limit headers, a test mode and a published OpenAPI description.

## Example

A hypothetical shop posts an order notification with the recipient in E.164, a sender and the text. The response returns a message id, the status queued, the segment count, the encoding and the price. Moments later a webhook reports the message sent, and shortly after, delivered.

## Common mistakes

- Treating a 2xx response as proof of delivery.

- Retrying a timed-out POST without an idempotency key.

- Matching on error messages instead of error codes.

- Calling the API from a browser or a mobile app, which exposes the key.

At SMSMeteor: six endpoints share one base URL, `https://api.smsmeteor.io/v1`: `POST /v1/messages` sends one message, `POST /v1/messages/batch` up to 1,000, `GET /v1/messages/{id}` returns one message's status, `GET /v1/messages` lists and filters with cursor pagination, `GET /v1/rates` returns the public rate card and `GET /v1/balance` the balance. Keys are bearer keys (`sk_live_`, `sk_test_`) scoped to `send`, `read` or both. Responses report `encoding` and `segments`, and the API never rewrites text. The OpenAPI 3.1 description is at [/docs/openapi.yaml](https://smsmeteor.io/docs/openapi.yaml), and SMPP is not offered to accounts. Start with the [quickstart](https://smsmeteor.io/docs/quickstart).

Related terms: [API key](https://smsmeteor.io/glossary/api-key), [Idempotency key](https://smsmeteor.io/glossary/idempotency-key), [Webhook](https://smsmeteor.io/glossary/webhook), [OpenAPI](https://smsmeteor.io/glossary/openapi), [SMPP](https://smsmeteor.io/glossary/smpp)

---
Source: https://smsmeteor.io/glossary/rest-api (HTML). Generated by SMSMeteor from the same data as the page. Summary of the whole site: https://smsmeteor.io/llms.txt
