Webhooks

Webhooks

Webhooks provide immediate notifications upon the completion of image generation or model training.

Image Generation

To use a webhook, specify the webhookUrl parameter when generating image.

Once the generation job completes (or if it fails), Leap will send a POST request to the webhookUrl with the details of the completed job:

{
  "id": "imageJobId",
  ...
  "state": "finished",
  ...
}

Ensure your webhook URL is open to POST requests and properly handles them.

Model Training

Webhooks also operate with model training. When queuing a training job, include a webhookUrl.

Upon success or failure of the training job, Leap will trigger a POST request to the webhookUrl with the model payload details:

{
  "id": "trainingJobId",
  ...
  "state": "finished",
  ...
}

Webhooks simplify your workflow by eliminating the need for frequent status inquiries. You can continue other tasks while waiting for a webhook notification for completed image generation or model training.