Documentation
Sign inGet started

Create an SMS message

POST
/v1/sms/messages
const msg = await bird.sms.send({
  from: "+15557654321",
  to: "+14155550100",
  text: "Your verification code is 123456.",
  category: "authentication",
});
console.log(msg.id, msg.status);
Response202
{
  "id": "sms_01krdgeqcxet5s7t44vh8rt9mg",
  "direction": "outbound",
  "status": "scheduled",
  "to": "+15551234567",
  "from": "+15557654321",
  "text": "Your order has shipped and is on its way.",
  "category": "transactional",
  "segments": {
    "encoding": "GSM_7BIT"
  },
  "cost": {
    "amount": "0.00990",
    "currency_code": "USD",
    "transaction_amount": "0.00790",
    "passthrough_amount": "0.00200"
  },
  "tags": [
    {
      "name": "category",
      "value": "welcome"
    }
  ],
  "options": {
    "smart_encoding": true
  },
  "carrier": "Verizon",
  "mcc_mnc": "311480",
  "last_error": {
    "code": "invalid_destination",
    "description": "Carrier filtered as spam"
  }
}
Sends one SMS to one recipient with exactly one content form: text, which requires category and from, or a stored template, which selects both for you. To submit up to 100 independent messages in one request, use Send a batch of SMS messages instead.
The 202 Accepted response means the API durably accepted the message for asynchronous delivery. Delivery remains pending; follow it with Get an SMS message or by subscribing to sms.* webhook events.
An invalid field, more than 12 segments, a disabled destination country, or a sender not permitted for the destination returns 422. Insufficient wallet balance returns 402.
Request Payload
to
string
required
Recipient phone number in E.164 format (for example +14155550100). One recipient per message. The number is stored and returned in canonical E.164; a recipient that cannot be routed returns a 422 SMSInvalidRecipient.
from
string
Sender to send from. Use an E.164 number such as +15557654321, or a short code of 5-6 digits. You can also use an alphanumeric sender ID of 1-11 letters, digits, spaces, dashes, or underscores. It must contain at least one letter, for example MyBrand. A numeric sender must be a number your workspace owns; an alphanumeric sender is accepted where the destination country permits one. Required on a free-text send: omitting it returns a 422 SMSNoEligibleSender. Not accepted alongside template, which selects its sender automatically.
text
string
required
Free-text message body. Required unless template is supplied (the two are mutually exclusive). At least 1 character, up to a 12-segment cap (roughly 1836 GSM-7 or 804 UCS-2 characters). Bird does not truncate; a body exceeding 12 segments is rejected with a 422. The cap applies to segments because GSM-7 and UCS-2 encodings differ in characters per segment.
category
string
Content classification. Tells Bird and carriers why you're sending; per-country compliance rules (opt-out policy, quiet hours) key on it as they roll out. Required on a free-text send; omit it on a template send, where the category is derived from the template.
validity_period
integer
Preview feature: how long, in seconds (60-172800), Bird keeps trying to deliver before the message transitions to expired. Currently unavailable; supplying this field returns 422 SMSUnsupportedFeature.
tags
array of object
Structured {name, value} labels for filtering and analytics. Tags become first-class query dimensions: filter the list endpoint by tag name, slice analytics by tag, and surface in webhook payloads. Maximum 20 tags per send. Use tags for low-cardinality dimensions (category, experiment_variant). For arbitrary structured context you do not need as a filter dimension, use metadata instead.
Show child parameters
tags.name
string
required
Tag name. ASCII letters, digits, underscore, and hyphen only. Case-sensitive. Maximum 32 characters.
tags.value
string
required
Tag value. ASCII letters, digits, underscore, and hyphen only. Case-sensitive. Maximum 64 characters.
metadata
object
Arbitrary JSON object stored on the message, returned on API reads, and echoed in webhook payloads. Maximum 2 KB serialized. Use metadata for per-send context like internal IDs and foreign keys. For low-cardinality filterable labels, use tags instead.
options
object
What Bird does to this message on its way out, such as smart_encoding. The message being relayed stays at the top level: its recipient, sender, content, and the delivery instructions the carrier acts on.
Show child parameters
options.smart_encoding
boolean
Replace characters outside the GSM-7 alphabet with their closest GSM-7 equivalent before sending: typically curly quotes, dashes, ellipses, fullwidth forms, and non-breaking spaces.
One such character forces the whole body into UCS2, which more than halves the characters that fit in a segment, so replacing them often lowers the segment count and the cost.
Disabled by default, because it alters the body you composed. The replacement is all-or-nothing: a body that still holds a character outside the alphabet afterwards, such as an emoji or a non-Latin script, is sent exactly as you supplied it. Read the message back to see what was applied: text is the body as sent.
options.track_clicks
boolean
Preview feature: link click tracking. Defaults to false. Currently unavailable; setting this to true returns 422 SMSUnsupportedFeature.
options.max_price_per_segment
number
Preview feature: per-segment price ceiling. Currently unavailable; supplying this field returns 422 SMSUnsupportedFeature.
media_urls
array of string
Preview feature: multimedia (MMS) attachments. Currently unavailable; supplying this field returns 422 SMSUnsupportedFeature.
messaging_profile_id
string
Preview feature: sender selection from a messaging profile pool. Currently unavailable; supplying this field returns 422 SMSUnsupportedFeature.
scheduled_at
string
Preview feature: send-later scheduling. Currently unavailable; supplying this field returns 422 SMSUnsupportedFeature.
template
object
required
Send using a stored template instead of free text. Mutually exclusive with text; the message category is derived from the template, so from, category, and media_urls are not accepted alongside it.
Show child parameters
template.id
string
required
The template to send, by its id.
template.slug
string
required
The template to send, by its slug handle (for example bird_otp_verification). Browse the available templates and their variables with the templates endpoint.
template.name
string
required
Deprecated: use slug instead. Resolved as a slug first, and only if that finds nothing, matched against the template's display name.
template.language
string
Which of the template's languages to send. Omit it to send the template's default language, unless the template sets language_source_required, in which case a send naming no language is rejected. When the template does not carry the language you ask for, its own on_missing_language setting decides whether the closest available language is sent instead or the send is rejected.
template.parameters
object
Values for the template's variables, keyed by variable name. The accepted keys and their formats are fixed per template (the template's variables on the templates endpoint). A missing required variable, an undeclared key, a value that does not match its variable's format, or a serialized payload over 16 KB each return a 422.
broadcast_id
string
Preview feature: broadcast correlation. Currently unavailable; supplying this field returns 422 SMSUnsupportedFeature.
campaign_id
string
Preview feature: campaign correlation for analytics. Currently unavailable; supplying this field returns 422 SMSUnsupportedFeature.
audience_id
string
Preview feature: audience-targeted sends. Currently unavailable; supplying this field returns 422 SMSUnsupportedFeature.
contact_id
string
Preview feature: contact-targeted sends. Currently unavailable; supplying this field returns 422 SMSUnsupportedFeature.
topic_id
string
Preview feature: topic-gated sends. Currently unavailable; supplying this field returns 422 SMSUnsupportedFeature.
personalization
object
Preview feature: per-recipient substitution for batch sends. Currently unavailable; supplying this field returns 422 SMSUnsupportedFeature.
Response Payload
id
string
required
ID of the message, assigned when the send is accepted. Pass it as message_id to the get-message endpoint.
direction
string
required
Whether the message was sent from a Bird sender (outbound) or received from a subscriber (inbound).
Possible values: outbound, inbound
status
string
required
to
string
required
Where the message went. On an outbound message this is the recipient's phone number in E.164 format; on an inbound one it is your own number that received it.
from
string
required
Where the message came from. On an outbound message this is the sender you sent it from: an E.164 number, an alphanumeric sender ID, or a short code. On an inbound message, this is the phone number that sent it to you.
text
string
The message body. Every message carries body text, attachments, or both, so this is absent only on a received message that carried attachments and no text. For a template send, this is the rendered text after parameter substitution. When category is authentication (a message carrying a one-time code), this is **REDACTED**: the code still reaches the recipient, but the API does not retain it for later reads.
category
nullable string
Content classification supplied on the send. Null for inbound messages.
segments
object
required
Segment breakdown for the body.
Show child attributes
segments.count
integer
required
Number of segments the body is split into. Each segment is a billable unit.
segments.encoding
string
required
Encoding used for the body. The GSM_7BIT encoding fits 160 characters in one segment, or 153 per part in a multi-segment message. The UCS2 encoding applies when the body contains a character outside the GSM 03.38 alphabet, including emoji, CJK, and some accented characters. It fits 70 characters in one segment, or 67 per part in a multi-segment message.
Possible values: GSM_7BIT, UCS2
segments.characters
integer
required
Character count of the body under the selected encoding.
cost
nullable object
What the message cost, split into Bird's charge and any third-party fees passed through. Null until the message has been priced.
Show child attributes
cost.amount
string
required
Total charged, as a decimal string: the sum of the components below. Net of tax, which applies to your wallet balance rather than to an individual charge.
cost.currency_code
string
required
ISO 4217 currency code. Every component is denominated in this currency.
cost.transaction_amount
nullable string
required
What we charged to carry the message, as a decimal string. null when this component was not priced; "0.00000" when it priced at zero.
cost.passthrough_amount
nullable string
required
Third-party fees we pass on, as a decimal string, such as US 10DLC carrier surcharges. null when this component was not priced; "0.00000" when it priced at zero.
tags
array of object
Structured {name, value} filter labels applied to this message.
Show child attributes
tags.name
string
required
Tag name. ASCII letters, digits, underscore, and hyphen only. Case-sensitive. Maximum 32 characters.
tags.value
string
required
Tag value. ASCII letters, digits, underscore, and hyphen only. Case-sensitive. Maximum 64 characters.
metadata
object
Arbitrary JSON metadata stored on the message and echoed in webhook payloads.
options
object
Settings Bird applied to this message, with any option you omitted filled in with the default that was in force when you sent it. Absent on inbound messages, and on outbound messages sent before Bird began recording these settings.
Show child attributes
options.smart_encoding
boolean
required
Whether Bird replaced characters outside the GSM-7 alphabet in this message's body with their closest equivalent before sending it. When true, text is the body as sent and segments describes that body.
validity_period
integer
How long, in seconds, Bird keeps trying to deliver before the message transitions to expired.
carrier
string
Carrier that handled the message. Absent until a delivery receipt identifies it, and on a received message the carrier reports it only where a carrier fee applies.
mcc_mnc
string
Mobile country code and mobile network code of the carrier. Absent until the carrier is identified.
last_error
nullable object
Failure detail on a message that failed, was rejected, was not delivered, or expired. Absent otherwise.
Show child attributes
last_error.code
string
required
Standardized failure reason:
  • invalid_destination: The number is unassigned, ported out, or malformed.
  • unreachable: The handset is off or outside coverage.
  • blocked_by_carrier: The carrier filtered the message.
  • blocked_by_recipient: The recipient device blocked the sender.
  • landline_unreachable: The destination is a landline that does not accept SMS.
  • content_rejected: The carrier rejected the content.
  • sender_unregistered: The sender is not registered for the destination.
  • recipient_opted_out: The recipient is on a suppression list.
  • provider_unavailable: The provider remained unavailable after retries.
  • insufficient_balance: The workspace wallet could not fund the send.
  • unknown: The failure could not be classified.
This is an open enum. Accept unrecognized values.
Possible values (may grow over time): invalid_destination, unreachable, blocked_by_carrier, blocked_by_recipient, landline_unreachable, content_rejected, sender_unregistered, recipient_opted_out, provider_unavailable, insufficient_balance, unknown
last_error.description
string
required
Human-readable explanation of the failure.
last_error.carrier_error_code
nullable string
Raw provider-supplied error code, finer-grained than the code that normalizes it. Not a Bird-defined value, so quote it to support when asking why a message failed. Null when the provider sent none, including any failure decided before one was reached.
last_error.occurred_at
string
required
When the failure occurred.
created_at
string
required
When the message was accepted (outbound) or received (inbound).
sent_at
nullable string
When the message was handed to the carrier. Null until then.
delivered_at
nullable string
When delivery was confirmed. Null until then.