Payload and Parameters

You can include a request body or payload for PUT, POST, and DELETE request webhooks. Depending on the receiving system, the payload might not be used. For example, when using the Data Collector REST API, you simply include all required information in the URL.

When you configure a payload, you can use any valid content type, then specify the content type in the webhook properties. When defining a message, be sure to consider when the pipeline sends the webhook and include the information that the recipient needs.

You can use parameters in the payload to include information about the action that triggered the webhook. For example, when configuring a webhook that sends a text message when a pipeline stops, you might include the pipeline name, pipeline state, and the time parameters in the message.

Enclose parameters in double curly brackets, as follows:
{{<parameter name>>}}
You can use the following parameters in webhooks:
state notification parameters
When configuring a state notification webhook, you can use the following parameters:
  • PIPELINE_TITLE - The pipeline title or name.
  • PIPELINE_URL - The direct URL to the pipeline.
  • PIPELINE_STATE - The current state of the pipeline.
  • TIME - The time of the triggered request.
  • PIPELINE_STATE_MESSAGE - The pipeline state and any related information, such as the last-saved offset or the error message for error states.
  • PIPELINE_INPUT_RECORDS_COUNT - The number of records read.
  • PIPELINE_OUTPUT_RECORDS_COUNT - The number of records written.
  • PIPELINE_ERROR_RECORDS_COUNT - The number of error records.
  • PIPELINE_ERROR_MESSAGES_COUNT - The number of error messages.
  • PIPELINE_RUNTIME_PARAMETERS - The number of pipeline parameters.
  • PIPELINE_METRICS - Metrics data for the pipeline.
For example, say you configure the pipeline to send a webhook only when the pipeline transitions to the Stopped state - that is, when someone stops the pipeline. You might use the following message in a JSON request body:
{  
   "text":"At {{TIME}}, a user stopped the {{PIPELINE_TITLE}} pipeline. \n <To see the pipeline, click here: {{PIPELINE_URL}}"
}
However, if the pipeline is configured to send webhooks when the pipeline changes to several different states, you might use a more generic message and include the pipeline state in the message. For example:
{  
   "text":"The '{{PIPELINE_TITLE}}' pipeline changed state to {{PIPELINE_STATE}} at {{TIME}}. \n Pipeline status message: {{PIPELINE_STATE_MESSAGE}} \n <{{PIPELINE_URL}}|Click here for details.>"
}
alert parameters
When configuring an alert webhook, you can use the following parameters:
  • ALERT_CONDITION - The condition of the rule associated with the alert.
  • ALERT_NAME - The alert label or name.
  • ALERT_TEXT - The text configured for the alert.
  • ALERT_VALUE - The value that triggered the condition. For example, if the alert is configured to trigger upon reaching 1000 error records, the alert value will be 1000.
  • PIPELINE_TITLE - The pipeline title.
  • PIPELINE_URL - The direct URL to the pipeline.
  • TIME - Time of the triggered request.
For example, say you configure a pipeline to send a webhook alert each time an alert triggers. To include some key information in the JSON request body, you might try this:
{  
   "text":"{{ALERT_TEXT}}: At {{TIME}}, {{ALERT_NAME}} was triggered by {{ALERT_VALUE}} for the following condition: {{ALERT_CONDITION}}. \n This is for the {{PIPELINE_TITLE}} pipeline, at {{PIPELINE_URL}}"
}