---
title: "Send message"
method: POST
path: "/messages"
tags: ["SMS Messaging"]
---

# Send message

`POST /messages`

MessageBird's Programmable SMS API enables you to programmatically send SMS messages from your web application.

First, you need to create a new message object. MessageBird returns the created message object with each request. A maximum of 50 recipients can be entered per request.

## Headers

- `Content-Type` string, required
- `Authorization` string, required

## Request body

- object
  - `originator` string, required — The sender of the message. This can be a telephone number (including country code) or an alphanumeric string. In case of an alphanumeric string, the maximum length is 11 characters.
  - `body` string, required — The body of the SMS message.
  - `recipients` string[], required — An array of recipients msisdns.
  - `groupIds` string[] — An array of group id's. If provided recipients can be omitted.
  - `type` 'sms' | 'binary' | 'flash' — The type of message. Values can be: sms, binary, or flash.
  - `reference` string — A client reference. Is required for a status report callback to be sent.
  - `reportUrl` string — The status report URL to be used on a per-message basis. This value overrides the standard status report url configured on the customer account.
  - `validity` integer — The amount of seconds that the message is valid. If a message is not delivered within this time, the message will be discarded.
  - `gateway` integer — The SMS route that is used to send the message.
  - `typeDetails` object — A hashmap with extra information.
  - `datacoding` string — The datacoding used, defaults to plain (GSM 03.38 characters only), or it can be set to unicode (contains non-GSM 03.38 characters) or set to auto and we will set unicode or plain depending on the body content.
  - `mclass` integer — Indicated the message type. 1 is a normal message, 0 is a flash message. (0-3 are valid values).
  - `shortenUrls` boolean — \*beta\* Shorten all the URLs present in the message body.
  - `scheduledDatetime` integer — The scheduled date and time of the message in RFC3339 format (Y-m-d\TH:i:sP), when you want to schedule a message in the future. Don't set this value when message needs to be send directly.

## Response `201`

SMS successfully created

- object

## Other responses

- `401` — Unauthorized
- `422` — Unprocessable Entity

---

[API](https://skmtc.dev/messagebird/apis/messagebird-sms-api.md) · [All operations](https://skmtc.dev/messagebird/apis/messagebird-sms-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/messagebird/messagebird-sms-api/revisions/48bb1cc832d5/schema)
