Skip to content
DocsMenu

Add an annotation to a record

View as Markdown

Open this page inChatGPTClaudeCursor

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.

Request example

cURL

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

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.

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

Response

201 Created with an Annotation object.

{
  "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 400 For any other type.
not_found 404 For an unknown or voided record.
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 403 For keys without full_access.

Like every call made with a secret key, it can also return missing_api_key, invalid_api_key, domain_not_verified, idempotency_conflict, region_mismatch, rate_limit_exceeded and internal_error.

Every error has the same body: error.type, error.code, error.message, error.doc_url and error.request_id. See Errors.

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.

Last updated · API version 2026-11-21