Skip to main content

Aleph Video Generation Callbacks

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

1

Submit Generation Request

Include a callBackUrl parameter in your video generation request:
2

Receive Task ID

The API immediately returns a task ID while processing begins:
3

Process Callback

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
integer
Status code indicating the result
  • 200: Video generated successfully
  • 400: Generation failed due to content policy or technical issues
msg
string
Human-readable message describing the result
data
object
Video generation results
taskId
string
The original task ID from your generation request

Error Callback

Implementing Callback Endpoints

Node.js/Express Example

Python/Flask Example

PHP Example

Security Best Practices

Verify Request Origin:
  • Check the User-Agent header for requests from Apikley
  • Consider implementing IP whitelist for additional security
  • Validate the callback payload structure before processing
Implement Idempotency:
  • Track processed task IDs to avoid duplicate processing
  • Use database constraints or caching to prevent race conditions
Robust Error Handling:
  • Always return HTTP 200 for successful callback receipt
  • Log errors for debugging but don’t expose internal details
  • Implement retry logic for critical operations

Testing Callbacks

Local Development

For local testing, use tools like ngrok to expose your local server:

Webhook Testing Tools

Webhook.site

Generate temporary URLs to test callback payloads

RequestBin

Inspect and debug webhook requests

Troubleshooting

Common Issues:
  • Callback URL is not publicly accessible
  • Server is returning non-200 status codes
  • Firewall blocking incoming requests
  • SSL certificate issues with HTTPS URLs
Solutions:
  • Test your callback URL with tools like curl or Postman
  • Ensure your server responds with HTTP 200 status
  • Check server logs for incoming requests
  • Verify SSL certificate is valid
Callback Delivery:
  • Our system retries failed callbacks up to 3 times
  • Callbacks are sent only once per task completion
  • If your server is down, callbacks may be lost
Best Practices:
  • Implement idempotency to handle potential duplicates
  • Use polling as a backup for critical tasks
  • Monitor callback receipt and alert on missing notifications
Data Validation:
  • Always validate the callback payload structure
  • Handle missing or unexpected fields gracefully
  • Log payload contents for debugging

Generate Aleph Video

Learn how to create video generation requests with callbacks

Get Task Details

Alternative polling method for checking task status

Need Help? Contact our support team at support@apikley.ru for assistance with callback implementation.

To find navigation and other pages in this documentation, fetch the llms.txt file at: https://docs.apikley.ru/llms.txt
Rate limits and quotas are enforced by Apikley and may differ from upstream providers.