---
title: "List documents"
method: GET
path: "/api/v1/documents"
tags: ["Documents"]
---

# List documents

`GET /api/v1/documents`

## Request

- Base URL: `https://app.sellerassistant.app` (the document declares no server; this is the origin it was published from)
- URL: `https://app.sellerassistant.app/api/v1/documents`
- Auth: one of:
  - API key in query parameter `api_key`
  - API key in header `X-Api-Key`

Lists the documents of the team. Give `target_type` and `target_id` to get the documents of one purchase order or one supplier.

## Query parameters

- `target_type` 'purchase_order' | 'supplier'
- `target_id` integer
- `filter[type][eq]` 'invoice' | 'confirmation' | 'credit_memo' | 'packing_slip' | 'contract' | 'authorization_letter' | 'credit_agreement' | 'other'
- `filter[status][eq]` 'uploaded' | 'classifying' | 'processing' | 'parsed' | 'empty' | 'failed'
- `search` string
- `sort` string
- `page` integer
- `per_page` integer

## Response `200`

One page of the documents

- object
  - `data` Document[]
    - `id` integer: The id of the document.
    - `type` 'invoice' | 'confirmation' | 'credit_memo' | 'packing_slip' | 'contract' | 'authorization_letter' | 'credit_agreement' | 'other'
    - `status` 'uploaded' | 'classifying' | 'processing' | 'parsed' | 'empty' | 'failed'
    - `original_name` string
    - `mime_type` string, nullable
    - `file_size` integer, nullable: In bytes.
    - `reference_number` string, nullable
    - `notes` string, nullable
    - `targets` object[]: What the document hangs on.
      - `type` 'purchase_order' | 'supplier'
      - `id` integer: The id of the purchase order.
    - `ai_classified_type` string, nullable: What the classifier read. It differs from `type` when a person corrected it.
    - `ai_confidence` number, nullable
    - `has_parsed_data` boolean
    - `applied_at` string, date-time, nullable
    - `dismissed_at` string, date-time, nullable
    - `created_at` string, date-time, nullable
    - `updated_at` string, date-time, nullable
  - `meta` object
    - `pagination` ApiV1Pagination: The page the answer carries. Every list of the v1 answers it under `meta`.
      - `page` integer: The schemas every endpoint of the public API v1 shares. The envelope is the same on every endpoint, so it lives here once. An endpoint points at it with a `$ref`, and the generated collection stays small and consistent. The parameters live in ApiV1Parameters, not here. swagger-php drops the class level `OA\Schema` attributes of a class that also carries a class level `OA\Parameter`, so the two kinds need two classes. This class holds no code. swagger-php reads the attributes, and nothing calls it.
      - `per_page` integer
      - `total` integer
      - `last_page` integer
    - `trial_limit` ApiV1TrialLimit: Present only on trial, when the trial hides rows of the list. The trial shows the first rows of a list, and the pagination counts only these rows.
      - `max_rows` integer: The number of rows that the trial shows.
      - `total` integer, nullable: The true number of rows in the list. It is null for a list that does not count its rows.
      - `code` string
      - `message` string
      - `subscribe_url` string, uri

## Other responses

- `400`: Bad request - validation failed or invalid parameters
- `403`: Access denied - insufficient permissions, invalid API key, or the API request limit is used up (`public_api_key_limit`)
- `429`: Too many requests - rate limit exceeded

---

[API](https://skmtc.dev/sellerassistant/apis/seller-assistant-public-api.md) · [All operations](https://skmtc.dev/sellerassistant/apis/seller-assistant-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sellerassistant/apis/seller-assistant-public-api/revisions/5b3ecdbcadb6?raw)
