Send a campaign message
Send one template message through a webhook campaign and charge its quoted price.
usecase, to, and data. Send no params or media. For a campaign with one template, send no usecase. The response includes the usecase that was sent.
The request is rate limited. Honor Retry-After on retryable failures. See Campaigns API for lifecycle and charging.
Hidden data
The optionaldata object holds values for the reply conversation. When the end user replies, the flow reads each value as {{trigger.data.<key>}}. On a campaign that sends usecases, a key the usecase maps into its template appears in the message. The recipient never sees any other key. See Read hidden data from a webhook campaign.
data object counts as no data.
Encrypted recipient numbers
Theto field can hold the number encrypted with the incoming-numbers key of your organization. Add the key in Settings → Integrations → Encryption keys, and test a sample there before you send.
<nonce>is 12 random bytes. Use a new nonce for each message.<ciphertext>is the ciphertext followed by the 16-byte authentication tag.- Both parts use base64url. The scheme uses no additional authenticated data.
00 to +, and it adds + to a value that holds only digits. The result must be a valid international number.
Validation errors
These errors use the codevalidation_failed, with entries in errors. See API errors.
Related pages
Authorizations
An API key (tars_sk_…) sent as Authorization: Bearer <key>. Each operation names the permission it needs. Create keys in Settings → Integrations → API keys.
Path Parameters
The id.
1 - 128Body
One webhook campaign message.
E.164 phone number, or the number encrypted with your organization's incoming-numbers key (Settings → Integrations → Encryption keys), as AES-256-GCM v1.. or AES-256-CBC ciphertext. An encrypted value that can't be decrypted returns validation_failed with recipient_undecryptable.
Template parameters by name.
Media for the template's media header.
Data for the reply conversation, read as {{trigger.data.}}. On a usecase campaign, a key the usecase maps into its template appears in the message; the recipient never sees any other key. Up to 50 top-level keys of letters, digits and underscores that start with a letter or digit, 5 levels of nesting, and 8 KB. Nested keys use printable ASCII and can't start with $.
The usecase to send, for a campaign that defines usecases.
Response
The message was sent.
The message was sent and charged.
What the send cost in US dollars.
The request id (req_…). Quote it when you contact support.
The credit balance in US dollars after the charge.
The provider's message id, when it returned one.
The usecase that was sent, when the request named one.
