Skip to main content
Poll this endpoint to check the progress of an ROA drafting job.

Status values

StatusMeaningdownload_url present?
queuedJob is waiting for a workerNo
in_progressJob is actively generating the documentNo
completeDocument is ready for downloadYes
failedJob failed (see error_message)No

Polling strategy

Poll every 5 seconds. Typical drafting jobs complete in 30-120 seconds.
import time
import httpx

def wait_for_draft(base_url, job_id, api_key, timeout=300):
    headers = {"X-API-Key": api_key}
    start = time.time()
    while time.time() - start < timeout:
        resp = httpx.get(
            f"{base_url}/v1/openclaw/draft-roa/status/{job_id}",
            headers=headers,
        )
        data = resp.json()
        if data["status"] == "complete":
            return data["download_url"]
        if data["status"] == "failed":
            raise Exception(f"Draft failed: {data.get('error_message')}")
        time.sleep(5)
    raise TimeoutError("Draft did not complete within timeout")

Download URL

The download_url is a signed URL that includes a JWT token. It expires after 1 hour. If it expires, re-poll this endpoint to get a fresh URL.
Polling this endpoint is free and not billed.