> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abigail.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Poll Draft Status

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

## Status values

| Status        | Meaning                                 | `download_url` present? |
| ------------- | --------------------------------------- | ----------------------- |
| `queued`      | Job is waiting for a worker             | No                      |
| `in_progress` | Job is actively generating the document | No                      |
| `complete`    | Document is ready for download          | Yes                     |
| `failed`      | Job failed (see `error_message`)        | No                      |

## Polling strategy

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

```python theme={null}
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.

<Note>
  Polling this endpoint is free and not billed.
</Note>


## OpenAPI

````yaml api-reference/paid/openapi.json get /v1/openclaw/draft-roa/status/{job_id}
openapi: 3.1.0
info:
  title: Abigail API
  description: >-
    Patent prosecution AI API. Analyze office actions, draft response documents,
    and access examiner intelligence.
  version: 1.0.0
  contact:
    name: Abigail Support
    url: https://abigail.app
    email: support@abigail.app
servers:
  - url: https://api.abigail.app
    description: Production
security: []
paths:
  /v1/openclaw/draft-roa/status/{job_id}:
    get:
      tags:
        - Paid Endpoints
      summary: Poll Draft Status
      description: >-
        Check the status of an ROA drafting job. When complete, includes a
        signed download URL (valid for 1 hour).
      operationId: poll_draft_status
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
          example: roa_abc123def456
        - name: X-API-Key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Job status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DraftJobStatus'
              examples:
                in_progress:
                  summary: Job in progress
                  value:
                    job_id: roa_abc123def456
                    status: in_progress
                    progress: 45
                    current_step: Drafting claim amendments
                complete:
                  summary: Job complete
                  value:
                    job_id: roa_abc123def456
                    status: complete
                    progress: 100
                    download_url: /v1/openclaw/download/roa_abc123def456?token=eyJhbGci...
      security:
        - ApiKeyAuth: []
components:
  schemas:
    DraftJobStatus:
      type: object
      properties:
        job_id:
          type: string
        status:
          type: string
          enum:
            - queued
            - in_progress
            - complete
            - failed
        progress:
          type: integer
          minimum: 0
          maximum: 100
        current_step:
          type: string
          nullable: true
        download_url:
          type: string
          nullable: true
          description: >-
            Signed download URL. Only present when status is complete. Valid for
            1 hour.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key for paid endpoints. Create in your account Settings at
        https://abigail.app

````