Current

API reference · v2

API documentation

The FasterMessage REST contract: send SMS and email, verify codes, manage your address book, follow every delivery and steer your balance from a single interface.

Quick start

The FasterMessage API currently sends SMS, email and WhatsApp messages, handles verification codes (OTP) and an address book, from a single REST contract. Voice is declared in the contract but not served yet: see Availability.

1. Collect your credentials

In the back office, open Integration & API. There you find your API username and password, and there you generate two keys: a test key and a live key. A key is shown only once: it is stored hashed and cannot be read back.

2. Declare a sender

SMS requires an approved Sender ID, email an active sending address. Both are declared in the back office. See Senders.

3. Send with the test key

First send
curl -X POST https://api.fastermessage.com/v2/sms/send \
  -u "$FM_API_USER:$FM_API_SECRET" \
  -H "X-Api-Key: $FM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "+2290160000000",
  "from": "FASTERMSG",
  "content": "Your order is ready."
}'
Response — 201 Created
{
  "id": "66f1c2a4e8b7d90012ab34cd",
  "channel": "sms",
  "status": "queued",
  "to": "+2290160000000",
  "from": "FASTERMSG",
  "units": 1,
  "price": null,
  "currency": "",
  "refund": null,
  "client_reference": null,
  "fallback_of": null,
  "fallback": null,
  "error": null,
  "created_at": "2026-11-04T10:00:00.000Z",
  "scheduled_at": null,
  "sent_at": null,
  "delivered_at": null
}

4. Track, then go live

  • Read the message back through GET /v2/messages/{id}, or receive its outcome on a webhook.
  • Make your sends replayable with Idempotency-Key: a send cannot be cancelled.
  • Replace the fm_test_… key with the fm_live_… key. Nothing else changes, and the first real send remains a milestone to check: test proves neither the balance, nor the price, nor the delivery.

Authentication

Every call carries two credentials, both mandatory, in headers only: never in the URL or the body. This is not redundancy, the two do not designate the same thing.

CredentialHeaderDesignates
BasicAuthorizationThe account charged: base64(username:password).
API keyX-Api-KeyThe account making the request: the same account, or one of its sub-accounts.
Headers
Authorization: Basic bW9uLWNvbXB0ZTpzZWNyZXQ=
X-Api-Key: fm_live_xxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json

Which account for what?

TopicAccount used
Balance, charge, movementsThe charged account (Basic).
Sender ID, sending addressThe key’s account.
“Do not contact” listThe key’s account: a sub-account keeps its own opt-outs.
Messages read back, contacts, OTPThe key’s account.
Rate limitThe key’s account: two sub-accounts each have their own pace.

Keep both server-side. A key exposed in a web or mobile client is a published key: revoke it from the back office and generate a new one.

Environments

EnvironmentKey prefixBehaviour
testfm_test_…Simulated sends, on SMS and email: nothing is delivered, nothing is charged, no webhook is called.
productionfm_live_…Real sends, charged, delivered, genuine receipts.

What a test key does

  • Same checks as in production, same error codes: number, sender, content, “Do not contact”, destination. Your sender must therefore be approved, even in test.
  • No balance or price required: you can write your whole integration before buying anything.
  • An immediate send is marked delivered at once, a scheduled send stays scheduled. price is always null.
  • Messages sealed off: a test key reads back only its simulated sends, never your real traffic, and the other way round. Simulations are erased after 30 days.
  • OTP: the code is a run of zeros (000000, or 0000 depending on the length). Since no SMS goes out, this is what lets you exercise POST /v2/otp/verify.

Try the API

Compose a call with your test credentials and run it from this page. The equivalent snippet is regenerated live in all four languages.

Test environment only — never use your production credentials on this page. The values you type stay in your browser: they are neither stored nor sent to a third party.

Test credentials

The account to charge — the “Basic” half of the authentication.

The second half of the “Basic”. Never displayed, never copied into the samples.

X-Api-Key header. The fm_test_ prefix guarantees no real send is triggered.

Message

11 characters at most. Mandatory — there is no default sender.

E.164 format: country code then number, 8 to 15 digits.

37 characters1 billed segmentGSM-7

curl -X POST https://api.fastermessage.com/v2/sms/send \
  -u "$FM_API_USER:$FM_API_SECRET" \
  -H "X-Api-Key: $FM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "",
  "from": "FASTERMSG",
  "content": "Your code is 480912. Valid for 5 min."
}'

Fill in the required fields to run the call.

SDKs and plugins

The official SDKs and plugins rely only on API v2. This table says “available” only for what you can install today.

ToolTypeStatus
PHPSDKAvailable (PHP 8.1 or later): SMS, email, WhatsApp, OTP, contacts, usable numbers, templates and addresses
Node.js / TypeScriptSDKAvailable (Node.js 20.3 or later): SMS, email, WhatsApp, OTP, contacts, usable numbers, templates and addresses
PythonSDKIn preparation
JavaSDKIn preparation
SymfonyPluginIn preparation
WordPressPluginAvailable (WordPress 6.5 and PHP 8.1 or later): SMS, WhatsApp and email — download
WooCommercePluginAvailable (WooCommerce 8.9 or later, with the WordPress plugin 0.2.0): order notifications by SMS and WhatsApp — download
PrestaShopPluginIn preparation
ShopifyPluginIn preparation

Install the PHP SDK

Installation
composer require fastermessage/fastermessage-php
Send an SMS
use FasterMessage\Client;

$fm = new Client(
    getenv('FM_API_USER'),
    getenv('FM_API_PASSWORD'),
    getenv('FM_API_KEY'), // fm_test_… / fm_live_…
);

$message = $fm->sms->send([
    'to' => '+2290160000000',
    'from' => 'FASTERMSG',
    'content' => 'Votre commande est prete.',
    'client_reference' => 'cmd-42',
]);

echo $message['id'], ' ', $message['status']; // queued
Send a WhatsApp message
$message = $fm->whatsapp->send([
    'to' => '+2290160000000',
    'from' => '+2290161000000', // votre numéro WhatsApp raccordé
    'content' => [
        'template' => 'confirmation_commande',
        'language' => 'fr',
        'variables' => ['1' => 'Awa', '2' => '1187'],
    ],
]);

// Code de vérification par WhatsApp (modèle d'authentification)
$otp = $fm->otp->request(['to' => '+2290160000000', 'channel' => 'whatsapp', 'from' => '+2290161000000']);

The source code and full reference are on GitHub. On your brand’s API domain, add the base_url option to the client.

Install the Node.js SDK

Installation
npm install @fastermessage/sdk
Send an SMS
import { FasterMessage } from '@fastermessage/sdk';

const fm = new FasterMessage({
  username: process.env.FM_API_USER,
  password: process.env.FM_API_PASSWORD,
  apiKey: process.env.FM_API_KEY, // fm_test_… / fm_live_…
});

const message = await fm.sms.send({
  to: '+2290160000000',
  from: 'FASTERMSG',
  content: 'Votre commande est prete.',
  client_reference: 'cmd-42',
});

console.log(message.id, message.status); // queued
Send a WhatsApp message
const message = await fm.whatsapp.send({
  to: '+2290160000000',
  from: '+2290161000000', // votre numéro WhatsApp raccordé
  content: { template: 'confirmation_commande', language: 'fr', variables: { 1: 'Awa', 2: '1187' } },
});

