# Add an annotation to a record

> POST /v1/records/{id}/annotations adds an annotation to a record, such as a legal hold or a note, as its own ledger entry: parameters, examples and errors.

Source: https://esigncomply.com/docs/api/records/add-an-annotation-to-a-record

Last updated November 26, 2026

In the Esign Comply API, `POST /v1/records/{id}/annotations` adds an annotation to a record, such as a legal hold or a note, as its own ledger entry. Use it to attach a later fact such as a legal hold, and send customer reports as supplements instead.

`POST /v1/records/{id}/annotations` · API version `2026-11-21`

## Authentication

Send a secret key in the `Authorization` header: `Bearer $ESIGNCOMPLY_API_KEY`. The key needs `full_access` 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/records/rec_Z4m8/annotations \
  -H "Authorization: Bearer $ESIGNCOMPLY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: hold-rec_Z4m8-matter-0412" \
  -d '{
    "type": "legal_hold",
    "note": "Matter 2026-0412. Review on 2027-06-01."
  }'
```

### Node SDK

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

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

const { data, error } = await esc.records.annotate(
  "rec_Z4m8",
  { type: "legal_hold", note: "Matter 2026-0412. Review on 2027-06-01." },
  { idempotencyKey: "hold-rec_Z4m8-matter-0412" },
);
```

The two samples send the same `Idempotency-Key` with bodies that differ in whitespace. Run one of them, or change the key: the same key with different bytes in the body answers `409` [`idempotency_conflict`](https://esigncomply.com/docs/api/errors.md#idempotency_conflict).

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

An annotation is a later fact attached to a record. The record itself never changes. Each annotation is its own ledger entry with its own signed receipt.

## Parameters

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

### Body fields

| Field | Type | Required | Description |
|---|---|---|---|
| `type` | string | Yes | One of the customer types below. |
| `data` | object | No | Structured detail, stored with the annotation. |
| `note` | string, up to 4,000 characters | No | Free text. Stored as `data.note`. |

| Customer type | Use |
|---|---|
| `superseded` | A later record replaces this one for your purposes. |
| `legal_hold` | Keep the record's content regardless of the retention schedule. Blocks erasure. |
| `legal_hold_released` | Ends an earlier `legal_hold`. |
| `note` | Anything else worth attaching in plain words. |
| `paper_copy_requested` | A paper-copy request. Requests made in the signer view are added by Esign Comply. Report the delivery of the copy as a `paper_copy.delivered` supplement. |

These types are written by Esign Comply only and are refused here: `consent_withdrawn`, `disputed`, `electronic_transactions_refused`, `erased`.

Customer reports are supplements, not annotations. The earlier annotation types `notice.sent` and `cancellation.requested` are still accepted here so that older integrations keep working: they are stored as a [supplement](https://esigncomply.com/docs/api/supplements.md), and the response is the supplement object with the warning `stored_as_supplement`. New integrations send reports to `POST /v1/supplements`.

Headers: `Idempotency-Key` (optional, up to 255 characters) and `Esign-Comply-Version` (optional, a dated API version). See [API conventions](https://esigncomply.com/docs/api.md).

## Response

`201 Created` with an Annotation object.

```json
{
  "object": "annotation",
  "record_id": "rec_Z4m8",
  "id": "ann_ovFH",
  "type": "legal_hold",
  "actor": "customer:key:key_Doqa",
  "created_at": "2026-11-26T00:16:51.382Z",
  "data": {
    "note": "Matter 2026-0412. Review on 2027-06-01."
  },
  "ledger_seq": 7
}
```

### Response fields

| Field | Type | Description |
|---|---|---|
| `object` | string |  |
| `id` | string |  |
| `record_id` | string |  |
| `type` | string |  |
| `actor` | string |  |
| `created_at` | datetime |  |
| `data` | object |  |
| `ledger_seq` | integer |  |

## Errors

| Code | HTTP | When |
|---|---|---|
| [`invalid_request`](https://esigncomply.com/docs/api/errors.md#invalid_request) | 400 | For any other `type`. |
| [`not_found`](https://esigncomply.com/docs/api/errors.md#not_found) | 404 | For an unknown or voided record. |
| [`subject_not_found`](https://esigncomply.com/docs/api/errors.md#subject_not_found) | 404 | A supplement names a record, session, signer or document version that does not exist in this domain and environment, references a file ID that does not exist, or names a `supersedes` target that does not exist. |
| [`insufficient_permission`](https://esigncomply.com/docs/api/errors.md#insufficient_permission) | 403 | For keys without `full_access`. |

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), [`idempotency_conflict`](https://esigncomply.com/docs/api/errors.md#idempotency_conflict), [`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 POST /v1/records/{id}/annotations

### Which credential does POST /v1/records/{id}/annotations need?

A secret key with full_access 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 POST /v1/records/{id}/annotations 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 POST /v1/records/{id}/annotations 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 POST /v1/records/{id}/annotations idempotent?

Yes, with an Idempotency-Key header of up to 255 characters. A repeat with the same key and the same bytes in the body returns the original response, with the header Idempotent-Replayed: true. The same key with a different body answers 409 idempotency_conflict.

### What is the rate limit for POST /v1/records/{id}/annotations?

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 POST /v1/records/{id}/annotations?

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

## Related

- [Records](https://esigncomply.com/docs/api/records.md): the overview of the resource and all of its operations.
- [Submit a deferred acceptance](https://esigncomply.com/docs/api/records/submit-a-deferred-acceptance.md): `POST /v1/records/deferred`
- [List records](https://esigncomply.com/docs/api/records/list-records.md): `GET /v1/records`
- [Retrieve a record](https://esigncomply.com/docs/api/records/retrieve-a-record.md): `GET /v1/records/{id}`
- [Download the evidence report](https://esigncomply.com/docs/api/records/download-the-evidence-report.md): `GET /v1/records/{id}/report`
- [Server confirmation](https://esigncomply.com/docs/guides/server-confirmation.md)
- [Evidence](https://esigncomply.com/docs/concepts/evidence.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.
