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

# Analyze Office Action

This is the core endpoint. Submit the full text of a USPTO office action and receive
a structured analysis with claim-by-claim breakdown, rejection bases, prior art mapping,
and strategic recommendations.

Every response includes [Glass Box](/concepts/glass-box) transparency metadata.

## Typical workflow

1. Call `/lookup/{app_number}` to get the examiner name
2. Call `/analyze` with the office action text
3. Use the returned `analysis_id` to call `/draft-roa`

## Office action types

| Code   | Meaning                       |
| ------ | ----------------------------- |
| `CTNF` | Non-final rejection (default) |
| `CTFR` | Final rejection               |
| `CTED` | Restriction requirement       |
| `CTRS` | Requirement for information   |

## Examiner intelligence

When `include_examiner_intel` is `true` (default), the analysis includes examiner
behavior patterns that inform the strategy recommendations. Set to `false` to skip
this step and reduce processing time.


## OpenAPI

````yaml api-reference/paid/openapi.json post /v1/openclaw/analyze
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/analyze:
    post:
      tags:
        - Paid Endpoints
      summary: Analyze Office Action
      description: >-
        Run AI-powered analysis of a USPTO office action. Identifies rejection
        bases, analyzes each claim, and provides strategic recommendations.


        Returns Glass Box metadata showing which AI experts were invoked, model
        versions, and confidence scores.


        **Billing:** Token-based. Input and output tokens are metered against
        your credit balance.
      operationId: analyze_office_action
      parameters:
        - name: X-API-Key
          in: header
          required: true
          description: 'Your Abigail API key (format: `abi_sk_...`).'
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnalyzeRequest'
            example:
              application_number: '17200011'
              office_action_text: >-
                Claims 1-5 are rejected under 35 U.S.C. 102(a)(1) as being
                anticipated by Smith (US 2024/0001234)...
              office_action_type: CTNF
              include_examiner_intel: true
      responses:
        '200':
          description: Analysis complete
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalysisResponse'
              example:
                analysis_id: ana_a1b2c3d4e5f6
                application_number: '17200011'
                rejection_type: CTNF
                claim_analyses:
                  - claim_number: 1
                    status: rejected
                    basis: 102(a)(1)
                    prior_art:
                      - US 2024/0001234
                    recommendation: amend_narrow
                glass_box:
                  experts_invoked:
                    - claim_analyst
                    - prior_art_mapper
                    - examiner_profiler
                  citations_verified: true
                  confidence_scores:
                    claim_analyst: 0.92
                  model_versions:
                    claim_analyst: claude-sonnet-4-20250514
                  elapsed_seconds: 12.4
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: true
                error_code: missing_api_key
                message: Missing X-API-Key header.
                agent_suggestion: >-
                  This endpoint requires an Abigail API key. The user must
                  create one at https://abigail.app and provide it to you.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    AnalyzeRequest:
      type: object
      required:
        - application_number
        - office_action_text
      properties:
        application_number:
          type: string
          description: USPTO application number.
        office_action_text:
          type: string
          description: Full text of the office action.
        office_action_type:
          type: string
          default: CTNF
          description: >-
            Office action type code. Common: CTNF (non-final), CTFR (final),
            CTED (restriction).
        include_examiner_intel:
          type: boolean
          default: true
          description: Include examiner intelligence in the analysis.
    AnalysisResponse:
      type: object
      properties:
        analysis_id:
          type: string
          description: Unique analysis identifier. Use this for follow-up draft-roa calls.
        application_number:
          type: string
        rejection_type:
          type: string
        claim_analyses:
          type: array
          items:
            type: object
            properties:
              claim_number:
                type: integer
              status:
                type: string
              basis:
                type: string
              prior_art:
                type: array
                items:
                  type: string
              recommendation:
                type: string
        glass_box:
          $ref: '#/components/schemas/GlassBox'
    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.
    GlassBox:
      type: object
      description: Transparency metadata showing AI decision provenance.
      properties:
        experts_invoked:
          type: array
          items:
            type: string
          description: List of AI expert modules that participated in the analysis.
        citations_verified:
          type: boolean
          description: Whether prior art citations were verified against source documents.
        confidence_scores:
          type: object
          additionalProperties:
            type: number
        model_versions:
          type: object
          additionalProperties:
            type: string
        elapsed_seconds:
          type: number
  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

````