// Code de vérification par WhatsApp (modèle d'authentification)
const otp = await fm.otp.request({ to: '+2290160000000', channel: 'whatsapp', from: '+2290161000000' });

Node.js 20.3 or later, server side only: the client carries your credentials and refuses to start in a browser. The source code and full reference are on GitHub.

Install the WordPress plugin

Download the fastermessage-x.y.z.zip file of the latest release, then in WordPress: Plugins › Add New › Upload Plugin. In Settings › FasterMessage, enter your API username, password and key, then click “Test the connection”. The plugin sends SMS, WhatsApp messages and emails from the admin screen or from your code (fastermessage_send_sms(), fastermessage_send_whatsapp(), fastermessage_send_email()), and offers as lists the numbers, templates and addresses your account can use. Since version 0.2.0, an option (off by default) also sends the emails WordPress sends by itself through FasterMessage, with an automatic fallback to the normal sending.

Install the WooCommerce plugin

It complements the WordPress plugin, which must be installed and configured (version 0.2.0 or later). Download the fastermessage-woocommerce-x.y.z.zip file of the latest release, upload it like the WordPress plugin, then configure it in WooCommerce › Settings › FasterMessage. It notifies the customer at each order status change, by SMS, by WhatsApp or by WhatsApp with an SMS fallback, chosen for each status, alerts the shop on each new order, and asks for the customer’s consent at checkout.

Availability

What is declared in the contract without being served answers 501 not_implemented. This is not an outage: retrying changes nothing.

FeatureStatusDetail
SMSservedSingle send, batch of up to 500, scheduling, tracking, webhooks.
EmailservedSingle send to one address, scheduling, tracking, webhooks. No batch.
OTPservedBy SMS (default) or WhatsApp (authentication template).
Contacts and groupsservedThe same address book as the back office.
Balance and movementsserved
WhatsAppservedApproved template, or free text within the 24-hour window. Tracking, webhooks, fallback, OTP. Not yet: batch, scheduling, media header. See Send a WhatsApp message.
Voice501Sending and reading: not_implemented.
Campaign reports501GET /v2/campaigns and GET /v2/campaigns/{id}.
Cross-channel fallbackservedBetween SMS, email and WhatsApp, single sends and OTP. See Fallback.

Shape of exchanges

TopicRule
Basehttps://api.fastermessage.com, or your brand’s API domain. A key is only valid on its brand’s domains.
BodyJSON, with Content-Type: application/json.
SuccessThe resource as it stands, with no wrapper: the HTTP code carries the outcome.
Fieldssnake_case.
DatesISO 8601 in UTC. Always write the time zone: 2026-11-04T10:00:00Z.
IdentifiersOpaque strings. Do not parse them.
Numbers8 to 15 digits, + optional. Spaces and punctuation are stripped; the + is kept in the response when provided.
EvolutionThe contract is stable and additive: fields and codes may be added, none changes meaning. Ignore the fields you do not know.
Unreadable valuesRefused with 400, never ignored. error.param names the field, including nested ones (content.subject, messages[3].to).

Success codes

HTTPRoutes
200Reads, PATCH, POST /v2/sms/batch, POST /v2/contacts/batch, POST /v2/otp/verify.
201Single sends, POST /v2/otp, creating a contact or a group.
204DELETE: no body.

Response headers

HeaderContent
X-Request-IdRequest identifier, echoed in error.request_id. You may provide your own: letters, digits, . _ : -, 100 characters at most.
X-RateLimit-*Rate state: see Limits.

Idempotency

A send cannot be cancelled. If your call times out on the network, you do not know whether it went through: without protection, replaying it sends and charges twice. The optional Idempotency-Key header solves this on any POST, PATCH or DELETE request.

Header
Idempotency-Key: cmd-42-2026-11-04

What happens on replay

SituationResponse
Same key, same method, same path, same bodyThe memorised response, HTTP code included. Nothing is re-executed or charged. JSON field order does not count.
Same key, other payload or other route409 idempotency_key_reuse.
Same key, first request still in flight409 idempotency_key_in_flight. Wait, then replay unchanged.
The first request failed (4xx, 5xx)The key is released: the replay really runs. Only successes are memorised.
More than 24 h laterThe key is forgotten: the call goes through again.

Pagination

Lists are walked by cursor, newest first: an insertion during the walk neither skips nor duplicates a line. Pass next_cursor back as ?cursor= as long as has_more is true.

Common parameters

FieldTypeDescription
limitoptionalintegerPage size: 50 by default, 200 at most. Beyond that, the value is capped with no error.
cursoroptionalstringOpaque next_cursor value, to pass back as is. An unreadable value is refused (400 invalid_cursor).
Shape of a page
{
  "data": [ ... ],
  "has_more": true,
  "next_cursor": "NjZmMWMyYTRlOGI3ZDkwMDEyYWIzNGNk"
}

Send an SMS

Méthode HTTP POSThttps://api.fastermessage.com/v2/sms/send

Sends an SMS to one recipient. Returns 201 Created and the message resource: the request is accepted and queued, delivery is asynchronous.

Request body

FieldTypeDescription
torequiredstringRecipient number: 8 to 15 digits, + optional.
fromrequiredstringSender ID the key’s account may use. No default sender is applied. Case does not matter: the SMS goes out under the spelling of the declared record.
contentrequiredstring | objectThe text, or { text, unicode }. unicode: true (strict boolean) keeps accents and emojis, at the cost of shorter segments.
scheduled_atoptionalstringSend date, ISO 8601 with time zone. Absent or past = immediate send. Unreadable = 400.
callback_urloptionalstringhttp(s) callback URL for this message. Takes precedence over the account’s. See Webhooks.
client_referenceoptionalstringYour free-form reference, echoed in the response and webhooks, and filterable on read. It deduplicates nothing: that is the job of Idempotency-Key.
fallbackoptionalarrayChannels to try if the message fails, with their recipient and sender: see Fallback.
Request
curl -X POST https://api.fastermessage.com/v2/sms/send \
  -u "$FM_API_USER:$FM_API_SECRET" \
  -H "X-Api-Key: $FM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "+2290160000000",
  "from": "FASTERMSG",
  "content": "Your order cmd-42 is ready.",
  "client_reference": "cmd-42",
  "callback_url": "https://example.test/webhooks/messages"
}'
Error — 402 Payment Required
{
  "error": {
    "type": "business_error",
    "code": "insufficient_balance",
    "message": "Insufficient balance to process the request.",
    "request_id": "2f1c9d4e-8a6b-4c1e-9f2a-7d3b5e0c1a84"
  }
}

Encoding and segments

EncodingWhen1 segmentPer segment beyond
GSM-7By default. Accents are removed (é becomes e), other characters outside the alphabet are replaced with a safe equivalent or deleted, emojis included. That text is what is counted, charged and sent.160153
UCS-2content.unicode: true. An emoji counts as 2.7067

units returns the number of segments charged. To keep an accented text, pass content.unicode: true, and check its length: a long message then costs more segments.

When the balance is charged

  • Immediate send: charged on receipt, according to the recipient and the number of segments. If the balance does not cover this message: 402, and nothing is created.
  • Scheduled send: charged when due. On receipt, only a zero balance is refused. If the balance no longer covers the send when due, the message moves to failed.
  • The send response returns price: null and currency: "": the amount is read later on GET /v2/messages/{id} or in GET /v2/credits.

Refusals to know

