Skip to content
GetSMS
Sign inCreate an account

Messages

Send an SMS

One call, one message. GetSMS picks a Moroccan number from the fleet, sends the SMS and reports its statuses back to you by webhook.

POST/v1/messages/sendx-api-key · charged per segment
tostringrequired
Recipient number in international format, for example +212612345678.
contentstringrequired
Message text, up to 2,048 characters. One SMS holds 160 characters (70 with special accents or Arabic); longer text is split and each part is charged.
fromstring
Sending number, from your numbers. Without it, GetSMS picks a number from the fleet, always the same one for a given recipient.
request_idstring
Your own identifier (up to 255 characters), returned in the message and its events. Useful to link an SMS to an order or a case. It also prevents double sends: the same request_id to the same recipient within 24 h returns the first message, neither sent nor charged again (409 if the text differs).
send_atISO 8601 date
Scheduled send, up to 20 days in the future.
sender_idstringsoon
Approved sender name, up to 11 characters. See Sender name.
Fenêtre de terminal
curl -X POST https://api.getsms.tech/v1/messages/send \
-H "x-api-key: $GETSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to": "+212612345678", "content": "Your code is 482913"}'
iduuid
Message ID. Keep it to retrieve the message.
statusstring
pending on creation: the message is queued. See statuses.
ownerstring
The fleet number that sends it.
contactstring
The recipient.
request_idstring
Your identifier, if you provided one.
{
"status": "success",
"message": "message added to queue",
"data": {
"id": "32343a19-da5e-4b1b-a767-3298a73703cb",
"request_id": "commande-8841",
"owner": "+212661234501",
"contact": "+212612345678",
"status": "pending",
"send_attempt_count": 0,
"max_send_attempts": 2,
"request_received_at": "2026-11-10T09:12:03Z"
}
}

The full response also includes the other timestamps (scheduled_at, sent_at, delivered_at, failed_at, expired_at). Amounts in the 402 response are in thousandths of a dirham, see Credits and billing.