Webhooks

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.

FieldTypeDescription
project.idIDProject ID
urlStringURL where Labelbox server should send notifications
secretStringUser-generated secret used for verification
topics.setWebhookTopicValues 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.

FieldTypeDefinition
statusWebhookStatusValues are: ACTIVE, INACTIVE, REVOKED
mutation RemoveWebhook {
    updateWebhook (
        data: {
            status: INACTIVE
        }
        where: {
            id:"<WEBHOOK_ID>"
        }
    ){
        id
    }
}