Skip to content
Genflo

Retrieve task status

Poll a Genflo generation task by its ID for its status (pending, running, success, failed or rejected), credit usage and generated output.

Updated View as Markdown

Creation returns HTTP 202. Poll with the returned integer task ID until the task succeeds, fails, or is rejected.

Request

Send a GET request with the task ID in the task_id query parameter and your API key in the x-apikey header.

curl 'https://api.genflo.io/api/saas?task_id=12345' \
  -H 'x-apikey: sk-your-api-key'
import os

import requests

response = requests.get(
    "https://api.genflo.io/api/saas",
    headers={"x-apikey": os.environ["GENFLO_API_KEY"]},
    params={"task_id": 12345},
    timeout=30,
)
response.raise_for_status()
task = response.json()
print(task["status"])
const response = await fetch("https://api.genflo.io/api/saas?task_id=12345", {
  headers: { "x-apikey": process.env.GENFLO_API_KEY },
});
if (!response.ok) {
  throw new Error(`HTTP ${response.status}: ${await response.text()}`);
}
const task = await response.json();
console.log(task.status);

A task ID that does not exist or belongs to another account returns HTTP 404 with the task_not_found error code. A missing or non-integer task_id returns HTTP 422 with a detail list.

Response

Every status returns the same shape:

{
  "object": "generation.task",
  "id": 12345,
  "model": "seedance-2.0-fast",
  "type": "video",
  "status": "pending",
  "usage": { "credits": "336.00" },
  "output": null,
  "error": null,
  "created_at": "2026-08-10T12:00:00Z",
  "completed_at": null
}
Field Description
object Always generation.task.
id The integer task ID.
model The model ID from the creation request.
type image or video.
status The task’s current status. See Task statuses.
usage.credits The credits charged for the task, as a decimal string.
output null until the task succeeds, then an object with the output type and its url.
error null unless the task failed or was rejected, then an object with a code and a message.
created_at When the task was created, as an ISO 8601 UTC timestamp.
completed_at When the task finished, as an ISO 8601 UTC timestamp; null until then.

A successful task carries its result in output:

"output": { "type": "video", "url": "https://cdn.example.com/output.mp4" }

Task statuses

Status Meaning
pending The task was created and is waiting to run.
running The model is generating the output.
success The output is ready at output.url.
failed Generation failed. error is {"code": "generation_failed", "message": "Generation failed"}.
rejected The task was stopped without a result, for example by a content safety check. error is the same as for failed.

Current statuses include pending, running, success, failed, and rejected. Stop polling once the status is success, failed or rejected.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close