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

# List Document Packets

> List a workflow's document packets, newest first

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

Returns one keyset page of a workflow's [document packets](/concepts/document-packets), newest first. Follow `next_cursor` until it is `null` (see [Pagination](/api-reference-v3/introduction#pagination)).

Items are slim summaries — id, name, `status`, timestamps. Fetch [`GET /v3/document-packets/{document_packet_id}/`](/api-reference-v3/document-packets/get) for the per-file breakdown and `latest_run_id`.

Packet `status` reflects the packet's most recent extraction: `not_started` (never run), `queued`, `in_progress`, `processed`, `error`, or `cancelled`.

<RequestExample>
  ```bash curl theme={null}
  curl -X GET 'https://api.anyformat.ai/v3/workflows/0686bb97-8c30-70f0-8000-97669e000eb8/document-packets/?limit=20' \
    -H 'Authorization: Bearer YOUR_API_KEY'
  ```

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

  workflow_id = "0686bb97-8c30-70f0-8000-97669e000eb8"
  url = f"https://api.anyformat.ai/v3/workflows/{workflow_id}/document-packets/"
  headers = {"Authorization": "Bearer YOUR_API_KEY"}

  page = requests.get(url, headers=headers, params={"limit": 20}).json()
  for packet in page["items"]:
      print(packet["id"], packet["status"])
  ```
</RequestExample>

<ResponseExample>
  ```json Response (200 OK) theme={null}
  {
    "items": [
      {
        "id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e1",
        "workflow_id": "0686bb97-8c30-70f0-8000-97669e000eb8",
        "name": "invoice-1043.pdf",
        "status": "processed",
        "created_at": "2026-07-01T12:00:00.000Z",
        "updated_at": "2026-07-01T12:05:00.000Z"
      },
      {
        "id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e4",
        "workflow_id": "0686bb97-8c30-70f0-8000-97669e000eb8",
        "name": "invoice-1044.pdf",
        "status": "not_started",
        "created_at": "2026-07-01T11:00:00.000Z",
        "updated_at": "2026-07-01T11:00:00.000Z"
      }
    ],
    "next_cursor": null
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /v3/workflows/{workflow_id}/document-packets/
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/workflows/{workflow_id}/document-packets/:
    get:
      tags:
        - workflows
      summary: List workflow document packets
      description: |-
        List a workflow's document packets, newest first.

        Keyset-paginated: follow `next_cursor` until it is `null`. The sort
        order is fixed (`-created_at, -id`); there are no totals or page
        numbers. Items are slim — fetch
        `GET /v3/document-packets/{document_packet_id}/` for the per-file
        breakdown and `latest_run_id`.
      operationId: v3_list_workflow_document_packets
      parameters:
        - name: workflow_id
          in: path
          required: true
          schema:
            type: string
            title: Workflow Id
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Page size, capped at 100.
            default: 20
            title: Limit
          description: Page size, capped at 100.
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Opaque token from a previous response's `next_cursor`.
            title: Cursor
          description: Opaque token from a previous response's `next_cursor`.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentPacketListPageV3'
          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:
    DocumentPacketListPageV3:
      properties:
        items:
          items:
            $ref: '#/components/schemas/DocumentPacketSummaryV3'
          type: array
          title: Items
          description: Packets on this page, newest first.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: >-
            Opaque token to fetch the next page; pass it back as `?cursor=`.
            `null` on the last page.
      type: object
      required:
        - items
      title: DocumentPacketListPageV3
      description: |-
        One keyset page of document packets.

        Fixed ``(-created_at, -id)`` order. No totals or page numbers —
        iterate by following ``next_cursor`` until it is null.
    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
    DocumentPacketSummaryV3:
      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).
      type: object
      required:
        - id
        - workflow_id
        - status
      title: DocumentPacketSummaryV3
      description: Slim packet projection returned by list pages.
    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
    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``.
  securitySchemes:
    ApiKeyAuth:
      type: http
      description: >-
        API key issued from app.anyformat.ai/api-key. Send as `Authorization:
        Bearer <key>`.
      scheme: bearer

````