Skip to content
SENDLY by ACTIOSENDLY by ACTIO
Blog
Tutorial11 min·

How to send your first SMS via API in 5 minutes – the complete guide

Most "SMS gateways" take days to set up: an application form, a contract, a sales call, a proprietary SDK to install. We go the other way – your first SMS through the API goes out in 5 minutes: create an account, generate a token, make one HTTP request. In this guide we walk the whole path: from the account, through working code in four languages, to webhooks and error handling – the things that decide whether an integration survives contact with production.

Step 1: account and Bearer Token

Create an account on the sign-up page – you get 100 free SMS, no credit card and no contract. Activation is instant, so you are not waiting on sales approval. In the client panel you generate and download a Bearer Token (the token can also be obtained through customer support). Treat it like a password – keep it in environment variables (e.g. ACTIO_TOKEN), never in a repository or front-end code. If it leaks, revoke it in the panel and generate a new one; the old one stops working immediately.

Step 2: the first request (curl)

The fastest test is a single call from the terminal. The endpoint accepts JSON and returns a message ID and status:

curl -X POST https://api.sendly.link/api/sms \
  -H "Authorization: Bearer $ACTIO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "48732129000",
    "body": "Your login code: 482910"
  }'

Two fields do the work: to (recipient number, 9–11 digits) and body (message content). The full reference – including the optional from field – is in the documentation.

Step 3: integrate in your stack

The API is plain REST, so it works with any language that speaks HTTP – no closed libraries to install. In Node.js the built-in fetch is enough; in Python use requests.post(...), in PHP cURL, in Go the standard net/http. Ready snippets in five languages are in the documentation – copy, swap the token, done.

Step 4: webhooks instead of polling

Sending an SMS is only half the story – you want to know it arrived. Sendly does not push statuses on its own: in the panel (SMS Gateway → Service settings) you enable deliveries and enter a public URL. Both steps are required. Then, instead of polling the API, you get a POST application/json (up to 36 attempts from the IP of api.sendly.link; 200 OK stops retries, as do 404 and 418). Two types: NOTIFICATION (send status – message_id and status: DELIVERED or ERROR) and MESSAGE (inbound SMS – from, to, body). Store message_id from the API response so you can match the callback to that message. Details and checklist: SMS API docs.

Error handling

In production, handle the API status codes up front. Success is 200 – the message is accepted for sending and the response contains a message_id. Errors: 403 (authorization problem), 422 (validation error – details in the errors.token / errors.to / errors.body fields) and 429 (rate limit exceeded). A good integration logs the message_id and status, and on 429 applies exponential backoff.

One API, three common use cases

The same API covers three very different scenarios without changing the integration: transactional notifications, 2FA / OTP codes and bulk campaigns to thousands of recipients. Billing is pay-as-you-go, with no subscription or entry threshold – check the rate for your volume in the pricing.

FAQ

Do I need a contract to test the API?+

No. You sign up with email, get 100 free SMS and test right away – no contract, no credit card.

Which languages have code samples?+

curl, Node.js, Python, PHP and Go – all in the documentation, ready to copy and swap the token.

How do I know an SMS was delivered?+

In the panel you enable deliveries and enter the webhook URL (both steps). The send response includes message_id – store it. Then the webhook receives a NOTIFICATION with the same id and DELIVERED or ERROR. You do not need to poll the API.

What error codes does the API return?+

Success is 200 (with a message_id field). Errors: 403 (authorization problem), 422 (validation error) and 429 (rate limit exceeded).

Read next

Start sending SMS today.

100 free messages. No credit card. No subscription. Activation in 30 seconds.