HTTPcodeCause
400missing_parameterto, content or from missing; param names it.
400invalid_numberUnreadable number.
400unsupported_destinationCountry not served by the platform. Do not retry this number.
402insufficient_balanceSMS balance too low.
403sender_not_approvedSender ID unknown or not approved.
403destination_not_pricedCountry served, but not open to this account: ask your provider for a price.
403recipient_opted_outNumber on your “Do not contact” list. Another format changes nothing.
409account_not_configuredThe account has no default price. Topping up changes nothing.

Send an email

Méthode HTTP POSThttps://api.fastermessage.com/v2/email/send

Sends an email to one address only. Returns 201 Created and the message resource. The contract does not currently provide copies, attachments or a reply-to address.

Request body

FieldTypeDescription
torequiredstringRecipient address.
fromoptionalstringSending address allowed for the key’s account. Absent: its oldest active address, or 400 sender_required when it has none.
contentrequiredobject{ subject, html, text, reply_to }. subject is mandatory, with html and/or text. A bare string is refused (400 invalid_content). reply_to is optional: the address that receives the recipient’s replies, without a display name. It does not have to be a sending address of the account.
scheduled_atoptionalstringSame as for SMS.
callback_urloptionalstringSame as for SMS.
client_referenceoptionalstringSame as for SMS.
Request
curl -X POST https://api.fastermessage.com/v2/email/send \
  -u "$FM_API_USER:$FM_API_SECRET" \
  -H "X-Api-Key: $FM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "[email protected]",
  "from": "[email protected]",
  "content": {
    "subject": "Your November invoice",
    "html": "<p>Hello Awa, your invoice is available.</p>",
    "text": "Hello Awa, your invoice is available."
  },
  "client_reference": "invoice-1187"
}'

Refusals to know

HTTPcodeCause
400missing_parametercontent.subject, or content.html and content.text both absent.
400invalid_recipientInvalid recipient address.
400invalid_parametercontent.reply_to is not a valid address (a display name, Awa <[email protected]>, is refused).
400sender_requiredNo from, and no active address on the account.
402insufficient_balanceEmail balance at zero.
403sender_not_approvedSending address unknown or not allowed.
403recipient_opted_outAddress on your email “Do not contact” list.
409account_not_configuredNo email price is set for this account. A price of 0 counts as no price.

WhatsApp

WhatsApp follows Meta’s rules, and they change how you send: you write from a number that belongs to you, and a first message always goes through an approved template. This page gathers what to know before calling POST /v2/whatsapp/send.

Before the first send

  • A WhatsApp number connected to your account, from the back office, and validated by the platform. It is your sender: from is mandatory, no number is chosen for you.
  • Templates approved by Meta, created or imported from the back office. A template is named by its name and its language; it must belong to the same WhatsApp Business account as the number sending it.
  • A WhatsApp price on your account, and a balance covering at least one message.
  • The usable numbers and templates can be read with GET /v2/whatsapp/numbers and GET /v2/whatsapp/templates, expected variables included — see Account resources.

Template or free text

ContentWhenRate
Template { template, language, variables }At any time.Its category’s: marketing or utility.
Free text { text }Only if the recipient wrote to this number in the last 24 hours. Otherwise 409 session_window_closed.Service.
Verification codeAt any time, through POST /v2/otp and your authentication template.Authentication.

A template’s variables are passed in an object: "1", "2"… for {{1}}, {{2}}… of the body, "header" for a text header variable, "button_1"… for a button link suffix. A missing variable is refused, naming it: nothing goes out.

Price, tracking and callbacks

  • Price: by the recipient’s country and the message category. It is held when the message leaves, charged on delivery and returned on failure.
  • Statuses: queued, sent (accepted by Meta), delivered, undelivered (failure after acceptance), failed (refused before any send). A read message stays delivered: its reading is in read_at.
  • Webhook: in the same format as SMS — Sended, Delivered, Undelivered or Rejected. Reading is not notified. See Webhooks.
  • Fallback: a WhatsApp message can fall back to SMS or email, and WhatsApp can serve as a fallback step. See Fallback.
  • Test key: the send is simulated, without price or balance, with the same checks as for real.

Send a WhatsApp message

Méthode HTTP POSThttps://api.fastermessage.com/v2/whatsapp/send

Sends a WhatsApp message to one number only, from a WhatsApp number connected to your account. Returns 201 Created and the message resource. Two possible contents, and Meta’s rule decides: an approved template goes at any time; a free text only goes if the recipient wrote to this number in the last 24 hours.

Request body

FieldTypeDescription
torequiredstringRecipient number, in international format.
fromrequiredstringSending WhatsApp number, connected to your account. Mandatory: no number is chosen for you.
contentrequiredobject{ template, language, variables } for a template, or { text } for a free text (4,096 characters at most). The template is named by its name; language is optional when it exists in one language only.
content.variablesoptionalobject"1", "2"… for {{1}}, {{2}}… of the body; "header" for a text header variable; "button_1", "button_2"… for a button link suffix, by its position. A missing variable is refused, naming it.
callback_urloptionalstringSame as for SMS.
client_referenceoptionalstringSame as for SMS.
Request
curl -X POST https://api.fastermessage.com/v2/whatsapp/send \
  -u "$FM_API_USER:$FM_API_SECRET" \
  -H "X-Api-Key: $FM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "+2290160000000",
  "from": "+2290161000000",
  "content": {
    "template": "order_confirmation",
    "language": "en",
    "variables": {
      "1": "Awa",
      "2": "1187"
    }
  },
  "client_reference": "order-1187"
}'

Refusals to know

HTTPcodeCause
400sender_requiredNo from.
400template_not_foundNo template with this name and language on the account, or a template of another WhatsApp Business account than the sending number.
400template_not_sendableTemplate not approved by Meta, an authentication template (see OTP) or with a media header (not open to the API yet).
400invalid_contentMissing variable, language to specify, or empty or too long text.
400unsupported_parameterscheduled_at: not open on WhatsApp yet.
402insufficient_balanceWhatsApp balance below the price of one message.
403sender_not_approvedSending number not connected to your account.
403sender_unavailableNumber disconnected, awaiting validation, or restricted by Meta (it can still reply within the 24-hour window).
403recipient_opted_outNumber on your WhatsApp “Do not contact” list.
409session_window_closedFree text outside the 24-hour window: send a template.
409account_not_configuredNo WhatsApp price for this country and category.

Unified sending

Méthode HTTP POSThttps://api.fastermessage.com/v2/messages

Same effect as the per-channel routes, with the channel as a parameter: channel is sms, email or whatsapp. Useful to switch channel by configuration, without changing the call. Both paths share the same rules and return the same resource.

Request
curl -X POST https://api.fastermessage.com/v2/messages \
  -u "$FM_API_USER:$FM_API_SECRET" \
  -H "X-Api-Key: $FM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "channel": "sms",
  "to": "+2290160000000",
  "from": "FASTERMSG",
  "content": "Your appointment is confirmed."
}'
  • channel absent: 400 missing_parameter. Unknown channel: 400 invalid_channel.
  • On a per-channel route, a contradictory channel is refused (400 channel_mismatch), never ignored.
  • POST /v2/voice/send and channel: voice answer 501 not_implemented, once the body is validated.

Cross-channel fallback

If your message does not get through, FasterMessage sends it on the next channel you listed. The fallback field is an array, one line per channel, in the order you want. It goes on POST /v2/messages, POST /v2/sms/send, POST /v2/email/send and POST /v2/otp. Batch sending has no fallback: POST /v2/sms/batch refuses it with 400 invalid_fallback.

