Workflows

Generate a step preview

Changed on

Generates a preview for a specific workflow step by its unique identifier stepId

post/v2/workflows/{workflowId}/step/{stepId}/preview

Request

  • Base URL
    https://api.novu.co
  • Auth
    API key in header Authorization

Path parameters

workflowIdstring required
stepIdstring required

Headers

idempotency-keystring

A header for idempotency purposes

Request body

controlValuesobject

Optional control values

Example request

{
  "previewPayload": {
    "subscriber": {
      "channels": [
        {
          "credentials": {
            "webhookUrl": "https://example.com/webhook",
            "channel": "general",
            "deviceTokens": [
              "token1",
              "token2",
              "token3"
            ],
            "alertUid": "12345-abcde",
            "title": "Critical Alert",
            "imageUrl": "https://example.com/image.png",
            "state": "resolved",
            "externalUrl": "https://example.com/details"
          }
        }
      ]
    },
    "actor": {
      "channels": [
        {
          "credentials": {
            "webhookUrl": "https://example.com/webhook",
            "channel": "general",
            "deviceTokens": [
              "token1",
              "token2",
              "token3"
            ],
            "alertUid": "12345-abcde",
            "title": "Critical Alert",
            "imageUrl": "https://example.com/image.png",
            "state": "resolved",
            "externalUrl": "https://example.com/details"
          }
        }
      ]
    }
  }
}

Response

Created

schemaobject nullable

The payload schema that was used to generate the preview payload example

novuSignaturestring

Sample novu-signature header value for HTTP request steps

Example response

{
  "previewPayloadExample": {
    "subscriber": {
      "channels": [
        {
          "credentials": {
            "webhookUrl": "https://example.com/webhook",
            "channel": "general",
            "deviceTokens": [
              "token1",
              "token2",
              "token3"
            ],
            "alertUid": "12345-abcde",
            "title": "Critical Alert",
            "imageUrl": "https://example.com/image.png",
            "state": "resolved",
            "externalUrl": "https://example.com/details"
          }
        }
      ]
    },
    "actor": {
      "channels": [
        {
          "credentials": {
            "webhookUrl": "https://example.com/webhook",
            "channel": "general",
            "deviceTokens": [
              "token1",
              "token2",
              "token3"
            ],
            "alertUid": "12345-abcde",
            "title": "Critical Alert",
            "imageUrl": "https://example.com/image.png",
            "state": "resolved",
            "externalUrl": "https://example.com/details"
          }
        }
      ]
    }
  }
}

Changes

    • warning

      added the new google-chat enum value to the //////////// response property for the response status

    • warning

      added the new google-chat enum value to the //////////// response property for the response status

    • warning

      added the new photon-imessage enum value to the //////////// response property for the response status

    • warning

      added the new photon-imessage enum value to the //////////// response property for the response status

    • info

      added the new google-chat enum value to the request property ////////////

    • info

      added the new google-chat enum value to the request property ////////////

    • info

      added the new photon-imessage enum value to the request property ////////////

    • info

      added the new photon-imessage enum value to the request property ////////////

    • breaking

      removed the enum value novu-agent-chat of the request property ////////////

    • breaking

      removed the enum value novu-agent-chat of the request property ////////////

    • warning

      added the new novu-web-chat enum value to the //////////// response property for the response status

    • warning

      added the new novu-web-chat enum value to the //////////// response property for the response status

    • info

      added the new novu-web-chat enum value to the request property ////////////

    • info

      added the new novu-web-chat enum value to the request property ////////////

    • info

      removed the novu-agent-chat enum value from the //////////// response property for the response status

    • info

      removed the novu-agent-chat enum value from the //////////// response property for the response status