Webhooks and Notifications
Webhooks are automated requests that send a JSON payload with information about a Project or task to a specified URL at a designated point in your Project’s Workflow. For example, if a webhook is added to the Complete stage of a Project, then a JSON payload containing the Project and task ID is sent every time a task reaches the Complete stage.
Common use-cases for webhooks include:
-
Automatically exporting labels when they are marked as complete.
-
Setting up a daily report to track the number of annotation tasks submitted for review each day.
Setting up Webhooks
Webhooks can be set up when creating or editing a Workflow. This includes setting up a Workflow while creating a new annotation Project, creating a Workflow template, or editing the Workflow of an existing Project.
-
With the Workflow open, click the Workflow stage you want to create a webhook for. A pop-up for to configure the Workflow stage appears.
-
In the pop-up, click the Edit symbol under the Webhook heading.
-
Enter the URL you want the JSON payload to be sent to. Press Enter on your keyboard to confirm.
- Ensure you save your changes.
Webhook event payloads
Task submitted payload
All task submitted events, triggered on the Annotate stage, have the following fields:
Key | Type | Description |
---|---|---|
uid | string | Unique identifier of the event. |
version | integer | Major version number to indicate backwards incompatible versions. |
source | string | The source of the payload. Is always “Encord”. |
event_type | string | The event type. task_sumbitted_event is triggered on the Annotate stage. |
event_created_timestamp | string | A string of the timestamp in the ISO 8601 format. For example 2022-04-13T14:35:11.791161+00:00 . |
payload | object | An object containing the Project and label information. |
project_hash | string | The unique identifier for the Project. |
data_hashes | string | The unique identifiers for the data unit. |
label_hashes | string | The unique identifiers for the Label Row. |
Example payload:
Task completed payload
All task submitted events, triggered on the Complete stage, have the following fields:
Key | Type | Description |
---|---|---|
uid | string | Unique identifier of the event. |
version | integer | Major version number to indicate backwards incompatible versions. |
source | string | The source of the payload. Is always “Encord”. |
event_type | string | The event type. task_sumbitted_event is triggered on the Annotate stage. |
event_created_timestamp | string | A string of the timestamp in the ISO 8601 format. For example 2022-04-13T14:35:11.791161+00:00 . |
payload | object | An object containing the Project and label information. |
label_hash | string | The unique identifier for the Label Row. |
project_hash | string | The unique identifier for the Project. |
data_hash | string | The unique identifier for the data unit. |
Example payload:
Webhooks for Manual QA Projects
Use the Notifications tab in Settings to manage push notifications and webhooks for Manual QA Projects.
Filter and manage notifications using the:
- + Create notification button: Initiates the notification creation flow.
- Search bar: Typing in the search bar will filter the notifications by title.
- List of notifications: Click the gear button to change a notification’s settings and click the red bin button to delete a notification.
You can create a number of event-based or timing-based notifications to help monitor your Project’s activity:
- Email: send an email when certain events happen.
- Slack: send a Slack message when certain events happen.
- Digest: send regular emails giving a summary of activity over a given time period.
- Webhook: send a JSON payload to a REST endpoint when certain events happen.
Creating notifications
To create a new notification, click the + Create notification button in the Notifications view. This initiates the notification creation flow, a simple step-by-step process for creating push notifications.
1. Enter details
In the ‘Enter details’ screen, enter a notification title and optional description. A clear title and description helps keep your notifications organized and helps collaborators find what they are looking for. When you are happy, click Next.
2. Add projects
In the ‘Add projects’ screen, select the projects you would like to include in this notification. When you are happy, click Next.
3. Add channels
In the ‘Add channels’ screen, choose how you would like to receive the notification.
Slack channels
Click the Add Slack channel button to add a Slack channel.
Once redirected to the Slack web page, make sure to first select the correct workspace from the top right drop-down list. Then select the channel you would like to post Slack notifications to.
Add the channel and make sure to refresh the grid by clicking on the refresh icon above the Slack channels grid.
For a given user the available Slack channels are shared between all notifications.
Email addresses
Enter the email addresses of everyone who should receive the notifications in the entry box. A list of emails will appear above the box for each entered email.
New emails are not sent immediately, instead the email notifications are aggregated and sent in 5 minute intervals.
Consequently, you may not receive emails immediately on the triggering of an event.
Webhooks
Add a webhook by clicking the Add webhook button. Fill in all the relevant information.
You can create, change, and delete webhooks. You cannot attach or detach webhooks. To “detach” a webhook you need to delete it. Webhooks CANNOT be shared between notifications.
Click here for a list of all possible events.
4. Add triggers
In the ‘Add triggers’ screen, choose what type of events trigger a notification. A notification can have multiple triggers. You can choose from ‘Reactive events’ and ‘Digest events’:
- Reactive events: notification trigger in reaction to an event
- Digest events: notification trigger at a scheduled times of day
Use the info icon next to the event type to get more detailed explanations on when these events are triggered.
5. Create the notification
Click Create to create the push notification.
Was this page helpful?