Retrieves the current status of a video generation task. Poll this endpoint to check when your video is ready.
Path Parameters
The unique identifier of the task, returned when creating a slideshow.Example: task_abc123xyz
Response
The response varies based on the task status:
Common Fields
Unique identifier for the task.
Current task status: queued, processing, completed, or failed.
Task creation timestamp (ISO 8601 format).
Queued Status
Position in the processing queue.
Estimated completion time (ISO 8601 format).
Processing Status
When processing began (ISO 8601 format).
Completed Status
When processing finished (ISO 8601 format).
The video generation result.
URL to download the generated video.
Video duration in seconds.
Video resolution (e.g., “1080p”).
When the video URL expires (ISO 8601 format). URLs expire after 7 days.
Failed Status
Error details when the task failed.
Machine-readable error code.
Human-readable error description.
curl https://api.vibepeak.ai/v1/tasks/task_abc123xyz \
-H "Authorization: Bearer vpk_live_xxxxx"
{
"task_id": "task_abc123xyz",
"status": "queued",
"queue_position": 2,
"estimated_completion": "2026-01-04T12:30:00Z",
"created_at": "2026-01-04T12:00:00Z"
}
Polling Best Practices
Don’t poll too frequently. We recommend polling every 5-15 seconds.
Here’s a recommended polling implementation:
async function waitForCompletion(taskId, apiKey) {
const maxAttempts = 60;
const pollInterval = 5000; // 5 seconds
for (let attempt = 0; attempt < maxAttempts; attempt++) {
const response = await fetch(
`https://api.vibepeak.ai/v1/tasks/${taskId}`,
{ headers: { 'Authorization': `Bearer ${apiKey}` } }
);
const task = await response.json();
switch (task.status) {
case 'completed':
return task.result;
case 'failed':
throw new Error(`Task failed: ${task.error.message}`);
case 'queued':
case 'processing':
await new Promise(r => setTimeout(r, pollInterval));
break;
}
}
throw new Error('Task timed out');
}
// Usage
const result = await waitForCompletion('task_abc123xyz', apiKey);
console.log(`Video ready: ${result.video_url}`);
Error Codes
| Code | Status | Description |
|---|
TASK_NOT_FOUND | 404 | Task doesn’t exist or belongs to another user |
INVALID_API_KEY | 401 | Invalid or missing API key |
See Error Handling for more details.
Video URL Expiration
Video URLs expire after 7 days. Download or store the video before the expires_at timestamp.
If you need the video after expiration:
- Re-request the task status (if the video is still available in storage)
- Create a new slideshow with the same images