> ## 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.

# Draft Response Document

Submits an asynchronous job to generate a Response to Office Action (ROA) document
in DOCX format. The job runs in the background via Celery workers.

## Async workflow

1. **Submit** this endpoint -- returns a `job_id` immediately
2. **Poll** `/draft-roa/status/{job_id}` until `status` is `complete`
3. **Download** the DOCX via the signed URL in the status response

## Strategy selections

Override the AI-recommended strategy for specific claims:

```json theme={null}
{
  "strategy_selections": {
    "claim_1": "amend_narrow",
    "claim_2": "argue_distinction",
    "claim_5": "cancel"
  }
}
```

| Strategy                   | Meaning                                                 |
| -------------------------- | ------------------------------------------------------- |
| `amend_narrow`             | Narrow the claim with additional limitations            |
| `argue_distinction`        | Argue that the claim is already distinct from prior art |
| `cancel`                   | Cancel the claim                                        |
| `argue_unexpected_results` | Argue unexpected results (for 103 rejections)           |

If `strategy_selections` is empty or omitted, the AI recommendations from the
analysis are used.


## OpenAPI

````yaml api-reference/paid/openapi.json post /v1/openclaw/draft-roa
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:
    post:
      tags:
        - Paid Endpoints
      summary: Draft Response Document
      description: >-
        Submit an asynchronous job to draft a Response to Office Action (ROA)
        document in DOCX format.


        Returns a `job_id` immediately. Poll `/draft-roa/status/{job_id}` for
        progress and download URL.


        **Billing:** Token-based usage for AI generation, plus a $49 document
        export fee deducted from credits when downloading the DOCX.
      operationId: draft_roa
      parameters:
        - name: X-API-Key
          in: header
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DraftRoaRequest'
            example:
              application_number: '17200011'
              analysis_id: ana_a1b2c3d4e5f6
              strategy_selections:
                claim_1: amend_narrow
                claim_2: argue_distinction
      responses:
        '200':
          description: Job submitted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DraftJobSubmitted'
              example:
                job_id: roa_abc123def456
                status: queued
                poll_url: /v1/openclaw/draft-roa/status/roa_abc123def456
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    DraftRoaRequest:
      type: object
      required:
        - application_number
        - analysis_id
      properties:
        application_number:
          type: string
        analysis_id:
          type: string
          description: Analysis ID from a prior /analyze call.
        strategy_selections:
          type: object
          additionalProperties:
            type: string
          description: >-
            Per-claim strategy overrides. Keys: claim numbers, values: strategy
            codes (amend_narrow, argue_distinction, cancel).
    DraftJobSubmitted:
      type: object
      properties:
        job_id:
          type: string
        status:
          type: string
          enum:
            - queued
        poll_url:
          type: string
          description: URL to poll for job status.
    ErrorResponse:
      type: object
      description: Structured error with agent_suggestion for LLM consumers.
      properties:
        error:
          type: boolean
          const: true
        error_code:
          type: string
          description: Machine-readable error code.
        message:
          type: string
          description: Human-readable error message.
        agent_suggestion:
          type: string
          description: Actionable suggestion for AI agents consuming this API.
  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

````