<!-- Generated by scripts/build-docs.js. Edit docs/swagger.yaml or docs/guides/, then run `npm run docs:build`. -->

# List documents

`GET https://marketplace-api.sequifi.com/v1/documents`

Module: Documents · operationId: `listDocuments` · Auth: `Authorization: Bearer <token>`
Web page: https://apidocs.sequifi.com/#/api/list-documents

Lists file details for people in your company: uploaded onboarding documents, signed e-sign documents and profile photos. It returns no file contents and no links; exchange a document `id` for a short-lived link with `GET /v1/documents/{id}/download`. Your company must be set up for the Documents API, or every call returns `403`.

**What happens:**

- Read-only.
- Three sources are combined. `manual`: uploaded documents such as a driver's license, W-9 or voided check (the latest version of each). `esign`: signed e-sign documents such as agreements and offer letters; unsigned and pending ones never appear. `photo`: profile photos; the default avatar is left out.

**Filtering and paging:**

- `user_id` alone matches the user's documents and those on the onboarding record they were hired from. Add `user_id_from=users` for the user's own documents only, or `user_id_from=onboarding_employees` to pass an onboarding id (from `GET /v1/onboarding`) instead of a user id.
- `source` limits the list to `manual`, `esign` or `photo`. `document_type_id` filters uploads by type and implies `source=manual`.
- `updated_since` takes `YYYY-MM-DD` or `YYYY-MM-DD HH:MM:SS` (UTC, a space, no `T` or zone). Inclusive. Use it for incremental sync.
- Sorted by creation time, newest first. `per_page` defaults to 50, maximum 200. `last_page` is `0` when nothing matches.
- Unknown query parameters are rejected with `400`.

**Formats:**

- `id` is a string such as `manual_19014`, `esign_9101`, `photo_u_57` (a user's photo) or `photo_oe_12` (an onboarding record's photo). Pass it to the download route unchanged.
- `user_id` with `user_id_from` says whose document it is: `users` (a user id) or `onboarding_employees` (an onboarding id). Documents from before an API hire keep the onboarding id, so map both ids to the person.
- `document_type` is `{id, name}`. `id` is set for uploads only. `name` is the upload type, the e-sign template name, or `Profile Photo`.
- `file_name` is the file name only. Storage paths are never returned.
- `file_version` is set for uploads only.
- `signed` is `1` for e-sign documents and null otherwise (not a boolean). `signed_date` is when it was signed.
- `created_at`, `updated_at` and `signed_date` are `"YYYY-MM-DD HH:MM:SS"` in UTC, with no `T` and no zone, unlike most other endpoints.
- A photo's `updated_at` changes whenever anything on that person's record changes, so `updated_since` can return photos that did not change.
- `filters` echoes the parameters you sent, as strings.

**Errors:**

- `400 Invalid query parameter(s)`, with `data.invalid_params` and `data.allowed_params`.
- `400 per_page must be an integer between 1 and 200`, `400 page must be a positive integer`
- `400 user_id must be a positive integer`, `400 document_type_id must be a positive integer`
- `400 user_id_from must be one of: users, onboarding_employees`
- `400 source must be one of: manual, esign, photo`
- `400 document_type_id is only valid for source=manual`
- `400 updated_since must be 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS'`
- `403 Documents API is not provisioned for this client`: contact Sequifi support.

**Related:**

- `GET /v1/documents/{id}/download` returns a download link for one document.
- `GET /v1/users` and `GET /v1/onboarding` give the person ids.

## Query parameters

