POST
/
{workspace_key}
/
trigger
curl --request POST \
  --url https://hub.suprsend.com/{workspace_key}/trigger/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "_workflow_name_",
  "template": "_template_slug_",
  "notification_category": "transactional",
  "users": [
    {
      "distinct_id": "_distinct_id_",
      "$channels": [],
      "$email": [],
      "$sms": [],
      "$whatsapp": [],
      "$androidpush": [
        {
          "token": "__android_push_token__",
          "provider": "fcm",
          "device_id": "<string>"
        }
      ],
      "$iospush": [
        {
          "token": "__ios_push_token__",
          "provider": "apns",
          "device_id": "<string>"
        }
      ],
      "$slack": "<string>"
    }
  ],
  "data": {
    "$attachments": [
      {
        "url": "https://bitcoincore.org/bitcoin.pdf",
        "filename": "billing.pdf",
        "ignore_if_error": true
      }
    ]
  },
  "delivery": {
    "smart": false,
    "success": "seen",
    "time_to_live": "<string>",
    "mandatory_channels": [
      "<string>"
    ]
  },
  "delay": "<string>",
  "trigger_at": "2023-12-25",
  "tenant_id": "<string>",
  "$idempotency_key": "<string>"
}'
"Accepted - OK"

Authorizations

Authorization
string
header
required

Pass as Bearer <API_KEY>. Get API Key from SuprSend dashboard Developers -> API Keys section.

Path Parameters

workspace_key
string
required

Body

application/json
name
string
default:_workflow_name_
required

Unique name of the workflow. The workflow name should be easily identifiable for your reference at a later stage. You can see workflow-related analytics on the workflow page (how many notifications were sent, delivered, clicked or interacted).

template
string
default:_template_slug_
required

Unique slug of the template created on SuprSend dashboard. You can get this by clicking on the clipboard icon next to the Template name on SuprSend templates page.

notification_category
string
default:transactional
required

Used to apply user category level preferences on notification trigger.

users
object[]
required

Array object of target users.

data
object

variable data required to render dynamic template content or workflow properties like dynamic delay or channel override in send node.

delivery
object

delivery instructions for the workflow. You can set Smart Delivery preference by setting "smart":true

delay
string

Workflow will be halted for the time mentioned in delay, and become active once the delay period is over. Format - XXdXXhXXmXXs or if its number (n) then delay is in seconds (n)

trigger_at
string

Trigger workflow on a specific date-time. Format - date string in ISO 8601 eg. "2022-08-27T20:14:51.643Z"

tenant_id
string

string identifier of the tenant this workflow is associated with

$idempotency_key
string

Unique identifier of the request (deduplicates request for 24hrs)

Response

202
application/json
202

The response is of type string.

Example:

"Accepted - OK"