Skip to main content
GET
/
v1
/
tasks
/
{taskId}
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"
}
Retrieves the current status of a video generation task. Poll this endpoint to check when your video is ready.

Path Parameters

taskId
string
required
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

task_id
string
required
Unique identifier for the task.
status
string
required
Current task status: queued, processing, completed, or failed.
created_at
string
required
Task creation timestamp (ISO 8601 format).

Queued Status

queue_position
integer
Position in the processing queue.
estimated_completion
string
Estimated completion time (ISO 8601 format).

Processing Status

started_at
string
When processing began (ISO 8601 format).

Completed Status

completed_at
string
When processing finished (ISO 8601 format).
result
object
The video generation result.

Failed Status

error
object
Error details when the task failed.
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

CodeStatusDescription
TASK_NOT_FOUND404Task doesn’t exist or belongs to another user
INVALID_API_KEY401Invalid 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:
  1. Re-request the task status (if the video is still available in storage)
  2. Create a new slideshow with the same images