When the fallback runs

SendThe fallback runs…
MessageAs soon as the message definitely fails, with no delay. A delivered message triggers nothing.
OTP, SMS failedAt once, without waiting for the delay.
OTP, SMS sentIf the code is not confirmed within the delay set on your account (OTP screen), even when the SMS is delivered.
SMS, with email fallback
{
  "channel": "sms",
  "to": "+22997000000",
  "from": "MABOUTIQUE",
  "content": "Votre commande est prête.",
  "fallback": [
    {
      "channel": "email",
      "to": "[email protected]",
      "from": "[email protected]",
      "content": { "subject": "Votre commande", "text": "Votre commande est prête." }
    }
  ]
}

A fallback line

FieldTypeDescription
channelrequiredstringsms, email or whatsapp. voice is accepted but does not go out yet. Neither the primary channel nor a duplicate. To WhatsApp, content is { template, language, variables } (approved template) or { text } (free text, which only goes if the 24-hour window is open); for an OTP, the authentication template, which you can omit when the account has only one. After a WhatsApp template message, an email step must carry its own content.
torequiredstringRecipient on this channel: email address or number.
fromrequiredstringApproved sender on this channel: address or Sender ID.
contentoptionalobjectTo email: optional, the SMS text is reused and the default subject is your brand name. To SMS: required, an email does not boil down to an SMS. For an OTP: optional, and a custom content must contain {code}.

What the response says

A badly written line refuses the request (400) and nothing goes out. A block tied to your account, however, never stops the main message: it goes out, and the fallback field of the response says, channel by channel, what cannot follow.

Fallback field of the response
{
  "fallback": {
    "will_run": true,
    "state": "watching",
    "steps": [
      { "channel": "whatsapp", "will_run": false, "reason": "channel_not_available", "message_id": null },
      { "channel": "email", "will_run": true, "reason": null, "message_id": null }
    ]
  }
}
reasonMeaning
channel_not_availableVoice, not open yet.
invalid_recipientUnreadable fallback recipient.
sender_not_allowedSender not approved on this account.
channel_not_pricedNo price on this channel.
insufficient_balanceInsufficient balance on this channel.
recipient_blockedRecipient on the “Do not contact” list.
destination_not_availableCountry not served, or without a price on this account.
ttl_too_shortOTP: the code would expire before the delay ends.
rate_limitedOTP: too many codes requested for this address within an hour.
account_not_activeSince the request: account suspended, brand disabled, API access closed or key replaced.
send_failedIncident while preparing or sending the fallback.
template_not_availableWhatsApp: template not found, not approved or incomplete.
session_window_closedWhatsApp: free text outside the 24-hour window.
  • Billing: the fallback is a send charged at the price of its channel, on top of the original message, which keeps its charge unless refunded under the usual rules.
  • Watching: a message without an outcome after 72 hours no longer triggers a fallback (expired).
  • Refused send: if the main message is refused at request time, for lack of balance for example, you get the error and no fallback starts.

Test with a test key

With fm_test_…, add "test_outcome": "failed" to your send: the simulated message fails and the simulated fallback goes out within seconds, with no cost or delivery. Read it back through GET /v2/messages/{id}. For an OTP, without this field, the fallback goes out once the delay is over if you do not confirm the code. A live key refuses test_outcome with 400.

Batch sending (SMS)

Méthode HTTP POSThttps://api.fastermessage.com/v2/sms/batch

Up to 500 SMS per call, for a single rate unit. Values set at batch level are inherited by every line that does not carry its own: the same route serves broadcasting (one text, N numbers) and grouped transactional sending (one text per line). Every line becomes an ordinary message, tracked and charged individually.

Request body

FieldTypeDescription
messagesrequiredarrayFrom 1 to 500 lines. Each accepts to, from, content, scheduled_at, callback_url and client_reference.
fromoptionalstringBatch sender. Mandatory as soon as a line has none of its own.
contentoptionalstring | objectBatch content, mandatory when no line has its own.
scheduled_atoptionalstringCommon send date.
callback_urloptionalstringCommon callback URL.
Request
curl -X POST https://api.fastermessage.com/v2/sms/batch \
  -u "$FM_API_USER:$FM_API_SECRET" \
  -H "X-Api-Key: $FM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "from": "FASTERMSG",
  "content": "Your delivery arrives tomorrow between 9 am and 12 pm.",
  "messages": [
    {
      "to": "+2290160000000",
      "client_reference": "cmd-42"
    },
    {
      "to": "+2290161000001",
      "content": "Your delivery arrives today.",
      "client_reference": "cmd-43"
    },
    {
      "to": "2296",
      "client_reference": "cmd-44"
    }
  ]
}'
Success — 200 OK (report, lines shortened)
{
  "total": 3,
  "accepted": 2,
  "rejected": 1,
  "data": [
    { "index": 0, "id": "66f1c2a4e8b7d90012ab34cd", "status": "queued", "to": "+2290160000000", "units": 1 },
    { "index": 1, "id": "66f1c2a4e8b7d90012ab34ce", "status": "queued", "to": "+2290161000001", "units": 1 }
  ],
  "errors": [
    {
      "index": 2,
      "code": "invalid_number",
      "message": "The recipient number is not valid.",
      "param": "messages[2].to",
      "to": "2296"
    }
  ]
}

data carries the full message resource of each accepted line, plus its index, its position (zero-based) in messages. accepted + rejected always equals total. A report says what was accepted, not what was delivered.

Refused as a whole or per line

ScopeResponseCauses
Whole batch400Malformed body, messages absent or empty, more than 500 lines (batch_too_large), from or content missing for a line, unreadable date or URL. Nothing is sent.
Whole batch402Balance at zero.
Whole batch403Batch from unknown or not approved.
Whole batch409Account with no default price (account_not_configured).
Line200, in errorsUnreadable number or unserved destination, empty content, line from refused, recipient opted out, country closed to the account, balance no longer covering this line.

Read a message

Méthode HTTP GEThttps://api.fastermessage.com/v2/messages/{id}

Returns the message resource, in the shape that sending returns. The identifier is enough: it is looked up on both SMS and email. For an SMS sent before the migration, {id} can also be the uuid returned by the former platform. An identifier that is unknown or belongs to another account gives the same 404 message_not_found.

Request
curl https://api.fastermessage.com/v2/messages/66f1c2a4e8b7d90012ab34cd \
  -u "$FM_API_USER:$FM_API_SECRET" \
  -H "X-Api-Key: $FM_API_KEY"
Success — 200 OK
{
  "id": "66f1c2a4e8b7d90012ab34cd",
  "channel": "sms",
  "status": "delivered",
  "to": "+2290160000000",
  "from": "FASTERMSG",
  "units": 1,
  "price": 12,
  "currency": "XOF",
  "refund": null,
  "client_reference": "cmd-42",
  "fallback_of": null,
  "error": null,
  "created_at": "2026-11-04T10:00:00.000Z",
  "scheduled_at": null,
  "sent_at": "2026-11-04T10:00:01.420Z",
  "delivered_at": "2026-11-04T10:00:06.900Z"
}

List messages

Méthode HTTP GEThttps://api.fastermessage.com/v2/messages

Query parameters

