Dynamic Workflow Trigger

Changed on

API to dynamically create and trigger a single step workflow.

post/{workspace_key}/trigger/

Request

Path parameters

workspace_keystring required

Request body

namestring 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).

templatestring 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_categorystring required

Used to apply user category level preferences on notification trigger.

delaystring

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_atstring date-time

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

tenant_idstring

string identifier of the tenant this workflow is associated with

$idempotency_keystring

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

Example request

{
  "users": [
    {
      "$slack": [
        {
          "email": "user@example.com",
          "access_token": "xoxb-XXXXXXXX"
        }
      ],
      "$ms_teams": [
        {
          "tenant_id": "c1981ab2-9aaf-xxxx-xxxx",
          "service_url": "https://smba.trafficmanager.net/amer",
          "conversation_id": "19:c1524d7c-a06f-456f-8abe-xxxx"
        }
      ]
    }
  ],
  "data": {
    "$attachments": [
      {
        "url": "https://bitcoincore.org/bitcoin.pdf",
        "filename": "billing.pdf"
      }
    ]
  }
}

Response

202

Changes

    • breaking

      removed the media type application/json for the response with the status

    • breaking

      removed the media type application/json for the response with the status

    • info

      the request property format was generalized from date to date-time

    • info

      added the media type text/plain for the response with the status

    • info

      added the media type text/plain for the response with the status

    • warning

      removed the request property /////

    • warning

      removed the request property /////

    • warning

      removed the request property /////