Skip to main content

Create Webhook for Facilities

POST 

/api/v2/public/webhooks/facility

We strongly recommend you set up webhooks for better and easier integration.

Creates a new webhook. Use this endpoint to register a new webhook by specifying the URL and the events you want to subscribe to.

Request

Body

required
    url stringrequired

    The URL that will be called when an event is triggered.

    events string[]required

    Possible values: [shift.request.created, shift.request.cancelled, shift.report.created, shift.scheduled.cancelled, shift.scheduled, shift.created, shift.report.accepted-automatically, shift.report.accepted, shift.report.rejected, shift.cancelled, all]

    The events that this webhook will listen to.

    facilities string[]required

    The IDs of the facilities that will receive events from this webhook. If no value is provided it will auto detect facilities that user has access

    secrets string[]required
      The secrets that will be used to verify the authenticity of the webhook.
    If no value is provided it will auto generate a secret.
    Secrets are used to sign and validate the payload of the webhook.
    It will accept 2 secrets to allow a rotation strategy without service downtime.

Responses

Schema
    data object
    id stringrequired

    If of the Webhook

    url stringrequired

    Url of the Webhook

    events string[]required

    Possible values: [shift.request.created, shift.request.cancelled, shift.report.created, shift.scheduled.cancelled, shift.scheduled, shift.created, shift.report.accepted-automatically, shift.report.accepted, shift.report.rejected, shift.cancelled, all]

    List of events that this webhook will listen to

    clientId stringrequired
    facilities string[]required

    List of facilities ids that this webhook belongs to

    secrets string[]required

    List of webhook secrets

Loading...