Introduction

Brick API supports webhooks to notify your application when analysis are finished. This section describes how to register webhooks, the types of events that can trigger a webhook, and how to handle webhook notifications.

The manipulation of your webhooks can be made via both Brick API and Brick APP.

The Request

When an Event happen and there is an webhook that handle this event a request is made for the webhook url.

Payload:

{
  "data": Record,
  "triggered_at": DateTime,
 	"event_kind": WebhookEventKind,
}

Obs.: The Record of analysis finished events only have the analysis that was finished in the analysis field, while the events of record finished or status changed have all the analysis of the Record

The Manipulation of Webhooks

Objects

There are three main objects that make the webhook scope:

  • Webhook Object: The main object that specifies where the request will be made when some events occur. This object contains the a list of Event Object.
  • Event Object: The object that specifies the event that will trigger a Webhook
  • Trigger Object: The object that stores information about each time that a Webhook is triggered

Endponits

  • Create Webhook: POST /v1/webhook
  • Update Webhook: PATCH /v1/webhook
  • Delete Webhook: POST /v1/webhook
  • Find Webhook: GET /v1/webhook
  • List Webhooks: GET /v1/webhook/list
  • Create Event: POST /v1/webhook/event
  • Delete Event: POST /v1/webhook/event
  • List Triggers: GET /v1/webhook/trigger/list