FieldTypeDescription
channeloptionalstringsms (default), email or whatsapp. Without this filter, only SMS are returned: for your emails, ask for channel=email, for your WhatsApp messages channel=whatsapp. voice: 501.
statusoptionalstringOne of the six statuses. scheduled and queued return the same lines, as do undelivered and failed: read status on each line to tell them apart.
client_referenceoptionalstringYour reference, exact: client_reference in v2, messageId in v1, history from before the migration included.
limit, cursoroptionalinteger, stringSee Pagination.
Request
curl https://api.fastermessage.com/v2/messages?channel=email&status=delivered&limit=100 \
  -u "$FM_API_USER:$FM_API_SECRET" \
  -H "X-Api-Key: $FM_API_KEY"

Message resource

FieldTypeDescription
idrequiredstringOur message identifier.
channelrequiredstringsms or email.
statusrequiredstringSee the table below.
torequiredstringNormalised recipient.
fromrequiredstringSender used, as it goes out.
unitsrequiredintegerUnits charged: segments for SMS, 1 for email.
pricerequirednumber | nullCost charged. null when not settled, when zero, in test, and in the send response.
currencyrequiredstringCurrency of the charge. May be empty: always at sending and in test, and on email. Balance and movements carry the currency reliably.
refundrequiredobject | null{ amount, currency, refunded_at } when the message was refunded. Filled in for SMS.
client_referencerequiredstring | nullYour reference.
fallback_ofrequiredstring | nullAlways null to date.
fallbackoptionalobject | nullSingle-send response only. See Fallback.
errorrequiredobject | null{ code, message, provider_code } when the message failed. See Failure reasons.
created_atrequiredstringRequest received.
scheduled_atrequiredstring | nullScheduled date.
sent_atrequiredstring | nullHanded to the network.
delivered_atrequiredstring | nullDelivered to the recipient.
read_atoptionalstring | nullRead by the recipient — WhatsApp only, absent from the other channels.

Statuses

StatusTerminalMeaning
schedulednoScheduled: waiting for its date.
queuednoAccepted and queued: waiting for its turn.
sentnoHanded to the network, final receipt not received.
deliveredyesDelivered to the recipient.
undeliveredyesPresented, but not delivered: failure reported by the carrier or the mail server.
failedyesNever left, or refused before the network: balance, sender, incident.

Webhooks

Rather than polling GET /v2/messages/{id}, receive the outcome of your messages on your server. A test key calls no webhook: try this point with a real send.

Configure

  • URL: on the account (back office, Integration & API), or per message with callback_url, which then takes precedence. A sub-account with no URL inherits its affiliator’s, along with its events, verb and secret.
  • Events: delivered and failed by default, sent optional (SMS). This setting also applies to callback_url. An empty selection suspends callbacks. scheduled and queued are never notified.
  • Verb: POST by default. With GET on the account, no body is sent: only uuid and level arrive, for SMS, in the query.
  • Address: a URL resolving to an internal or private address is never called, with no error on your side. Serve it over HTTPS.
  • Fallback: requesting a fallback is enough to receive its outcome, whatever events are ticked, always as POST. Only an empty selection suspends it too.

Payload received: SMS

POST your-url?uuid=…&level=2
{
  "uuid": "66f1c2a4e8b7d90012ab34cd",
  "level": 2,
  "status": "Delivered",
  "receivedAt": "2026-11-04T10:00:06.900Z",
  "messageId": "cmd-42",
  "from": "FASTERMSG",
  "to": "+2290160000000",
  "text": "Votre commande cmd-42 est prete.",
  "smsCount": 1,
  "sentAt": "2026-11-04T10:00:01.420Z",
  "messageStatusCode": "",
  "messageStatus": "Delivered",
  "description": "",
  "reference": "",
  "batchuuid": ""
}

SMS status mapping

Callback statusResource statusEvent
Sendedsentsent
Delivereddelivereddelivered
Undeliveredundeliveredfailed
Rejectedfailedfailed

messageId is your client_reference. messageStatusCode carries the carrier code on failure, description a reason in French. reference and batchuuid are empty. level is 1 for a response at submission, 2 for a delivery receipt.

Payload received: email

POST your-url
{
  "id": "66f1c2a4e8b7d90012ab34cd",
  "channel": "email",
  "status": "failed",
  "to": "[email protected]",
  "from": "[email protected]",
  "subject": "Votre facture de novembre",
  "client_reference": "facture-1187",
  "provider_message_id": null,
  "sent_at": "2026-11-04T10:00:01.420Z",
  "event_at": "2026-11-04T10:00:03.100Z",
  "error": {
    "code": "hard_bounce",
    "message": "The address does not exist or was permanently rejected."
  }
}

status here is only delivered or failed. A delivery failure notified as failed reads as undelivered on the resource. provider_message_id is always null.

Payload received: fallback

POST your-url
{
  "event": "fallback",
  "id": "66f1c2a4e8b7d90012ab34cd",
  "kind": "message",
  "channel": "sms",
  "client_reference": "cmd-42",
  "fallback": {
    "will_run": true,
    "state": "triggered",
    "steps": [
      { "channel": "email", "will_run": true, "reason": null, "message_id": "66f1c3b7e8b7d90012ab35e4" }
    ]
  },
  "event_at": "2026-11-04T10:00:08.200Z"
}

Recognise this callback by event, which is fallback. id is the one returned at sending: the primary message, or the code request when kind is otp. fallback has the shape of the resource. state is triggered (the fallback ran, message_id names it) or failed (no step could run, reason says why). No callback when the fallback was not needed. The URL is the request’s (callback_url), otherwise the account’s.

Verify the signature

Every POST callback carries the X-Fastermessage-Signature: sha256=… header: the HMAC-SHA256 of the body, in hexadecimal. The secret is generated in Integration & API and applies to both SMS and email. Compare on the raw body, before any JSON parsing.

Node.js
import { createHmac, timingSafeEqual } from 'node:crypto';

function isGenuine(rawBody, header, secret) {
  const expected = 'sha256=' + createHmac('sha256', secret).update(rawBody).digest('hex');
  const a = Buffer.from(expected);
  const b = Buffer.from(header ?? '');
  return a.length === b.length && timingSafeEqual(a, b);
}

Delivery and retries

  • Answer 2xx in under 10 seconds. Any other response, even a 4xx, or an overrun counts as a failure. Answer on receipt, process afterwards.
  • A failure is replayed after 1 min, 5 min, 30 min then 2 h, making 5 attempts in total. Beyond that, the callback is abandoned. Longer downtime on your server can therefore lose some: plan a periodic catch-up through GET /v2/messages.
  • At most three redirects are followed. A 301 or 302 on a POST becomes a GET with no body: declare the final URL.
  • Order is not guaranteed: a Sended can follow a Delivered. The same event may arrive twice: deduplicate on uuid + status (SMS), id + status (email).

Verification codes (OTP)

Two calls: the platform generates the code and sends it by SMS or WhatsApp, then you submit what the user typed. The code is never returned to your server. The send is an ordinary API message of that channel: same checks, same charge. By WhatsApp, it goes through your approved authentication template, at that category’s rate.

Méthode HTTP POSThttps://api.fastermessage.com/v2/otp

Request body

