When you submit a video generation task to the Veo3 API, you can set a callback URL using the callBackUrl
parameter. The system will automatically push results to your specified address when the task is completed.
Callback Mechanism Overview
The callback mechanism eliminates the need to poll the API for task status. The system will proactively push task completion results to your server.
Callback Timing
The system will send callback notifications in the following situations:
Video generation task completed successfully
Video generation task failed
Errors occurred during task processing
Callback Method
HTTP Method : POST
Content Type : application/json
Timeout Setting : 15 seconds
Retry Mechanism : 3 retries after failure, with intervals of 1 minute, 5 minutes, and 15 minutes
When a task is completed, the system will send a POST request in the following format to your callBackUrl
:
Success Callback
Failure Callback
{
"code" : 200 ,
"msg" : "Veo3 video generated successfully." ,
"data" : {
"taskId" : "veo_task_abcdef123456" ,
"info" : {
"resultUrls" : "[http://example.com/video1.mp4]" ,
"originUrls" : [ "http://example.com/original1.mp4" ]
}
}
}
Status Code Description
Callback status code indicating the task processing result:
Status Code Description 200 Success - Video generation task completed successfully 400 Error - Prompt violates content policies or other input errors 500 Internal Error - Server internal error or timeout 501 Failed - Video generation task failed
Status message providing more detailed status description
Task ID, consistent with the taskId returned when you submitted the task
Generated video URL, returned when successful
Original video link array, only has value when aspectRatio is not 16:9
Callback Reception Examples
The following are example codes for receiving callbacks in common programming languages:
const express = require ( 'express' );
const app = express ();
app . use ( express . json ());
app . post ( '/veo3-callback' , ( req , res ) => {
const { code , msg , data } = req . body ;
console . log ( 'Received callback:' , {
taskId: data . taskId ,
status: code ,
message: msg
});
if ( code === 200 ) {
// Task completed successfully
const videoUrls = JSON . parse ( data . info . resultUrls );
console . log ( 'Video generation successful:' , videoUrls );
// Process the generated video...
} else {
// Task failed
console . log ( 'Task failed:' , msg );
// Handle failure case...
}
// Return 200 status code to confirm callback received
res . status ( 200 ). json ({ status: 'received' });
});
app . listen ( 3000 , () => {
console . log ( 'Callback server running on port 3000' );
});
Best Practices
Callback URL Configuration Recommendations
Use HTTPS : Ensure callback URLs use HTTPS protocol to guarantee data transmission security
Verify Source : Verify the legitimacy of request sources in callback processing
Idempotent Processing : The same taskId may receive multiple callbacks, ensure processing logic is idempotent
Quick Response : Callback processing should return a 200 status code as quickly as possible to avoid timeouts
Asynchronous Processing : Complex business logic should be processed asynchronously to avoid blocking callback responses
Important Notes
Callback URL must be a publicly accessible address
Server must respond within 15 seconds, otherwise it will be considered a timeout
If 3 consecutive retries fail, the system will stop sending callbacks
Please ensure the stability of callback processing logic to avoid callback failures due to exceptions
Troubleshooting
If you are not receiving callback notifications, please check the following:
Network Connection Issues
Confirm that the callback URL is accessible from the public internet
Check firewall settings to ensure inbound requests are not blocked
Verify that domain name resolution is correct
Ensure the server returns HTTP 200 status code within 15 seconds
Check server logs for error messages
Verify that the interface path and HTTP method are correct
Confirm that the received POST request body is in JSON format
Check if Content-Type is application/json
Verify that JSON parsing is correct
Alternative Solutions
If you cannot use the callback mechanism, you can also use polling:
Polling for Results Use the Get Video Details endpoint to periodically query task status. We recommend querying every 30 seconds.