> ## Documentation Index
> Fetch the complete documentation index at: https://developers.circularo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Annotate and seal a document

Before a document goes anywhere, your integration can add its own content to it — a note, a logo — and then seal it, producing cryptographic proof that it has not changed since. This guide does both, in that order, in two calls.

## Before you begin

* **A document nobody has acted on yet.** Annotations are accepted only before the document has been sealed and before its transaction has started.
* **An uploaded image**, if you want to place one. The examples embed a PNG uploaded as in [Upload and download files](https://developers.circularo.com/guides/documents-and-files/files.md).

## Step 1: Add a note and an image

Text goes into `annotations`, images into `images`, and each element says where it belongs:

```http Request theme={null}
POST /documents/pXq4NcYBhK9tWdA2mFzR/annotations
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "annotations": [
    {
      "text": "Reviewed by Finance",
      "pages": [
        1
      ],
      "position": {
        "x": 0.08,
        "y": 0.82,
        "width": 0.35,
        "height": 0.04
      }
    }
  ],
  "images": [
    {
      "fileId": "e94b7c1f25a80d63b7f0c4e18a5d7b62",
      "pages": [
        1
      ],
      "position": {
        "x": 0.72,
        "y": 0.05,
        "width": 0.16,
        "height": 0.08
      }
    }
  ]
}
```

```http Response theme={null}
HTTP/2 200

{
  "id": "pXq4NcYBhK9tWdA2mFzR",
  "title": "Employment Agreement (Jane Doe)",
  "annotations": [
    {
      "addedAt": "2026-05-11T09:30:00.000Z",
      "addedBy": {
        "email": "john.smith@example.com",
        "fullname": "John Smith",
        "userId": "john.smith@example.com"
      },
      "comment": null,
      "text": "Reviewed by Finance",
      "type": "annotation_generic"
    }
  ],
  "images": [
    {
      "addedAt": "2026-05-11T09:30:00.000Z",
      "addedBy": {
        "email": "john.smith@example.com",
        "fullname": "John Smith",
        "userId": "john.smith@example.com"
      },
      "comment": null,
      "fileId": "e94b7c1f25a80d63b7f0c4e18a5d7b62"
    }
  ],
  ...
}
```

A few things to notice:

* `pages` lists the pages an element is placed on, and `position` places it there. The values are fractions of the page, the same coordinate system placed signature fields use — [Place fields on the document](https://developers.circularo.com/guides/signing/placed-fields.md) explains it in detail.
* An image is not uploaded here: `fileId` references a file you uploaded beforehand, and it is embedded into the document at the position you give it.
* The response is the updated document. `annotations` and `images` list everything it now carries, each with who added it and when.
* An annotation's `type` says what it represents; left out, it is a plain piece of text.

The note and the image are part of the document now, not a comment attached to it, and every later read returns them.

## Step 2: Seal the document

A seal is applied to the document as a whole, so the request only says which proof to add:

```http Request theme={null}
POST /documents/pXq4NcYBhK9tWdA2mFzR/seal
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "useCertificate": true
}
```

```http Response theme={null}
HTTP/2 200

{
  "id": "pXq4NcYBhK9tWdA2mFzR",
  "title": "Employment Agreement (Jane Doe)",
  "signatures": [
    {
      "certificate": {
        "fingerprintSha256": "3F9A1C7E52B8D406E1A9C3F75D2B8E604A1C9F3E7B5D2A8C6E4F1B9D3A7C5E2F",
        "hasQcComplianceStatement": false,
        "hasQcSscdStatement": false,
        "isSelfSigned": true,
        "issuer": "CN=Example Ltd,O=Example Ltd,C=CZ",
        "keyUsage": [
          "digitalSignature",
          "nonRepudiation",
          "keyEncipherment"
        ],
        "qcTypes": [],
        "serialNumber": "5B2E9D47C01A8F36E4D2B7190C6A3F58E1D4B207",
        "signatureAlgorithm": "SHA256withRSA",
        "subject": "CN=Example Ltd,O=Example Ltd,C=CZ",
        "trustLists": [
          "INTERNAL"
        ],
        "validityEndsAt": "2031-01-01T00:00:00.000Z",
        "validityStartsAt": "2026-01-01T00:00:00.000Z"
      },
      "comment": null,
      "hasLongTermValidationData": true,
      "isTimestamped": false,
      "isVerified": true,
      "sealProvider": "internal",
      "signatureProvider": "internal",
      "signedAt": "2026-05-11T09:32:00.000Z",
      "signedBy": {
        "email": "john.smith@example.com",
        "fullname": "John Smith",
        "userId": "john.smith@example.com"
      },
      "signerName": null,
      "timestampAuthority": null,
      "tsaServer": null,
      "type": "seal"
    }
  ],
  "mainFile": {
    "fileId": "6c1e83b5f7a9042dcb8e5f217a3d90c4",
    "fileName": "Employment Agreement (Jane Doe)",
    "mimeType": "application/pdf",
    "pageCount": 1
  },
  ...
}
```

A few things to notice:

* `useCertificate` seals the document with a digital certificate; `useTimestamp` adds a trusted timestamp from a Time Stamping Authority, proving when it was sealed. Enable at least one — a request with neither is rejected with `400`.
* The seal joins the document's `signatures`, marked `type: seal`, together with any signatures the document already carries.
* Sealing writes the sealed PDF, so `mainFile.fileId` now points at a new file. Download it as in [Upload and download files](https://developers.circularo.com/guides/documents-and-files/files.md).
* Sealing consumes transaction capacity from your subscription.

A seal does not close the document's process: you can still send a sealed document for signature.

> [!NOTE]
>
> Add your annotations before you seal the document or send it to anyone. Afterwards the same call is refused with `409` — and the only way to annotate that content is a fresh copy of the document.

> [!NOTE]
>
> Annotating and sending can happen in one call: `POST /transactions` takes `apply.annotations` and `apply.images` next to `send`, adding exactly the same elements as the transaction starts. Use the endpoint on this page when nothing is being sent.

## Complete example

Annotating a document and sealing it, as a Node.js script. Error handling is minimal for brevity — in production, inspect the error envelope of non-2xx responses.

```js theme={null}
// your environment's base URL
const BASE_URL = "https://sandbox.circularo.com/api/v2";
const API_KEY = "YOUR_API_KEY";
const HEADERS = { "Authorization": `Bearer ${API_KEY}`, "Content-Type": "application/json" };
const documentId = "pXq4NcYBhK9tWdA2mFzR"; // the document to work on

const annotated = await fetch(`${BASE_URL}/documents/${documentId}/annotations`, {
  method: "POST",
  headers: HEADERS,
  body: JSON.stringify({
    annotations: [
      {
        text: "Reviewed by Finance",
        pages: [
          1
        ],
        position: {
          x: 0.08,
          y: 0.82,
          width: 0.35,
          height: 0.04
        }
      }
    ],
    images: [
      {
        fileId: "e94b7c1f25a80d63b7f0c4e18a5d7b62",
        pages: [
          1
        ],
        position: {
          x: 0.72,
          y: 0.05,
          width: 0.16,
          height: 0.08
        }
      }
    ]
  })
});
// error handling kept minimal for brevity
if (!annotated.ok) throw new Error(`Annotating failed: ${annotated.status}`);

const sealed = await fetch(`${BASE_URL}/documents/${documentId}/seal`, {
  method: "POST",
  headers: HEADERS,
  body: JSON.stringify({
    useCertificate: true
  })
});
if (!sealed.ok) throw new Error(`Sealing failed: ${sealed.status}`);

const document = await sealed.json();
console.log(`Sealed document ${document.id}, main file is now ${document.mainFile.fileId}`);
```

## Next steps

* Send the document to recipients instead of finishing it yourself — [Signing & approvals](https://developers.circularo.com/guides/signing).
* Copy a document that can no longer be edited — [Copy a document and share a view link](https://developers.circularo.com/guides/documents-and-files/clone-and-links.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.