POST
/
v2
/
transactional
import Prelude from "@prelude.so/sdk";

const client = new Prelude();

async function main() {
  const response = await client.transactional.send({
    template_id: "template_01jd1xq0cffycayqtdkdbv4d61",
    to: "+30123456789",
    variables: { foo: "bar" },
  });

  console.log(response.id);
}

main();
{
  "id": "<string>",
  "from": "<string>",
  "to": "<string>",
  "template_id": "<string>",
  "variables": {},
  "callback_url": "<string>",
  "correlation_id": "<string>",
  "expires_at": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z"
}
import Prelude from "@prelude.so/sdk";

const client = new Prelude();

async function main() {
  const response = await client.transactional.send({
    template_id: "template_01jd1xq0cffycayqtdkdbv4d61",
    to: "+30123456789",
    variables: { foo: "bar" },
  });

  console.log(response.id);
}

main();

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
to
string
required

The recipient's phone number.

Examples:

"+30123456789"

template_id
string
required

The template identifier.

Examples:

"template_01jd1xq0cffycayqtdkdbv4d61"

from
string

The Sender ID.

locale
string

A BCP-47 formatted locale string with the language the text message will be sent to. If there's no locale set, the language will be determined by the country code of the phone number. If the language specified doesn't exist, the default set on the template will be used.

Examples:

"el-GR"

variables
object

The variables to be replaced in the template.

Examples:
{ "foo": "bar" }
expires_at
string

The message expiration date.

callback_url
string

The callback URL.

correlation_id
string

A user-defined identifier to correlate this transactional message with. It is returned in the response and any webhook events that refer to this transactionalmessage.

Maximum length: 80

Response

OK

id
string
required

The message identifier.

to
string
required

The recipient's phone number.

template_id
string
required

The template identifier.

variables
object
required

The variables to be replaced in the template.

expires_at
string<date-time>
required

The message expiration date.

created_at
string<date-time>
required

The message creation date.

from
string

The Sender ID.

callback_url
string

The callback URL.

correlation_id
string

A user-defined identifier to correlate this transactional message with. It is returned in the response and any webhook events that refer to this transactional message.

Maximum length: 80