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

# What works differently

The patterns below apply across the whole of Circularo API v2, so they matter for every endpoint you migrate. Paths are shown without the base URL (your environment's host plus `/api/v2`).

## Searching without query bodies

API v1 took query bodies in Elasticsearch syntax: you built `must`, `should` and `nested` clauses against the paths of stored fields, so a query depended on how the data was stored.

API v2 takes named filters instead:

```http wrap theme={null}
GET /documents?transactionStatus=in-progress&createdAfter=2026-05-01T00:00:00.000Z&limit=50
Authorization: Bearer YOUR_API_KEY
```

`POST /documents/search` accepts the same filters in a body, plus `metadataFields` for searching your own structured data. Filters combine with AND; a filter that takes several values, such as `transactionStatus`, matches any of them when you repeat it.

Three things to know:

* **Arbitrary boolean logic is not available.** Cross-field OR and nested conditions have no equivalent. In practice most queries turn out to be an AND of a few fields; the ones that do not usually become two requests.
* **The named parameters of API v1 search map directly:** `type` became `metadataDefinition`, `folder` became `folderId` (with `recursive` for nested documents), `trash` became `trashed`, `from`/`size` and `limit`/`page` became `offset`/`limit`, and `inbox` is closest to `waitingForRecipient` with your own `userId`. `workflow` and `sort` have no counterpart — results come newest first.
* **Saved views work.** If the query you need already exists as a view saved in your account in the web app, `GET /me` lists it under `documentViews` and `viewId` applies it. Pass it on its own, without other filters.

## Paging replaces scrolling

There is no scroll context, and therefore nothing to close — `DELETE /logs/scroll` and `DELETE /search/scroll` have no counterpart. Every collection answers with the same envelope:

```json wrap theme={null}
{
  "results": [],
  "total": 128,
  "pagination": {
    "limit": 20,
    "offset": 0,
    "nextCursor": "9f2c4b1a9e6d4a3fb7c21d5e8a0f3b94c7e1d2a3b4c5d6e7f8091a2b3c4d5e6f"
  }
}
```

* `limit` and `offset` for random access. `limit` defaults to 20 and goes up to 100; `offset` is capped at 9900.
* `nextCursor` for walking a whole collection, past that cap. It is issued only while you page from the start — on the first page and on every cursor page — so begin a cursor walk at `offset` 0. Pass it back as `cursor`, **entirely alone** — no filters, no `offset`, no `limit` — or the request is refused with `400`; the cursor already carries the filters and the page size you started with.
* **Cursors exist only on the large collections:** `GET /audit-logs`, `GET /documents`, `POST /documents/search`, `GET /folders` and `GET /reports`. Everywhere else `nextCursor` is always `null` and you page with `offset`.
* A cursor is only issued on a full page, so a cursor walk ends when `nextCursor` comes back `null` — the last page may even be empty. On the offset-only collections, a page shorter than `limit` is your stop condition.
* `pagination` is `null` on endpoints that always return the complete list. `total` is always a real count.

A cursor expires after a short period of inactivity, so a walk has to run to completion — you cannot park one between scheduled runs. An expired or unknown cursor is a `400`, not a `404`; restart the walk.

## One resource per call

Endpoints that took arrays now take one resource per call: `DELETE /documents/{id}` and `DELETE /folders/{id}` address it in the path, and `POST /users` creates one account. Errors become unambiguous as a result — previously a bulk call could return `200` with per-item failures buried in the body, so you had to inspect every entry to know what actually happened.

If you delete in batches, the loop is yours to write, and each iteration gets its own status code.

## Concurrency: headers, not paths

The document version used to travel in the path (`PUT /documents/seal/{version}`), which made it mandatory even when you had no concurrent writers. Now it is a header, and it is optional:

```http theme={null}
GET /documents/Vt7RfKq2LmXe5ZwGyB4N
```

```text theme={null}
HTTP/2 200
ETag: "3"
```

```http theme={null}
POST /documents/Vt7RfKq2LmXe5ZwGyB4N/seal
If-Match: "3"
```

* **Send** `If-Match` with the `ETag` you read, and the write is refused with `412` if somebody changed the document in between.
* **Omit it** and the write applies to the current version. Single-writer integrations can ignore the mechanism entirely.
* **Four document writes take it:** `POST /documents/{id}/seal`, `POST /documents/{id}/annotations`, `POST /documents/{id}/clone` and `DELETE /documents/{id}`. Other writes do not.

The `ETag` is an opaque quoted string. Echo it back; do not parse it.

## Partial updates

**Omit a field to leave it unchanged.** You do not need to read the resource, modify it and send the whole thing back, so you cannot overwrite a field somebody else changed in the meantime.

Where a field can be reset, sending `null` resets it — on `PATCH /transactions/{id}/recipients/{recipientId}` it returns a recipient's setting to its default behavior, and on `PATCH /users/{id}` it clears `phone`. A field that cannot be emptied treats `null` like an omitted field; the reference says which fields accept it.

A `PATCH` returns `200` with the full updated resource, in the same shape the read endpoints return.

## Status codes carry meaning

| Code | When |
| - | - |
| `200` | A read, or an update that returns the resource |
| `201` | Something was created |
| `202` | The work was queued — poll for the result |
| `204` | Done, nothing to return |

Check for success as a range rather than equality with `200`. A `202` in particular means the operation has not happened yet: the async exports return one, with a job id to poll.

## Errors

Every error has the same envelope — the four fields API v1 already returns, so existing error parsing carries over:

```json theme={null}
{
  "status": 404,
  "type": "DOCUMENT:NOT_FOUND",
  "message": "Document not found",
  "requestId": "8f2c4b1a9e6d4a3fb7c21d5e8a0f3b94"
}
```

A request that fails validation additionally carries `details.errors`, one entry per invalid value.

Branch on `type`, not on `message` — the messages are written for humans and may be reworded. The part of the `type` before the colon is a namespace, and it can be domain-specific (`DOCUMENT` for errors about documents) or the generic `RESOURCE` used where no dedicated namespace applies — a missing transaction, for instance, reports `RESOURCE:NOT_FOUND`. Log the `requestId` and quote it when you contact support — it identifies the request in Circularo's logs. When a request changes something, its audit log entries carry the same `requestId`.

Three status codes are worth handling deliberately:

* `404` **rather than** `403` **for most things you cannot see.** For documents, folders, groups and metadata definitions, a resource that exists but is not yours is indistinguishable from one that does not exist. `403` means you are not allowed to do this — a missing right, an operation reserved for organization administrators, or a document or transaction you can see but may not change (for instance a transaction you did not start). Files are the exception: an inaccessible file answers `403`.
* `402` **when the subscription has no capacity left.** It applies to the operations that consume it — creating documents, files, transactions and accounts, cloning, sealing (including an audit trail or certificate of fulfillment that has to be sealed anew), SMS reminders, and account or group membership changes the subscription does not cover. Once the subscription is no longer active, every authenticated call answers it. An unattended integration should treat `402` as its own outcome rather than a generic failure.
* `429` **with a** `Retry-After` **header** applies to every endpoint. Respect the header rather than retrying immediately.

## Safe retries

A network timeout on a create used to be genuinely ambiguous. Now send an `Idempotency-Key` header — any unique value of your choosing — with a create, and a retry using the same key returns the original response instead of creating a second resource. `POST /transactions`, `POST /documents`, `POST /documents/{id}/clone`, `POST /folders`, `POST /users`, `POST /webhooks` and the queued exports take it:

```http theme={null}
POST /transactions
Idempotency-Key: 7f3a91c4-2e8b-4d16-9a5f-c03e7b8d21a4
```

`POST /files` does not, so a retried upload just leaves an unused file behind.

Only a request that completed is replayed, and a replayed response carries the `Idempotency-Replayed: true` header; if the original failed, a retry with the same key runs it again. Reusing a key with a *different* request is a `422`, which catches the bug where a key gets reused across unrelated requests. A retry that arrives while the original is still running gets `409` — retry again shortly. Results are kept for a limited time, after which the same key runs the request again. The API key creation endpoint is deliberately not idempotent.

## Fields and naming

* **Timestamps** are ISO 8601 — responses always give them in UTC — and a timestamp field ends in `At`: `createdAt`, `completedAt`, `expiresAt`.
* **Ids are opaque strings.** `id` is the resource's own identifier; `<resource>Id` is a reference to another one. Do not parse them or assume a format. They are the same values API v1 uses — a document, folder, file or user id, or a recipient's share id, addresses the same object on both APIs — so ids you have stored keep working.
* **Declared fields are always present.** A field with no value is `null` (or `[]`, or `{}`), never omitted. You can read a document's `templateId` without checking whether the key exists.
* **People are objects.** Wherever API v1 returned a user name — a recipient, a creator, an audit log actor — API v2 returns `{ userId, email, fullname }`, with `userId` set to `null` for a party without a Circularo account. Webhook deliveries are unchanged: their `actor` is still a plain identifier.
* **Field names are camelCase**, as in API v1 — but many fields were renamed, so map them per endpoint.

## Trash

Deleting is reversible by default: `DELETE /documents/{id}` and `DELETE /folders/{id}` move the resource to the trash, and `POST /documents/{id}/restore` or `POST /folders/{id}/restore` brings it back. Add `?permanent=true` (API v1's `hardDelete`) to delete for real. A transaction running on a trashed document is cancelled, and restoring the document does not resume it.

Deleting a folder takes its subtree with it — the subfolders and the documents inside them go too. Two exceptions: on a soft delete, documents in your personal tree that you can only read are just removed from the folder; and if the subtree holds a document you cannot delete — in the shared tree, or a read-only one on a permanent delete — nothing is deleted and the call answers `409`.

Reads are transparent about it: a trashed document is still returned by `GET /documents/{id}`, with `trashed: true`. Searches return the active documents; `trashed=true` searches the trash instead.

## Folders have two trees

Every document lives in a `personal` tree, a `shared` tree, both, or neither, and that axis is called `scope`. A placement is `{ scope, folderId }`, where `folderId: null` means the root of that tree.

This is why the old single move endpoint became two: `PUT /documents/{id}/folders/{scope}` places a document in one tree without touching the other, while `PUT /folders/{id}/parent` moves a folder within its own tree — folders cannot cross between trees.

> [!NOTE]
>
> Placing a document in the `shared` tree widens who can see it, and removing it again does not narrow that back. Treat it as a deliberate act, not just filing. API v1's `rightsMode: noop`, which placed a document without granting access, has no counterpart.

## Vocabulary

| You used to say | Now |
| - | - |
| document type, document definition | metadata definition |
| share (a signing process) | transaction |
| share for viewing, sent to a person | a `view` recipient of a transaction (only together with someone who acts), or a link |
| permanent share link | link |
| share id (one recipient's share) | recipient id |
| hash (a file) | file id |
| state | status |
| scroll | cursor |


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