Skip to main content

Webhooks

Integrating webhooks into your workflow allows for real-time notifications on job status, streamlining the process by eliminating the need to frequently check the status manually. This section guides you on setting up webhooks for automatic updates and details the required request formats and expected responses.

When you initiate a job through our API, include webhook details in your request to automatically receive updates on job completion. This setup replaces the need for repeatedly querying the job status endpoint.

  • POST Request: A POST request is sent to the webhook URL with the API key when a job is completed.

  • Recommended Approach: Webhooks are recommended for asynchronous job handling.

Request body Example

The PUT /[presigned url], POST /start_trainer, POST /create_prediction and GET /results endpoints all have the option to include webhook information in the request body. The webhookUrl is the URL you'd like the webhook to send the reponse to, and the webhookApiKey is your key required to secure the webhook notification endpoint.

{
// job-specific body,

"webhook": {
"webhookUrl": "https://yourwebhookurl.com/notification",
"webhookApiKey": "your-webhook-api-key"
}
}

The response is similar to what is received when calling the status endpoint for the same request:

Webhook response
// header:
{
"Content-Type": "application/json",
"x-api-key":"your-webhook-api-key",
"tenantId": "your_tenant_id",
}

// body:
{
"jobId": "5dfcd95abdb84e9d8772cbfr17ag029f",
"status": "success",
"message": "The prediction job finished successfully.",
"datasetsStatus": [
{
"datasetId": "example-dataset",
"status": "success"
}
]
}