FieldTypeDescription
torequiredstringRecipient number.
channeloptionalstringsms (default) or whatsapp. Voice answers 501.
fromoptionalstringSMS: Sender ID, optional when the account has only one approved, mandatory otherwise (400 sender_required). WhatsApp: number connected to the account, mandatory.
lengthoptionalinteger4 or 6 digits. Otherwise, the account setting (6).
ttl_secondsoptionalintegerValidity, from 30 to 3600 seconds. Otherwise, the account setting (300).
templateoptionalstringSMS: message text, which must contain {code} (400 invalid_template otherwise); absent, a standard text in French. WhatsApp: name of the approved authentication template, optional when the account has only one; the code goes into it, with the “Copy code” button.
languageoptionalstringWhatsApp: language of the authentication template, when there are several.
client_referenceoptionalstringYour reference.
fallbackoptionalarrayFallback to another channel (SMS, email, WhatsApp): runs at once if the first send fails, otherwise if the code is not validated by the end of the delay set on the account. A custom content must contain {code}. See Fallback.
callback_urloptionalstringhttp(s) URL of the callback announcing the fallback outcome. Takes precedence over the account’s.
test_outcomeoptionalstringTest key only: failed makes the simulated SMS fail, to try the fallback.
Request
curl -X POST https://api.fastermessage.com/v2/otp \
  -u "$FM_API_USER:$FM_API_SECRET" \
  -H "X-Api-Key: $FM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "+2290160000000",
  "channel": "sms",
  "from": "FASTERMSG",
  "length": 6,
  "ttl_seconds": 300,
  "template": "Your code is {code}. It expires in 5 minutes."
}'
Success — 201 Created
{
  "id": "66f1c3b7e8b7d90012ab35de",
  "to": "+2290160000000",
  "channel": "sms",
  "status": "pending",
  "expires_at": "2026-11-04T10:05:00.000Z",
  "attempts_remaining": 3,
  "fallback": null,
  "created_at": "2026-11-04T10:00:00.000Z"
}

Keep id: the fallback callback carries it. fallback is null when no fallback was requested, otherwise it has the shape described in Fallback. pending says the SMS is queued, not that it was delivered. Refusals specific to this route: 403 otp_blocked (number excluded by your anti-fraud rules) and 429 rate_limit_exceeded (per-number cap, 5 requests per hour by default, adjustable in the back office), with no Retry-After.

Méthode HTTP POSThttps://api.fastermessage.com/v2/otp/verify
Request
curl -X POST https://api.fastermessage.com/v2/otp/verify \
  -u "$FM_API_USER:$FM_API_SECRET" \
  -H "X-Api-Key: $FM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "66f1c3b7e8b7d90012ab35de",
  "code": "480912"
}'
Success — 200 OK
{
  "id": "66f1c3b7e8b7d90012ab35de",
  "status": "rejected",
  "attempts_remaining": 2
}

Verification outcomes

statusMeaningWhat to do
approvedCorrect code.Let the user through. The request is closed.
rejectedWrong code, attempts remain.Offer to retype.
expiredRequest expired, already validated, or attempts exhausted.Request a new code through POST /v2/otp.

Contact groups

The address book is the same as in the back office, on the key’s account. These routes charge nothing. A contact belongs to one group only, and the group carries the labels of the 5 personalisation fields.

RouteEffectSuccess
POST /v2/contact-groupsCreate. Body: name (mandatory), fields. Name already taken: 409 contact_group_exists.201
GET /v2/contact-groupsList, with limit and cursor.200
GET /v2/contact-groups/{id}Read.200
PATCH /v2/contact-groups/{id}Partial update. Empty body: 400 empty_update.200
DELETE /v2/contact-groups/{id}Delete an empty group. Otherwise: 409 contact_group_not_empty.204
Create a group
curl -X POST https://api.fastermessage.com/v2/contact-groups \
  -u "$FM_API_USER:$FM_API_SECRET" \
  -H "X-Api-Key: $FM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "VIP customers",
  "fields": [
    "Last name",
    "First name",
    "City",
    "Segment",
    "Birthday"
  ]
}'
Success — 201 Created
{
  "id": "66b0f2a1c4d5e6f708192a3b",
  "name": "Clients VIP",
  "fields": ["Nom", "Prénom", "Ville", "Segment", "Anniversaire"],
  "contacts_count": 0,
  "created_at": "2026-11-04T10:00:00.000Z",
  "updated_at": "2026-11-04T10:00:00.000Z"
}

fields always has 5 entries in the response, an empty label meaning “unused field”. More than 5 entries on input are refused, because the position carries the meaning.

Contacts

RouteEffectSuccess
POST /v2/contactsCreate a contact. No uniqueness enforced: the same number can be created twice.201
POST /v2/contacts/batchCreate up to 500 contacts in one group, with duplicate handling and a report.200
GET /v2/contactsList: group_id, consent, search (number or email), limit, cursor.200
GET /v2/contacts/{id}Read.200
PATCH /v2/contacts/{id}Partial update. email: null erases the address, group_id moves the contact.200
DELETE /v2/contacts/{id}Delete for good. This is not an unsubscription: a deleted contact comes back at the next import. For a lasting refusal, consent: out.204

Contact fields

FieldTypeDescription
group_idrequiredstringGroup of the account. Unknown: 400 invalid_parameter.
phone_numberrequiredstring8 to 15 digits, + optional. Returned normalised. Invalid: 400 invalid_phone_number.
emailoptionalstringAddress. Invalid: 400 invalid_email.
whatsappoptionalbooleanDeclarative: reachable on WhatsApp. false by default.
consentoptionalstringin (default) or out, unsubscribed. Send it if your system handles unsubscriptions, otherwise every sync would resubscribe those who said STOP.
fieldsoptionalarrayUp to 5 values, positional: value i answers label i of the group.
Import a batch
curl -X POST https://api.fastermessage.com/v2/contacts/batch \
  -u "$FM_API_USER:$FM_API_SECRET" \
  -H "X-Api-Key: $FM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "group_id": "66b0f2a1c4d5e6f708192a3b",
  "on_duplicate": "update",
  "contacts": [
    {
      "phone_number": "+2290160000000",
      "email": "[email protected]",
      "fields": [
        "Traoré",
        "Awa"
      ]
    },
    {
      "phone_number": "2290161000001",
      "whatsapp": true
    },
    {
      "phone_number": "inconnu"
    }
  ]
}'
Success — 200 OK (report)
{
  "total": 3,
  "created": 1,
  "updated": 1,
  "skipped": 0,
  "invalid": 1,
  "data": [ ... ],
  "errors": [
    {
      "index": 2,
      "code": "invalid_phone_number",
      "message": "Expected 8 to 15 digits, optionally prefixed with \"+\".",
      "param": "contacts[2].phone_number"
    }
  ]
}

on_duplicate: number already in the group

ValueEffect
skipDefault. The existing one stays as is.
updateThe existing one is updated.
createA second record is created. Without Idempotency-Key, a replay would duplicate the whole batch.

created + updated + skipped + invalid always equals total. A malformed body, an unknown consent or more than 500 lines refuse the whole batch with 400. A contact that is unknown or from another account answers 404 contact_not_found.

Balance

Méthode HTTP GEThttps://api.fastermessage.com/v2/balance

Returns the balance of the charged account, channel by channel, in its brand’s currency. Every channel is returned, including at zero. For a sub-account, this is therefore its affiliator’s balance: the one it consumes.

Request
curl https://api.fastermessage.com/v2/balance \
  -u "$FM_API_USER:$FM_API_SECRET" \
  -H "X-Api-Key: $FM_API_KEY"
Success — 200 OK
{
  "balances": [
    { "channel": "sms", "amount": 289009, "currency": "XOF" },
    { "channel": "whatsapp", "amount": 0, "currency": "XOF" },
    { "channel": "email", "amount": 100, "currency": "XOF" },
    { "channel": "voice", "amount": 0, "currency": "XOF" }
  ]
}

