Sign inGet Started

Create an SMS messaging profile

POST
/v1/sms/messaging-profiles
bird sms messaging-profiles create --body-file - <<'JSON'
{
  "name": "device-activation",
  "senders": [
    {
      "country_code": "US",
      "sender_id": "snd_01krdgeqcxet5s7t44vh8rt9mg"
    }
  ],
  "inbound": {
    "numbers": [
      {
        "number": "+14155550100"
      }
    ]
  },
  "default_category": "authentication"
}
JSON
Odpowiedź201
{
  "id": "mpr_01krdgeqcxet5s7t44vh8rt9mg",
  "name": "device-activation",
  "senders": [
    {
      "country_code": "US",
      "sender_id": "snd_01krdgeqcxet5s7t44vh8rt9mg"
    }
  ],
  "inbound": {
    "numbers": [
      {
        "country_code": "US",
        "number": "34001"
      }
    ],
    "callback_url": "https://receipts.example.com/bird/sms/inbound",
    "outbound_matching": {
      "enabled": false,
      "time_window": "1d"
    }
  },
  "default_category": "authentication",
  "validity_period": 3600,
  "cost_center": "CC001234",
  "options": {
    "smart_encoding": false,
    "ignore_suppression": false,
    "callback_url": "https://receipts.example.com/bird/sms/activation"
  },
  "callback_events": [
    "sms.delivered",
    "sms.failed"
  ]
}

Creates a messaging profile for one program in your workspace.

A profile chooses the sender for each destination country, lists the numbers that receive replies, and sets defaults such as the category and smart encoding. Every sender and number must belong to your workspace, and a number can belong to one profile at a time. A send that names the profile in messaging_profile_id takes its sender, default category, and smart encoding from it when the send leaves them out. The values on a profile are defaults: an explicit from, category, or options.smart_encoding on the send wins.

Treść żądania

name
string
wymagane

A label for the profile. Names are not unique, so two profiles can share one.

senders
array of object

The sender for each destination country, and optionally a default sender. Each country appears at most once, and at most one entry omits country_code.

Pokaż parametry podrzędne
inbound
object

How the profile receives replies. Omit it for a profile that only sends.

Pokaż parametry podrzędne
default_category
string

The category a free-text send that names this profile uses when it sets none: transactional, marketing, authentication, or service. A template send takes the template's category.

Possible values: transactional, marketing, authentication, service

validity_period
integer

How many seconds a message stays valid before it expires undelivered. A send that omits validity_period uses it.

cost_center
string

A label for assigning the cost of this profile's messages. A send that omits cost_center uses it.

options
object

Sending options for messages that do not set their own. Booleans default to false.

Pokaż parametry podrzędne
options.smart_encoding
boolean

Whether text is converted to the GSM-7 character set where possible.

options.ignore_suppression
boolean

Whether messages are sent even if the recipient is suppressed for the sender, including after replying STOP. Messages that do not set ignore_suppression use this value. Only authentication and transactional messages can skip suppressions. It cannot be true when default_category is marketing or service. Bird must enable it for your workspace; until then, messages that use it are refused.

options.callback_url
string

The HTTPS URL that receives this profile's message events instead of your webhook endpoints. Messages that do not set callback_url use it, and so do replies on the profile's numbers that have no inbound.callback_url. Each event is a signed POST, signed with your workspace callback signing secret, which rotateWebhookCallbackSigningSecret creates and returns once. While a URL applies, a message's events skip your plain webhook endpoints. MCP Events subscriptions and connector endpoints still receive them. It must be an absolute HTTPS URL of at most 2048 characters with a public host: an HTTP URL, a malformed one, or a private, loopback or link-local host returns 422.

callback_events
array of string

The events of this profile's outbound messages that go to a callback URL. The list is fixed when a message is accepted, and applies only while the message has a callback URL: an event outside it then reaches neither the URL nor a plain webhook endpoint. Without a callback URL the list has no effect, and every event goes to your webhook endpoints. A value other than sms.accepted, sms.sent, sms.delivered, sms.undelivered, sms.failed, sms.rejected or sms.expired returns 422. sms.received is never filtered. Omit it to deliver every event.

Treść odpowiedzi

id
string
wymagane

Identifier of this profile.

name
string
wymagane

A label for the profile. Names are not unique, so two profiles can share one.

senders
array of object
wymagane

The sender for each destination country, and the default sender when an entry has no country_code.

Pokaż atrybuty podrzędne
inbound
object
wymagane

How the profile receives replies. A profile without numbers only sends.

Pokaż atrybuty podrzędne
default_category
nullable string
wymagane

The category a free-text send that names this profile uses when it sets none: transactional, marketing, authentication, or service. A template send takes the template's category. Null when none is set.

validity_period
nullable integer
wymagane

How many seconds a message stays valid before it expires undelivered. Null when none is set. A send that omits validity_period uses it.

cost_center
nullable string
wymagane

A label for assigning the cost of this profile's messages. Null when none is set. A send that omits cost_center uses it.

options
object
wymagane

Sending options that messages from this profile use when a message does not set its own.

Pokaż atrybuty podrzędne
callback_events
nullable array
wymagane

The events of this profile's outbound messages that go to a callback URL: sms.accepted, sms.sent, sms.delivered, sms.undelivered, sms.failed, sms.rejected, and sms.expired. The list is fixed when a message is accepted, and applies only while the message has a callback URL: an event outside it then reaches neither the URL nor a plain webhook endpoint. Without a callback URL the list has no effect, and every event goes to your webhook endpoints. sms.received is never filtered. Null means every outbound event goes to the URL.

created_at
string
wymagane

When the profile was created.

updated_at
string
wymagane

When the profile was last changed.

Przejdź do dokumentacji, przewodników i przykładów dotyczących tego tematu.