# Retrieve a file

> Retrieve a file: GET /v1/files/{id} reads the status of an uploaded file and, when it is still pending, checks the stored bytes against the declared hash.

Source: https://esigncomply.com/docs/api/supplements/retrieve-a-file

Last updated November 26, 2026

In the Esign Comply API, `GET /v1/files/{id}` reads the status of an uploaded file and, when it is still pending, checks the stored bytes against the declared hash. Call it after the upload to see whether the bytes matched the declared hash and the file is `stored`.

`GET /v1/files/{id}` · API version `2026-11-21`

## Authentication

Send a secret key in the `Authorization` header: `Bearer $ESIGNCOMPLY_API_KEY`. The key needs any permission. Test keys and live keys both work, and each reads and writes the objects of its own environment. Call it from your server: a secret key never goes to a browser. Keys and permissions are described under [Authentication](https://esigncomply.com/docs/api.md#authentication).

## Request example

### cURL

```bash
curl https://esigncomply.com/v1/files/fil_dZ8g \
  -H "Authorization: Bearer $ESIGNCOMPLY_API_KEY"
```

### Node SDK

```ts
import { EsignComply } from "esigncomply";

const esc = new EsignComply(process.env.ESIGNCOMPLY_API_KEY);

const { data, error } = await esc.files.get("fil_dZ8g");
```

This request ran against the API on November 26, 2026, and the response below is what came back. IDs are example values, and long values are shortened with `...`.

## What it does

Returns the file object without the upload URL. If the file is still `pending` and the bytes have arrived, this call runs the check now: the stored bytes are hashed again and compared with the declared hash and size.

| `status` | Meaning |
|---|---|
| `pending` | Declared. The bytes have not arrived or have not been checked yet. |
| `stored` | The bytes match the declared hash and size and were copied to write-once storage. |
| `rejected` | The check failed. `reject_reason` says why: `file_hash_mismatch`, or `file_type_refused` with the detected kind (an executable, a script with an interpreter line, or an archive that contains an executable). |
| `quarantined` | Reserved for a file held back by a content scan. |
| `deleted` | Removed: never referenced within 7 days, or its supplement was withdrawn. |

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | Yes | ID of the file. |

Headers: `Esign-Comply-Version` (optional, a dated API version). See [API conventions](https://esigncomply.com/docs/api.md).

## Response

`200 OK` with a File object.

```json
{
  "object": "file",
  "id": "fil_dZ8g",
  "livemode": false,
  "name": "renewal-notice.eml",
  "content_type": "message/rfc822",
  "size": 237,
  "sha256": "sha256:f96e3ce7...",
  "status": "stored",
  "supplement": null,
  "created_at": "2026-11-26T00:16:53.772Z"
}
```

### Response fields

| Field | Type | Description |
|---|---|---|
| `object` | string |  |
| `id` | string |  |
| `livemode` | boolean |  |
| `name` | string |  |
| `content_type` | string |  |
| `size` | integer |  |
| `sha256` | string |  |
| `status` | string |  |
| `reject_reason` | string |  |
| `supplement` | string |  |
| `created_at` | datetime |  |
| `upload_url` | string |  |
| `upload_method` | string |  |
| `upload_expires_in` | integer |  |
| `resumable_url` | string |  |

## Errors

| Code | HTTP | When |
|---|---|---|
| [`not_found`](https://esigncomply.com/docs/api/errors.md#not_found) | 404 | No object with that ID exists in this domain and environment. |

Like every call made with a secret key, it can also return [`missing_api_key`](https://esigncomply.com/docs/api/errors.md#missing_api_key), [`invalid_api_key`](https://esigncomply.com/docs/api/errors.md#invalid_api_key), [`domain_not_verified`](https://esigncomply.com/docs/api/errors.md#domain_not_verified), [`insufficient_permission`](https://esigncomply.com/docs/api/errors.md#insufficient_permission), [`region_mismatch`](https://esigncomply.com/docs/api/errors.md#region_mismatch), [`rate_limit_exceeded`](https://esigncomply.com/docs/api/errors.md#rate_limit_exceeded) and [`internal_error`](https://esigncomply.com/docs/api/errors.md#internal_error).

Every error has the same body: `error.type`, `error.code`, `error.message`, `error.doc_url` and `error.request_id`. See [Errors](https://esigncomply.com/docs/api/errors.md).

## Questions about GET /v1/files/{id}

### Which credential does GET /v1/files/{id} need?

A secret key with any permission. Send it as a Bearer token in the Authorization header, from your server only. A session client token is refused with insufficient_permission.

### Does GET /v1/files/{id} work with a test key?

Yes. It works with test keys and live keys. A test key reads and writes test objects only, and a live key works once the domain is verified.

### Does GET /v1/files/{id} count as a signature event?

No. A signature event is counted when a live record is written, by completing a session or by submitting a deferred acceptance. This call writes no record.

### Is GET /v1/files/{id} idempotent?

It is a read, so it is safe to repeat. It takes no Idempotency-Key header.

### What is the rate limit for GET /v1/files/{id}?

The limit is counted for each key and depends on the plan: 2 requests per second on Free, 10 on Starter, 50 on Unlimited and 100 on Enterprise. Past the limit the API answers 429 rate_limit_exceeded with a Retry-After header.

### Does the Node SDK have a method for GET /v1/files/{id}?

Yes: esc.files.get() in the esigncomply package. It resolves to { data, error } and does not throw.

## Related

- [Supplements and files](https://esigncomply.com/docs/api/supplements.md): the overview of the resource and all of its operations.
- [Create a supplement](https://esigncomply.com/docs/api/supplements/create-a-supplement.md): `POST /v1/supplements`
- [List supplements](https://esigncomply.com/docs/api/supplements/list-supplements.md): `GET /v1/supplements`
- [Retrieve a supplement](https://esigncomply.com/docs/api/supplements/retrieve-a-supplement.md): `GET /v1/supplements/{id}`
- [Read supplement content](https://esigncomply.com/docs/api/supplements/read-supplement-content.md): `GET /v1/supplements/{id}/content`
- [Supplements](https://esigncomply.com/docs/guides/supplements.md)
- [Errors](https://esigncomply.com/docs/api/errors.md): every error code, with what to do.
- [API conventions](https://esigncomply.com/docs/api.md): authentication, idempotency, rate limits and versioning.
