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

# Get Document Packet

> Retrieve one document packet: status, files, and its latest run id

*Rate limit tier: **general** (600 req/min) — see [Rate limits](/api-reference-v3/introduction#rate-limits).*

Retrieves one [document packet](/concepts/document-packets) flat: extraction status, timestamps, the files it groups, and `latest_run_id` — the id of the packet's most recent [run](/concepts/runs-and-results), `null` until the packet has been run.

`latest_run_id` is the hop to results: follow it with [`GET /v3/runs/{run_id}/`](/api-reference-v3/runs/get). Run history is not embedded — list a workflow's runs via [`GET /v3/workflows/{workflow_id}/runs/`](/api-reference-v3/runs/list).

Unknown ids — including packets belonging to another organization — return `404`.

<RequestExample>
  ```bash curl theme={null}
  curl -X GET 'https://api.anyformat.ai/v3/document-packets/069dcc2c-e14c-7606-8000-2ee4fb17b4e1/' \
    -H 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```python Python (requests) theme={null}
  import requests

  document_packet_id = "069dcc2c-e14c-7606-8000-2ee4fb17b4e1"
  url = f"https://api.anyformat.ai/v3/document-packets/{document_packet_id}/"
  headers = {"Authorization": "Bearer YOUR_API_KEY"}

  packet = requests.get(url, headers=headers).json()
  print(packet["status"], packet["latest_run_id"])
  ```
</RequestExample>

<ResponseExample>
  ```json Response (200 OK) theme={null}
  {
    "id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e1",
    "workflow_id": "0686bb97-8c30-70f0-8000-97669e000eb8",
    "name": "contract-bundle",
    "status": "processed",
    "created_at": "2026-07-01T12:00:00.000Z",
    "updated_at": "2026-07-01T12:05:00.000Z",
    "files": [
      { "id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e2", "name": "contract.pdf" },
      { "id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e3", "name": "annex-a.pdf" }
    ],
    "latest_run_id": "069dcc2c-e14c-7606-8000-2ee4fb17b4f9"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /v3/document-packets/{document_packet_id}/
openapi: 3.1.0
info:
  title: anyformat API
  description: >
    Document extraction and workflow automation API.


    AnyFormat lets you define extraction workflows that pull structured data
    from any document — PDFs, images, scanned files, or plain text. Upload a
    file, run it through a workflow, and get back structured fields with
    confidence scores and source evidence.


    ## Quick start


    See the [Quick start
    guide](https://docs.anyformat.ai/api-reference/introduction) for a
    walkthrough.


    ## Authentication


    All endpoints (except `/health/`) require a Bearer token in the
    `Authorization` header:


    ```

    Authorization: Bearer <your-api-key>

    ```


    Get your API key from
    [app.anyformat.ai/api-key](https://app.anyformat.ai/api-key).


    ## Versioning


    Endpoints are versioned by path prefix (`/v2/`, `/v3/`). Every response
    under

    a versioned prefix includes `X-API-Version`.
  version: 2.0.0
servers:
  - url: https://api.anyformat.ai
    description: API server
security: []
tags:
  - name: workflows
    description: >-
      Workflows define extraction templates — what fields to extract from
      documents. Create workflows, upload files, run extractions, and fetch
      results.
  - name: files
    description: >-
      File collections group uploaded documents and track their extraction
      progress. Upload files, check status, and retrieve extraction results.
  - name: suggestions
    description: >-
      AI-powered schema and workflow suggestion endpoints for the AnyFormat
      webapp. Authenticated with a Cognito JWT rather than an API key.
  - name: document-packets
    description: >-
      Document packets group uploaded documents for a workflow (v3). Address a
      packet directly to (re-)run its workflow.
  - name: runs
    description: >-
      Extraction runs — the v3 first-class result entity. Each run is a single
      execution of a workflow against a document packet; fetch its status and
      results flat by run id.
  - name: health
    description: Health check endpoints to verify API availability.
paths:
  /v3/document-packets/{document_packet_id}/:
    get:
      tags:
        - document-packets
      summary: Get document packet
      description: |-
        Retrieve one document packet flat: status, timestamps, the files it
        groups, and `latest_run_id` (`null` until the packet has been run).

        Unknown ids — including packets belonging to another organization —
        return 404.
      operationId: v3_get_document_packet
      parameters:
        - name: document_packet_id
          in: path
          required: true
          schema:
            type: string
            title: Document Packet Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentPacketDetailV3'
          headers:
            X-RateLimit-Limit:
              description: Requests allowed per window (60s).
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests remaining in the current window.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: Seconds until the current window resets.
              schema:
                type: integer
        '401':
          description: Authentication failed — missing, invalid, or expired API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                AUTH_FAILED:
                  value:
                    error: Authentication failed.
                    detail: Authentication failed.
                    error_code: AUTH_FAILED
                    retryable: false
                    request_id: req_abc123
        '404':
          description: >-
            Resource not found — the workflow, document packet, or run ID does
            not exist or is not visible to this API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                NOT_FOUND:
                  value:
                    error: Resource not found.
                    detail: Resource not found.
                    error_code: NOT_FOUND
                    retryable: false
                    request_id: req_abc123
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: >-
            Rate limited — retry after the `Retry-After` header. Default
            windows: 60 requests/minute for extraction submission, 600
            requests/minute for general endpoints.
          headers:
            Retry-After:
              description: Seconds until the next request is allowed.
              schema:
                type: integer
            X-RateLimit-Limit:
              description: Requests allowed per window (60s).
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests remaining in the current window.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: Seconds until the current window resets.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                RATE_LIMITED:
                  value:
                    error: Rate limit exceeded — retry after backoff.
                    detail: Rate limit exceeded — retry after backoff.
                    error_code: RATE_LIMITED
                    retryable: true
                    request_id: req_abc123
      security:
        - ApiKeyAuth: []
components:
  schemas:
    DocumentPacketDetailV3:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the document packet (hyphenated UUID).
          examples:
            - 069dcc2c-e14c-7606-8000-2ee4fb17b4e1
        workflow_id:
          type: string
          title: Workflow Id
          description: The workflow this packet belongs to (hyphenated UUID).
          examples:
            - 0686bb97-8c30-70f0-8000-97669e000eb8
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Human-readable name of the packet.
        status:
          $ref: '#/components/schemas/DocumentPacketStatus'
          description: >-
            Processing status. Non-terminal: `not_started`, `queued`,
            `in_progress`. Terminal: `processed` (success), `error`,
            `cancelled`.
          examples:
            - processed
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: Timestamp when the packet was created (ISO 8601).
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
          description: Timestamp when the packet was last updated (ISO 8601).
        files:
          items:
            $ref: '#/components/schemas/DocumentPacketFileV3'
          type: array
          title: Files
          description: Files in this packet.
        latest_run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Latest Run Id
          description: >-
            Id of the packet's most recent run (hyphenated UUID); `null` until
            the packet has been run.
      type: object
      required:
        - id
        - workflow_id
        - status
        - files
      title: DocumentPacketDetailV3
      description: A packet with its per-file breakdown and latest run reference.
    ErrorEnvelope:
      type: object
      title: ErrorEnvelope
      description: >-
        Uniform error response. `retryable=true` means the same request may
        succeed on retry (with backoff); `retryable=false` means the caller must
        change the request before retrying.
      required:
        - error
        - detail
        - error_code
        - retryable
        - request_id
      properties:
        error:
          type: string
          description: Short human-readable summary.
        detail:
          description: >-
            Machine-readable detail. String for most errors; list of field
            errors for validation failures.
          oneOf:
            - type: string
            - type: array
              items:
                type: object
        error_code:
          type: string
          description: Stable identifier for programmatic handling.
          examples:
            - VALIDATION_ERROR
            - AUTH_FAILED
            - NOT_FOUND
            - PRECONDITION_FAILED
            - RATE_LIMITED
            - INTERNAL_ERROR
            - GATEWAY_TIMEOUT
        retryable:
          type: boolean
          description: True when the caller should retry (with backoff for 429/412/5xx).
        request_id:
          type: string
          description: Correlates this response with server logs.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DocumentPacketStatus:
      type: string
      enum:
        - not_started
        - queued
        - in_progress
        - processed
        - error
        - cancelled
      title: DocumentPacketStatus
      description: |-
        Extraction lifecycle of a packet. Non-terminal: ``not_started``
        (no run yet), ``queued``, ``in_progress``. Terminal: ``processed``
        (success), ``error``, ``cancelled``.
    DocumentPacketFileV3:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the file (hyphenated UUID).
          examples:
            - 069dcc2c-e14c-7606-8000-2ee4fb17b4e2
        name:
          type: string
          title: Name
          description: Filename recorded at upload.
          examples:
            - invoice.pdf
      type: object
      required:
        - id
        - name
      title: DocumentPacketFileV3
      description: Slim per-file projection inside a packet.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: http
      description: >-
        API key issued from app.anyformat.ai/api-key. Send as `Authorization:
        Bearer <key>`.
      scheme: bearer

````