Use webhooks to set up a workflow to receive automatic notifications when an event happens in Labelbox. For a tutorial on setting up a simple webhooks workflow, see our tutorial on setting up Webhooks.

Create a webhook

Use the createWebhook mutation to create a webhook for a project.

Field

Type

Description

project.id

ID

Project ID

url

String

URL where Labelbox server should send notifications

secret

String

User-generated secret used for verification

topics.set

WebhookTopic

Values are:

LABEL_CREATED, LABEL_UPDATED, LABEL_DELETED, REVIEW_CREATED, REVIEW_UPDATED, REVIEW_DELETED

mutation CreateWebhook {
    createWebhook (data:{
        project: {
            id:"<PROJECT_ID>"
        },
        url:"<HTTP_URL>",
        secret:"example_secret",
        topics: {
            set:[
                LABEL_CREATED,
                LABEL_UPDATED,
                LABEL_DELETED
            ]
        }
    }){
        id
    }
}

Update a webhook

After verifying and when entering production, use the updateWebhook mutation to update a specific webhook.

mutation UpdateWebhook {
    updateWebhook (where: {
        id:"<WEBHOOK_ID>"
    },
    data: {
        url:"<PRODUCTION_URL>"
    }){
        id
    }
}

Remove a webhook

Use the updateWebhook mutation to set the webhook status to INACTIVE.

Field

Type

Definition

status

WebhookStatus

Values are: ACTIVE, INACTIVE, REVOKED

mutation RemoveWebhook {
    updateWebhook (
        data: {
            status: INACTIVE
        }
        where: {
            id:"<WEBHOOK_ID>"
        }
    ){
        id
    }
}