Create a webhook

POST /advertising/v1.0/webhooks/

Endpoint for creating webhooks. Webhook will be invoked as POST http request on provided targetUrl whenever specific event occurs. Specific events and their payloads are described in WEBHOOKS section.

application/json

Body

  • event string Required

    Value is inquiry_created.

  • configuration object Required

    Additional properties are NOT allowed.

    Hide configuration attributes Show configuration attributes object
    • targetUrl string Required

      Url of the webhook.

    • headers object | null

      Optional object with header sent as key-value. These headers will be sent with every request. Could be used for example for authorization.

      Additional properties are NOT allowed.

Responses

  • 200 application/json

    Webhook successfully created

    Hide response attributes Show response attributes object
    • success boolean Required
    • data object Required

      Additional properties are NOT allowed.

      Hide data attributes Show data attributes object
      • id string Required
      • event string Required

        Value is inquiry_created.

      • configuration object Required

        Additional properties are NOT allowed.

        Hide configuration attributes Show configuration attributes object
        • targetUrl string Required

          Url of the webhook.

        • headers object | null

          Optional object with header sent as key-value. These headers will be sent with every request. Could be used for example for authorization.

          Additional properties are NOT allowed.

POST /advertising/v1.0/webhooks/
curl \
 --request POST 'http://apis.public-staging.reas.cz/advertising/v1.0/webhooks/' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"event":"inquiry_created","configuration":{"targetUrl":"https://example.com/hooks","headers":{"Authorization":"Token 95abe511ff"}}}'
Request examples
{
  "event": "inquiry_created",
  "configuration": {
    "targetUrl": "https://example.com/hooks",
    "headers": {
      "Authorization": "Token 95abe511ff"
    }
  }
}
Response examples (200)
{
  "success": true,
  "data": {
    "id": "string",
    "event": "inquiry_created",
    "configuration": {
      "targetUrl": "https://example.com/hooks",
      "headers": {
        "Authorization": "Token 95abe511ff"
      }
    }
  }
}