Skip to main content

Send Email

POST 

/email/campaign

Send emails to contacts for business campaigns or automated emails.

Metadata

You can optionally attach a metadata object to the send. Metadata is echoed back on every webhook event generated for that send, allowing you to associate webhook events with your own entities such as order IDs, tenant IDs, or internal campaign identifiers.

Example:

{
"subject": "Your order shipped",
"body": "<html>...</html>",
"sender": {
"from": {
"name": "Shop",
"email": "orders@shop.com"
}
},
"recipients": {
"to": [
{
"email": "ann@example.com"
}
]
},
"campaignId": "order_shipped_SO-1001",
"metadata": {
"order_id": "SO-1001",
"tenant_id": "acme"
}
}

The metadata is available in every webhook event generated for the send.

Metadata is scoped to the campaignId. If the same campaignId is used by multiple requests, they share the same metadata and the latest value replaces the previous value. To keep metadata isolated, use a unique campaignId for each batch or omit campaignId and use the generated requestId.

Request

Header Parameters

    X-Link-Wrapping boolean

    When set to true, tracking links in the email hide the destination inside an opaque, tamper-proof token instead of exposing it as a readable redirectUrl query parameter. This keeps destination URLs out of the message body where blocklist scanners can read them. Defaults to the account setting when the header is omitted.

Body

required
    headers object

    Additional headers to be added to the email.

    List-Unsubscribe string

    Unsubscribe header for the email. This will override the default unsubscribe header generated by TinyEmail. It must support POST requests. For more information, visit email sender guidelines

    X-HEADER-1 string
    X-HEADER-2 string
    subject string
    body string
    preview string
    campaignId string
    metadata object

    Optional metadata to associate with the send. The metadata is returned in every webhook event generated for the send.

    Metadata is scoped to the campaignId. If campaignId is not provided, the generated requestId is used instead. All recipients in the request share the same metadata.

    Maximum 10 key/value pairs. Keys can be up to 64 characters and values up to 256 characters. Values must be flat strings, numbers, or booleans; numbers and booleans are converted to strings. Nested objects, arrays, and null values are not supported.

    Keys are normalized to lowercase snake_case. For example, OrderID becomes order_id. Keys that normalize to the same name are rejected.

    property name* string
    sender object
    from object
    name string
    email string
    replyTo object
    name string
    email string
    recipients object
    to object[]
  • Array [
  • name string
    email string
    attributes object
    KEY_NAME_1 string
    KEY_NAME_2 string
  • ]
  • disableTrackingLinks boolean

    when enabled, prevents from automatically tracking links in emails

Responses

Successful operation

Schema
    requestId string
    message string
Loading...