HTTP Status

By default, a configured webhook endpoint is expected to respond with an HTTP status code that is within the 2XX range of HTTP responses.

A non-200 status might be returned by an API endpoint when a particular state is not yet met. For example, when an OTP was not yet validated.

To support this use case, set the expectedStatus array of the webhook to the values that are expected from the API endpoint. In addition to these settings, it might be necessary to consume the HTTP status and modify the incoming HTTP body by using a transform. Use the HTTP status as a key into a map:

{
    "body": body.putAll(
        {
        400 : {"status": "pending"}
        200 : {"status": "ok"}
        }[status_code])
}