- `user_id` (integer): One person's documents. Alone, it matches the user and the onboarding record they were hired from. See `user_id_from`. Minimum: 1. Example: `57`.
- `user_id_from` (string): What `user_id` refers to: `users` (a user id, that user's own documents only) or `onboarding_employees` (an onboarding id). Leave it out to match both for a user. One of: `users`, `onboarding_employees`.
- `source` (string): One source only: `manual` (uploads), `esign` (signed e-sign documents) or `photo` (profile photos). One of: `manual`, `esign`, `photo`.
- `document_type_id` (integer): Upload type id, as returned in `document_type.id`. Implies `source=manual`. Minimum: 1.
- `updated_since` (string): Documents updated at or after this time, `YYYY-MM-DD` or `YYYY-MM-DD HH:MM:SS` in UTC (a space, no `T` or zone). Example: `2026-07-01`.
- `page` (integer): Page number, starting at 1. Default: `1`. Minimum: 1.
- `per_page` (integer): Records per page. Default 50, maximum 200. Default: `50`. Minimum: 1. Maximum: 200.

## Example request

```bash
curl -X GET "https://marketplace-api.sequifi.com/v1/documents" \
  -H "Authorization: Bearer $SEQUIFI_TOKEN"
```

## Responses

### 200: One page of document details. An empty page is still a `200`.

- `status` (integer): Same as the HTTP status code. Example: `200`.
- `message` (string) Example: `success`.
- `data` (object)
  - `requestedBy` (string): Label of the API credentials that made the call.
  - `current_page` (integer): The page returned.
  - `per_page` (integer): Page size used.
  - `total` (integer): Number of documents that match.
  - `last_page` (integer): Last page number. `0` when nothing matches.
  - `filters` (object, nullable): The parameters you sent, as strings. Null when none.
  - `documents` (array of object): Documents on this page, newest first.
    - `id` (string): Document id, for example `manual_19014`. Pass it to the download route.
    - `source` (string): Where the document comes from. One of: `manual`, `esign`, `photo`.
    - `user_id` (integer): The person's id. A user id or an onboarding id, per `user_id_from`.
    - `user_id_from` (string): What `user_id` refers to. One of: `users`, `onboarding_employees`.
    - `document_type` (object): `{id, name}`. `id` is set for uploads only.
      - `id` (integer, nullable): Upload type id. Null for e-sign and photos.
      - `name` (string, nullable): Upload type, e-sign template name, or `Profile Photo`.
    - `file_name` (string): File name only.
    - `file_version` (integer, nullable): Upload version. Null for e-sign and photos.
    - `signed` (integer, nullable): `1` for signed e-sign documents, otherwise null.
    - `signed_date` (string, nullable): When it was signed, `YYYY-MM-DD HH:MM:SS` UTC.
    - `created_at` (string): `YYYY-MM-DD HH:MM:SS` UTC.
    - `updated_at` (string): `YYYY-MM-DD HH:MM:SS` UTC.

```json
{
  "status": 200,
  "message": "success",
  "data": {
    "requestedBy": "acme",
    "current_page": 1,
    "per_page": 50,
    "total": 3,
    "last_page": 1,
    "filters": {
      "user_id": "57"
    },
    "documents": [
      {
        "id": "manual_19014",
        "source": "manual",
        "user_id": 57,
        "user_id_from": "users",
        "document_type": {
          "id": 7,
          "name": "Front Of Drivers License"
        },
        "file_name": "Front Of Drivers License_1783369551_412.jpeg",
        "file_version": 2,
        "signed": null,
        "signed_date": null,
        "created_at": "2026-06-30 14:11:41",
        "updated_at": "2026-06-30 14:11:41"
      },
      {
        "id": "esign_9101",
        "source": "esign",
        "user_id": 3907,
        "user_id_from": "onboarding_employees",
        "document_type": {
          "id": null,
          "name": "Rep Agreement"
        },
        "file_name": "Sales_Rep_Agreement_1783402612_88.pdf",
        "file_version": null,
        "signed": 1,
        "signed_date": "2026-06-28 09:02:10",
        "created_at": "2026-06-27 16:03:10",
        "updated_at": "2026-06-28 09:02:10"
      },
      {
        "id": "photo_u_57",
        "source": "photo",
        "user_id": 57,
        "user_id_from": "users",
        "document_type": {
          "id": null,
          "name": "Profile Photo"
        },
        "file_name": "1783369551blob",
        "file_version": null,
        "signed": null,
        "signed_date": null,
        "created_at": "2026-05-02 08:00:12",
        "updated_at": "2026-06-30 14:12:02"
      }
    ]
  }
}
```

### 400: An unknown query parameter or an invalid value. The message names the parameter.

Example (invalid_param): Unknown query parameter

```json
{
  "status": 400,
  "message": "Invalid query parameter(s)",
  "data": {
    "invalid_params": [
      "type"
    ],
    "allowed_params": [
      "user_id",
      "user_id_from",
      "source",
      "document_type_id",
      "updated_since",
      "page",
      "per_page"
    ]
  }
}
```

### 401: Missing, unknown, expired or disabled token. Sent by the gateway as `{"message":"Unauthorized"}`, without `status` or `data`.

```json
{
  "message": "Unauthorized"
}
```

### 403: Your company is not set up for the Documents API. Contact Sequifi support.

```json
{
  "status": 403,
  "message": "Documents API is not provisioned for this client",
  "data": {}
}
```

### 500: Unexpected server error. Safe to retry.

```json
{
  "status": 500,
  "message": "Internal Server Error",
  "data": {}
}
```
