Webhook

class labelbox.schema.webhook.Webhook(client, field_values)[source]

Bases: DbObject, Updateable

Represents a server-side rule for sending notifications to a web-server whenever one of several predefined actions happens within a context of a Project or an Organization.

updated_at
Type:

datetime

created_at
Type:

datetime

url
Type:

str

topics

LABEL_CREATED, LABEL_UPDATED, LABEL_DELETED

Type:

str

status

ACTIVE, INACTIVE, REVOKED

Type:

str

class Status(value)[source]

Bases: Enum

An enumeration.

class Topic(value)[source]

Bases: Enum

An enumeration.

static create(client, topics, url, secret, project) Webhook[source]

Creates a Webhook.

Parameters:
  • client (Client) – The Labelbox client used to connect to the server.

  • topics (list of str) – A list of topics this Webhook should get notifications for. Must be one of Webhook.Topic

  • url (str) – The URL to which notifications should be sent by the Labelbox server.

  • secret (str) – A secret key used for signing notifications.

  • project (Project or None) – The project for which notifications should be sent. If None notifications are sent for all events in your organization.

Returns:

A newly created Webhook.

Raises:

ValueError – If the topic is not one of Topic or status is not one of Status

Information on configuring your server can be found here (this is where the url points to and the secret is set).

https://docs.labelbox.com/reference/webhook

delete() None[source]

Deletes the webhook

update(topics=None, url=None, status=None)[source]

Updates the Webhook.

Parameters:
  • topics (Optional[List[Topic]]) – The new topics.

  • Optional[str) (url) – The new URL value.

  • status (Optional[Status]) – The new status. If an argument is set to None then no updates will be made to that field.