Credit movements

Méthode HTTP GEThttps://api.fastermessage.com/v2/credits

The charged account’s log, newest first. amount is signed: balance_before + amount always equals balance_after.

Query parameters

FieldTypeDescription
fromoptionalstringStart of period, ISO 8601.
tooptionalstringEnd of period. Without a time, the whole UTC day is included. Before from: 400.
typeoptionalstringcredit (balance in), debit (balance out) or refund (return with no purchase).
limit, cursoroptionalinteger, stringSee Pagination.
One line of data
{
  "id": "66f1c2a4e8b7d90012ab34f1",
  "type": "debit",
  "channel": "sms",
  "amount": -12,
  "currency": "XOF",
  "balance_before": 289021,
  "balance_after": 289009,
  "reason": "message_send",
  "message_id": "66f1c2a4e8b7d90012ab34cd",
  "created_at": "2026-11-04T10:00:00.000Z"
}

Reasons

reasonMeaning
rechargeBalance top-up.
message_sendCharge for a send.
system_failure_refundRefund of a failure.
hold_releaseHold returned.
adjustmentCorrection or transfer: the sign of amount gives the direction.

Account resources

Four reads to offer your users what can be sent, instead of having them copy a number or a template name from the back office. They only return what is validated, usable and confirmed in the back office: nothing that is a draft, pending, rejected or disabled. Each applies the rule of the send it prepares: a listed item is not refused later because of its state.

RouteReturnsUsed for
GET /v2/whatsapp/numbersWhatsApp numbers able to send a template now.from of /v2/whatsapp/send.
GET /v2/whatsapp/templatesTemplates approved by Meta, without a media header, with their variables.content.template, language and variables.
GET /v2/email/sendersValidated sender addresses, with their domain.from of /v2/email/send.
GET /v2/email/templatesPublished email templates.content.subject and content.html.
  • These routes charge nothing. They read the resources of the key’s account — the ones used when sending.
  • Cursor pages, like every list: limit and cursor, see Pagination.
  • With a test key, these are the account’s real resources: a simulated send requires the same numbers, templates and addresses as a real one.
  • Declaring, validating and submitting to Meta stay in the back office.

WhatsApp numbers

Méthode HTTP GEThttps://api.fastermessage.com/v2/whatsapp/numbers

A number is listed when it is validated by the platform, ready at Meta and not restricted. A pending, disconnected, not-yet-ready or restricted number is not listed — even if it can still reply in an open conversation. quality is high, medium, low or unknown: a low quality does not prevent sending.

Request
curl https://api.fastermessage.com/v2/whatsapp/numbers \
  -u "$FM_API_USER:$FM_API_SECRET" \
  -H "X-Api-Key: $FM_API_KEY"
