Handle webhook notifications for Runway Alpeh video generation completion
Overview#
Callbacks provide an efficient way to receive notifications when your Runway Alpeh video generation tasks complete. Instead of repeatedly polling the API, your application can receive instant notifications via webhooks when videos are ready.Callbacks are the recommended approach for production applications as they reduce API calls, improve response times, and provide immediate notification of task completion.
How Callbacks Work#
Workflow Steps#
1.
Submit Generation RequestInclude a callBackUrl parameter in your video generation request:{
"prompt": "Transform into a dreamy watercolor painting style with soft flowing movements",
"videoUrl": "https://example.com/input-video.mp4",
"callBackUrl": "https://your-app.com/webhook/aleph-callback"
}
2.
The API immediately returns a task ID while processing begins:{
"code": 200,
"msg": "success",
"data": {
"taskId": "ee603959-debb-48d1-98c4-a6d1c717eba6"
}
}
3.
When generation completes, our system sends a POST request to your callback URL with the results.
Callback Payload#
When video generation completes, you'll receive a POST request with the following payload:Success Callback#
{
"code": 200,
"msg": "success",
"data": {
"result_video_url": "https://file.com/k/xxxxxxx.mp4",
"result_image_url": "https://file.com/m/xxxxxxxx.png"
},
"taskId": "ee603959-debb-48d1-98c4-a6d1c717eba6"
}
Parameter Description#
| Parameter | Type | Required | Description |
|---|
code | integer | Yes | Status code indicating the result |
msg | string | Yes | Human-readable message describing the result |
data.result_video_url | string | Yes | URL to access and download the generated video (valid for 14 days) |
data.result_image_url | string | Yes | URL of a thumbnail image from the generated video |
taskId | string | Yes | The original task ID from your generation request |
Status Code Details#
| Status Code | Description |
|---|
| 200 | Video generated successfully |
| 400 | Generation failed due to content policy or technical issues |
Error Callback#
{
"code": 400,
"msg": "Your prompt was caught by our AI moderator. Please adjust it and try again!",
"data": null,
"taskId": "ee603959-debb-48d1-98c4-a6d1c717eba6"
}
Implementing Callback Endpoints#
Here are example implementations in popular programming languages:Security Best Practices#
Testing Callbacks#
Local Development#
For local testing, use tools like ngrok to expose your local server:Webhook.site
Generate temporary URLs to test callback payloadsRequestBin
Inspect and debug webhook requestsTroubleshooting#
Generate Aleph Video
Learn how to create video generation requests with callbacks
Get Task Details
Alternative polling method for checking task status
Contact our support team at support@kie.ai for assistance with callback implementation.