Send messages from your own code
Your software calls the Codelia SMS API over HTTPS with an API key. Requests and answers are JSON.
What you need
- An API key. Create one on the API keys screen in the portal.
- Your account ID. It starts with
org_, and every path for your organization's data includes it. - Credit in your organization's balance. A message that costs more than your balance isn't sent.
The base URL
Every request goes to https://api.sms.codelia.studio/v1, followed by the path. Send the key in an Authorization: Bearer header. This call works with any key, and it answers with your account ID:
curl "https://api.sms.codelia.studio/v1/api-key" \
-H "Authorization: Bearer $CODELIA_API_KEY"const response = await fetch(
`https://api.sms.codelia.studio/v1/api-key`,
{
headers: {
Authorization: `Bearer ${process.env.CODELIA_API_KEY}`,
},
},
);
console.log(response.status);
console.log(JSON.stringify(await response.json(), null, 2));Where to go next
- Quickstart: price a message, send it and check its status.
- Authentication: keys, permissions, and your account ID.
- Errors and limits: what each error means, the rate limit, and retrying safely.
- Zapier, Make and n8n: send messages and keep contacts up to date from those tools, without writing code.
- Sending messages: send to up to 500 numbers, choose a sender name, and count a message's parts.
- Contacts and lists: add and import contacts, and group them into static or smart lists.
- Campaigns and templates: send to lists, fill in each person's details, and schedule it.
- Recurring campaigns: send a campaign on a rule, like every Monday at 09:00.
- Opt-outs: how people opt out, and how to add or remove an opt-out yourself.
- Transactional messages: send a message people need, like a sign-in code or an order update.
- Webhooks: be told when a message is delivered or a campaign finishes, and check the signature.
- Billing: your balance, what a message costs, when you're charged or refunded, your usage and your activity log.
- Retrying safely: retry a request without sending a message twice, and what to do when you can't tell whether it went through.
- Paging through results: how each list pages, and how far.
- TypeScript SDK: call the API from TypeScript, with typed answers and errors.
- API reference: every endpoint a key can call, with examples.