Success — 200 OK
{
  "data": [
    {
      "number": "+2290161000000",
      "display_name": "Boutique Awa",
      "label": "Service client",
      "quality": "high",
      "is_default": true
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Fields

FieldTypeDescription
numberoptionalstringE.164 — the value to pass as from.
display_nameoptionalstring | nullName verified by Meta, seen by the recipient. null until Meta returns it.
labeloptionalstringInternal label of the number in the back office.
is_defaultoptionalbooleanDefault number in the back office. Informative: the API never picks one for you.

WhatsApp templates

Méthode HTTP GEThttps://api.fastermessage.com/v2/whatsapp/templates

Templates approved by Meta, without a media header (image, video, document: not open to the API yet). Drafts, templates under review, rejected, paused or disabled are not listed. variables gives the exact content.variables keys the send requires, in the vocabulary of WhatsApp: header, 1, 2…, button_1…

Request
curl https://api.fastermessage.com/v2/whatsapp/templates \
  -u "$FM_API_USER:$FM_API_SECRET" \
  -H "X-Api-Key: $FM_API_KEY"
Success — 200 OK
{
  "data": [
    {
      "id": "66f1c2a4e8b7d90012ab34aa",
      "name": "order_confirmation",
      "language": "en",
      "category": "utility",
      "header_text": "Order {{1}}",
      "body": "Hello {{1}}, your order will be delivered on {{2}}.",
      "footer": null,
      "variables": ["header", "1", "2"],
      "number": "+2290161000000"
    },
    {
      "id": "66f1c2a4e8b7d90012ab34ab",
      "name": "verification_code",
      "language": "en",
      "category": "authentication",
      "header_text": null,
      "body": "*{{1}}* is your verification code.",
      "footer": null,
      "variables": [],
      "number": "+2290161000000"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
  • Category: marketing and utility go through /v2/whatsapp/send. An authentication template only serves POST /v2/otp, which supplies the code: its variables are therefore empty.
  • number: the number the template was submitted under, or null. Meta refuses a template from another WhatsApp Business account than the from: send from this number, or another one of the same WhatsApp Business account.
  • A template is identified by the name + language pair: the same name can appear in several languages.

Sender addresses

Méthode HTTP GEThttps://api.fastermessage.com/v2/email/senders

The account’s active addresses, whose domain is authenticated, and — at the top of the first page — your brand’s default address if your account is allowed to borrow it (brand_default: true). It is never used by default: name it in from.

Request
curl https://api.fastermessage.com/v2/email/senders \
  -u "$FM_API_USER:$FM_API_SECRET" \
  -H "X-Api-Key: $FM_API_KEY"
Success — 200 OK
{
  "data": [
    {
      "address": "[email protected]",
      "name": "Boutique Awa",
      "domain": "exemple.bj",
      "brand_default": false
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Email templates

Méthode HTTP GEThttps://api.fastermessage.com/v2/email/templates

The account’s published templates; drafts are not listed. from_email is null when the account can no longer send under the template’s address (domain no longer authenticated, address removed): then pick an address from GET /v2/email/senders.

Request
curl https://api.fastermessage.com/v2/email/templates \
  -u "$FM_API_USER:$FM_API_SECRET" \
  -H "X-Api-Key: $FM_API_KEY"
Success — 200 OK
{
  "data": [
    {
      "id": "66f1c2a4e8b7d90012ab34bb",
      "name": "Welcome",
      "subject": "Welcome aboard",
      "html": "<h1>Welcome</h1><p>Thank you for signing up.</p>",
      "from_email": "[email protected]",
      "from_name": "Awa Shop",
      "reply_to": "[email protected]"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Senders

Senders are declared and tracked from the back office. The usable ones can be read through the API: email addresses with GET /v2/email/senders, WhatsApp numbers with GET /v2/whatsapp/numbers (see Account resources); SMS Sender IDs are not exposed. What the API imposes, on every send:

SituationSMSEmail
from absentRefused with 400 missing_parameter: no account default.Oldest active address of the account, otherwise 400 sender_required.
from unknown or not approvedRefused with 403 sender_not_approved. Nothing is charged.Refused with 403 sender_not_approved. Nothing is charged.
Borrowing from the brandThe brand’s default Sender ID, when the account is allowed to and the record carrying it is active. The send is real and charged.The brand’s default address, when the account is allowed to, provided it is requested in from.
Test keySame rules.Same rules.

How to declare one is set out in the back-office documentation.

All routes

MethodPathPurpose
GET/v2Contract discovery, without credentials: name, contract_version, build, status, documentation_url.
GET/v2/pingConnectivity test, without credentials: { "data": "PONG", "timestamp": "…" }.
POST/v2/sms/sendSend an SMS.
POST/v2/sms/batchSend SMS in a batch.
POST/v2/email/sendSend an email.
POST/v2/messagesUnified sending.
POST/v2/whatsapp/sendSend a WhatsApp message.
POST/v2/voice/sendDeclared: 501.
GET/v2/messagesList messages.
GET/v2/messages/{id}Read a message.
POST/v2/otpIssue a code.
POST/v2/otp/verifyVerify a code.
*/v2/contact-groupsContact groups.
*/v2/contactsContacts.
GET/v2/balanceBalance.
GET/v2/creditsCredit movements.
GET/v2/whatsapp/numbersUsable WhatsApp numbers.
GET/v2/whatsapp/templatesSendable WhatsApp templates.
GET/v2/email/sendersUsable sender addresses.
GET/v2/email/templatesPublished email templates.
GET/v2/campaignsDeclared: 501.
GET/v2/campaigns/{id}Declared: 501.

A route outside the contract answers 404 resource_not_found, in the same error format.

Error codes

Every error follows the same shape, whatever the route: a single object under error. param only appears when a field is at fault.

Shape of an error
{
  "error": {
    "type": "invalid_request",
    "code": "missing_parameter",
    "message": "A recipient is required.",
    "param": "to",
    "request_id": "2f1c9d4e-8a6b-4c1e-9f2a-7d3b5e0c1a84"
  }
}

Test code, which is stable. Never test message, written in English for developers and liable to be rephrased.

Should you retry?

HTTPWhat to do
400, 404Fix the call. Do not replay it unchanged.
401Check both credentials, the key and the domain called.
402Top up the charged account.
403Refusal on the merits: fix the sender, request the country, or stop contacting this recipient.
409Read code: depending on the case, wait, change the key or contact the provider.
429Wait for Retry-After, then replay.
501Do not replay: feature not served.
500, 503, network timeoutReplay with a growing delay and the same Idempotency-Key.

Families (type)

typeHTTPMeaning
invalid_request400 · 404 · 409The request cannot succeed as it stands.
authentication_error401Credentials refused.
permission_error403This account cannot do that: sender, country, OTP blocked.
business_error402 · 403Business rule: balance, recipient opted out.
rate_limit_error429Cap reached.
api_error500 · 501 · 503A failure on our side, or a feature not served.

All codes

codeHTTPCause
missing_parameter400Mandatory field absent; param names it.
invalid_parameter400Unreadable field: date, URL, number, value outside the list, unknown group.
invalid_channel400Unknown channel.
channel_mismatch400channel contradicts the route.
invalid_content400Empty content, or a shape unsuited to the channel.
invalid_fallback400Malformed fallback.
invalid_number400Unreadable number.
invalid_recipient400Invalid recipient email address.
unsupported_destination400Country not served. Nothing is created or charged.
sender_required400No usable sender (email, OTP).
invalid_schedule400Unusable scheduled date.
invalid_cursor400Tampered cursor.
batch_too_large400More than 500 lines.
empty_update400PATCH with no field to change.
invalid_phone_number400Invalid contact number.
invalid_email400Invalid contact address.
invalid_template400OTP template without {code}.
unauthenticated401See Authentication.
insufficient_balance402Balance too low on the charged account.
sender_not_approved403Sender unknown or not approved.
destination_not_priced403Country served, but closed to this account.
recipient_opted_out403Recipient on the channel’s “Do not contact” list.
otp_blocked403Number excluded by the account’s anti-fraud rules.
resource_not_found404Unknown route.
message_not_found404Message unknown to the account.
contact_not_found404Contact unknown to the account.
contact_group_not_found404Group unknown to the account.
otp_not_found404OTP request unknown to the account.
idempotency_key_reuse409Key already used for another payload.
idempotency_key_in_flight409A request carrying this key is still in flight.
account_not_configured409Account with no price on this channel. Topping up changes nothing.
contact_group_exists409Group name already taken.
contact_group_not_empty409The group still holds contacts.
rate_limit_exceeded429Rate cap, or per-number OTP cap.
internal_error500Unexpected failure. Quote the request_id.
not_implemented501Feature declared, not served.
service_unavailable503Temporary unavailability: nothing was queued.

Message failure reasons

Not to be confused with HTTP errors: an accepted message can fail later. The reason is read in the resource’s error. code is stable, message is in English, and provider_code carries, when there is one, the carrier’s code (001, ESME_RINVDSTADR…), otherwise null.

error.codeMeaning
insufficient_balanceBalance too low at sending time.
recipient_opted_outRecipient added to “Do not contact” in the meantime.
unsupported_destinationDestination not served.
channel_not_pricedNo price for this channel on this account.
destination_not_pricedNo price for this country on this account.
invalid_contentInvalid content.
account_not_configuredAccount not configured for sending.
invalid_numberNumber refused by the network.
sender_not_approvedSender rejected by the carrier.
recipient_unreachableRecipient unreachable.
operator_blockedBlocked by the carrier: filtering, blacklist, do-not-disturb.
operator_errorFailure on the carrier’s network.
provider_rejectedSend rejected.
platform_errorTechnical incident on the platform.
network_errorNetwork temporarily unavailable.
postpone_expiredAbandoned after several attempts.
cancelledCancelled before departure.
no-dlrNo receipt received: message closed.
hard_bounceEmail: address does not exist or was permanently rejected.
soft_bounce, deferredEmail: delivery deferred by the recipient’s server.
blockedEmail: recipient blocked.
invalid_emailEmail: invalid address.
spamEmail: reported as spam.
unsubscribedEmail: recipient unsubscribed.
errorEmail: delivery failed.
send_failedFailure with no more specific reason.

Other codes may be added: plan a default case, and treat an unknown code as a failure.

Limits

Throughput is capped per calling account, over a fixed window: 600 requests per minute by default, can be raised on request. Every authenticated request counts, including those that fail. GET /v2 and GET /v2/ping do not count. The cap applied to you is what X-RateLimit-Limit says.

Response headers

HeaderContent
X-RateLimit-LimitCap for the window.
X-RateLimit-RemainingCalls left before refusal. Present even when the request passes.
X-RateLimit-ResetUnix timestamp (seconds) of the end of the window.
Retry-AfterSeconds to wait, on a rate 429.

Pace yourself on X-RateLimit-Remaining rather than waiting for the refusal. A fixed window resets all at once: spread your retries to avoid a burst when it reopens.

Other caps

TopicValue
SMS batch, contact batch500 lines
Result page200 lines, 50 by default
Idempotency-Key retention24 h
Webhook response10 s
Webhook attempts5, over about 2 h 36
OTP validity30 to 3600 s, 300 by default
Tries on an OTP3 by default
OTP requests per number5 per hour by default
Test send retention30 days

Migrating from v1

TopicAPI v1API v2
CredentialsSeveral forms, including in the requestAuthorization: Basic and X-Api-Key, in headers only
KeyOptional prefixfm_live_… or fm_test_… required, otherwise 401
BodyQuery, form or JSONJSON
Texttextcontent
Accentsaccentscontent.unicode, strict boolean
ReferencemessageIdclient_reference
SchedulingLocal time, historical formatsscheduled_at, ISO 8601
Callback URLdlr_urlcallback_url
Response{status, code, description} wrapperBare resource, semantic HTTP code
SMS callbackv1 formatSame format: no receiver to rewrite
HistoryReadable in v2 by the original uuid or reference