Справочник API
Все методы API v2, собранные из документа OpenAPI (/v2/openapi.json). Описания методов — на английском.
Базовый адрес https://api.monoclan.ru. Ключ передаётся в заголовке Authorization: Bearer sk_test_… (или sk_live_…); браузерные методы под /v2/client принимают вместо ключа секрет сессии. Звёздочкой отмечены обязательные поля.
Documents
POST /v2/documents
Create a document
From an uploaded DOCX or PDF (file), from Markdown, from a template, or empty. Word documents keep their layout one to one. Pass send: true to send at once.
| Поле | Тип | Описание |
|---|---|---|
name |
string | |
file |
string | A file_ id (DOCX or PDF) uploaded with purpose "document". |
markdown |
string | The document as Markdown; {{markers}} become fields. |
template |
string | |
template_version |
integer | |
locale |
string | |
message |
string | null |
signing_order |
string | |
expires_at |
string | null |
reminders |
object | null |
parties |
array | |
fields |
array | |
data |
object | Field values by key. |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
send |
boolean | Send right after creating. |
GET /v2/documents
List documents
Filter by stage, template, counterparty, dates, words (q) and any field value (field.<key>…); sort by any column or field (sort); show field values as columns (columns). A sorted list pages with cursor = next_cursor.
| Параметр | Где | Описание |
|---|---|---|
limit |
query | |
starting_after |
query | |
ending_before |
query | |
status |
query | |
stage |
query | Stages, comma-separated: draft, approval (a draft with its approvers), signing, completed, declined, voided, expired |
template |
query | |
waiting |
query | Only documents waiting for the signed-in member to sign or approve |
q |
query | Words to find anywhere: name, text, field values, recipients, counterparty (prefix match, all words; "quoted" for a phrase, -word to exclude) |
counterparty |
query | Documents with this counterparty (case-insensitive), or none for those without one |
created_from |
query | YYYY-MM-DD |
created_to |
query | YYYY-MM-DD, inclusive |
updated_from |
query | YYYY-MM-DD |
updated_to |
query | YYYY-MM-DD, inclusive |
archived |
query | Archived documents are left out unless asked: only or include |
field.{key} |
query | A field value condition, any number of them: field.city=Moscow,Kazan (any of, case-insensitive), field.city.contains=mos, field.amount.gte=100000, field.end_date.lte=2027-01-01, field.inn.empty=true, field.inn.filled=true |
sort |
query | updated, created (default, newest first), name, status, counterparty or field.-updated, field.amount |
columns |
query | Field keys, comma-separated: each row then carries columns with their values as shown |
cursor |
query | next_cursor from the previous page |
GET /v2/documents/groups
Count documents by group
How many documents fall into each counterparty, template, stage, status or value of a field (by=field.<key>), largest first, the empty group last; the same filters as the list. Pass a group's value back as the list's filter to open it.
| Параметр | Где | Описание |
|---|---|---|
by * |
query | counterparty, template, stage, status or field. |
status |
query | |
stage |
query | Stages, comma-separated: draft, approval (a draft with its approvers), signing, completed, declined, voided, expired |
template |
query | |
waiting |
query | Only documents waiting for the signed-in member to sign or approve |
q |
query | Words to find anywhere: name, text, field values, recipients, counterparty (prefix match, all words; "quoted" for a phrase, -word to exclude) |
counterparty |
query | Documents with this counterparty (case-insensitive), or none for those without one |
created_from |
query | YYYY-MM-DD |
created_to |
query | YYYY-MM-DD, inclusive |
updated_from |
query | YYYY-MM-DD |
updated_to |
query | YYYY-MM-DD, inclusive |
archived |
query | Archived documents are left out unless asked: only or include |
field.{key} |
query | A field value condition, any number of them: field.city=Moscow,Kazan (any of, case-insensitive), field.city.contains=mos, field.amount.gte=100000, field.end_date.lte=2027-01-01, field.inn.empty=true, field.inn.filled=true |
GET /v2/documents/columns
Fields the list can show
The account's field keys, most used first, with label, type and how many documents carry and fill them.
POST /v2/documents/bulk
One action on many documents
delete (drafts), archive (off the list; a document out for signature must be withdrawn first) or unarchive, up to 200 documents; each succeeds or fails on its own.
| Поле | Тип | Описание |
|---|---|---|
action * |
string | |
ids * |
array |
POST /v2/documents/archive/empty
Empty the archive
Deletes every archived document for good. A person only: agents archive, they never delete.
GET /v2/documents/{id}
Retrieve a document
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
PATCH /v2/documents/{id}
Update a document
Drafts can change everything; after sending only metadata changes.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
name |
string | |
locale |
string | |
message |
string | null |
signing_order |
string | |
expires_at |
string | null |
reminders |
object | null |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
fields |
array | |
remove_fields |
array | Keys of fields to remove. Only fields that are not part of the text: a PDF's boxes, form questions. |
data |
object |
DELETE /v2/documents/{id}
Delete a draft
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
POST /v2/documents/{id}/archive
Archive a document
Takes it off the list (archived=only shows it); nothing is deleted. A document out for signature is withdrawn first.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
POST /v2/documents/{id}/unarchive
Bring a document back from the archive
Puts it back on the list.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
PUT /v2/documents/{id}/counterparty
Set the counterparty
Who the contract is with, as the list shows and groups it. name sets it by hand (null: found again automatically); field names the field (by key) that holds it.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
name |
string | null |
field |
string | null |
POST /v2/documents/{id}/copy
Start again from a document
A new draft with the text as it stands, the same fields (the sender’s values kept) and the same people in the same steps, all waiting: to change and send again after voiding, a decline or expiry. metadata.copied_from names the original.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
POST /v2/documents/{id}/send
Send for signature
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
POST /v2/documents/{id}/void
Void (withdraw) a sent document
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
reason |
string | null |
POST /v2/documents/{id}/unsend
Back to a draft (nobody has signed, approved or declined yet)
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
POST /v2/documents/{id}/remind
Remind waiting signers
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
party |
string |
GET /v2/documents/{id}/content
Read the content
markdown for agents (fields as values or {{key}}), html to display, blocks with ids for targeted edits, json for editors.
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
format |
query | |
values |
query | |
revision |
query |
PATCH /v2/documents/{id}/content
Edit the content by block id
Replace, insert or delete blocks, or replace exact text. Formatting and numbering of the surrounding clauses stay.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
revision * |
integer | The revision you edited; a newer one is a conflict. |
operations * |
array | |
note |
string | null |
GET /v2/documents/{id}/revisions
List revisions
Every edit is a revision, kept whole. By default saves made in one sitting (one person, pauses under 5 minutes, at most 30 minutes) come as one entry: revision is its last save, from_revision its first, edits how many; compare from_revision-1 to revision to see the whole sitting. group=none lists every save. Newest first. Read one with GET /content?revision=N.
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
limit |
query | |
before |
query | |
group |
query |
GET /v2/documents/{id}/blocks/{block}/history
A paragraph’s history
Each version where the block appeared, changed (with the words that went and came) or went away, newest first: who, when, with what note.
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
block * |
path |
GET /v2/documents/{id}/changes
Changes since a version, with who made them
Blocks changed since since (default: the version the draft went out for approval with), each with the people who changed it.
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
since |
query |
GET /v2/documents/{id}/revisions/compare
Compare two revisions
Blocks added, removed, changed (with the words that went and came) and reformatted, and fields added, removed or changed. Defaults: to = current, from = the one before.
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
from |
query | |
to |
query | |
rows |
query |
POST /v2/documents/{id}/revisions/{target}/restore
Restore an earlier revision
Drafts only. The earlier text becomes a new revision; the ones in between stay readable. Pass the current revision you saw.
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
target * |
path |
| Поле | Тип | Описание |
|---|---|---|
revision * |
integer | |
note |
string | null |
POST /v2/documents/{id}/versions/preview
Compare a Word file with the current version
A .docx (uploaded as a file with purpose "document") that should become the next version: every changed, added and removed paragraph with both texts side by side (rows), values typed over fields, and what the document cannot take from the file (notes). Nothing changes; apply it with POST /v2/documents/{id}/versions.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
file * |
string |
POST /v2/documents/{id}/versions
Make a Word file the next version
Drafts only. The file becomes a new revision in one step, with every change it brings except those in rejected (change ids from the preview; field:<key> for a value typed over a field). Fields stay fields; the document keeps its own Word package. Pass the revision you compared against.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
file * |
string | |
revision * |
integer | |
rejected |
array | null |
note |
string | null |
GET /v2/documents/{id}/docx
Download as DOCX
A draft by default keeps every conditional variant and its fields as Word content controls, so the file can come back as the next version (upload_version). view=final gives the text as it will be signed: conditions applied, values as plain text (what the PDF shows).
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
view |
query |
GET /v2/documents/{id}/pdf
Download the PDF
The signed PDF with its certificate once completed; before that, a preview with the current values.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
GET /v2/documents/{id}/audit_trail
Audit trail
Every event of the document with its hash chain, and whether the chain verifies.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
POST /v2/documents/{id}/parties
Add a party
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
role |
string | |
kind |
string | signer signs, approver approves or returns the document (before signatures it goes back to draft), cc gets the result. |
member |
string | null |
name |
string | null |
email |
string | null |
locale |
string | null |
delivery |
string | email: we send the link. link: you get signing_url. embedded: you open a signing session. |
can |
string | null |
order |
integer | |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
PATCH /v2/documents/{id}/parties/{party}
Update a party
After sending, only the details of a party who has not acted yet can change.
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
party * |
path |
| Поле | Тип | Описание |
|---|---|---|
role |
string | |
kind |
string | signer signs, approver approves or returns the document (before signatures it goes back to draft), cc gets the result. |
member |
string | null |
name |
string | null |
email |
string | null |
locale |
string | null |
delivery |
string | email: we send the link. link: you get signing_url. embedded: you open a signing session. |
can |
string | null |
order |
integer | |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
DELETE /v2/documents/{id}/parties/{party}
Remove a party from a draft
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
party * |
path |
Files
POST /v2/files
Upload a file
Multipart form with file and purpose (document for DOCX or PDF to sign, image, attachment); or JSON with content_base64, filename and purpose, which is easier for agents.
| Поле | Тип | Описание |
|---|---|---|
content_base64 * |
string | |
filename |
string | |
purpose * |
string |
GET /v2/files
List files
| Параметр | Где | Описание |
|---|---|---|
limit |
query | |
starting_after |
query | |
ending_before |
query | |
purpose |
query |
POST /v2/files/upload_links
A one-time address to upload a file to
For agents with a terminal: send the file there with curl -X PUT --data-binary @file <url> (15 minutes, once), so it never passes through the model as base64. The answer of that PUT is the file.
| Поле | Тип | Описание |
|---|---|---|
filename |
string | |
purpose |
string |
GET /v2/files/{id}
Retrieve a file
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
DELETE /v2/files/{id}
Delete a file
Deletes an upload nothing uses yet. Signatures, signed documents and files a document or template uses stay.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
GET /v2/files/{id}/content
Download a file
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
Templates
POST /v2/templates
Create a template
| Поле | Тип | Описание |
|---|---|---|
file |
string | A file_ id: DOCX keeps its layout, PDF gets placed fields. |
markdown |
string | |
document |
string | Turn an existing document into a template. |
fields |
array | |
roles |
array | |
note |
string | null |
name |
string | |
description |
string | null |
locale |
string | null |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
status |
string | draft (the default): not offered yet; published: offered when a document is created. |
GET /v2/templates
List templates
| Параметр | Где | Описание |
|---|---|---|
limit |
query | |
starting_after |
query | |
ending_before |
query | |
status |
query | Only templates in this state. Without it: all but archived. |
archived |
query | The archive: only archived templates, or include them |
POST /v2/templates/bulk
One action on many templates
archive, unarchive, duplicate, or delete (archived templates, for good: a person only), up to 200; each succeeds or fails on its own.
| Поле | Тип | Описание |
|---|---|---|
action * |
string | |
ids * |
array |
GET /v2/templates/{id}
Retrieve a template
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
version |
query |
PATCH /v2/templates/{id}
Update a template
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
name |
string | |
description |
string | null |
locale |
string | null |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
status |
string | published: offered when a document is created; unpublished: taken off the list. |
counterparty_field |
string | null |
DELETE /v2/templates/{id}
Archive a template, or delete an archived one for good
Moves the template to the archive (archived=only lists it; documents made from it are not touched). With forever=true an archived template is deleted for good: a person only, never an agent.
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
forever |
query |
POST /v2/templates/{id}/versions
Publish a new version
Documents created before keep the version they were made from.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
file |
string | A file_ id: DOCX keeps its layout, PDF gets placed fields. |
markdown |
string | |
document |
string | Turn an existing document into a template. |
fields |
array | |
roles |
array | |
note |
string | null |
GET /v2/templates/{id}/versions
List versions
Every version, newest first: when it was published, by whom, with what note.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
GET /v2/templates/{id}/content
Read a version’s text
Markdown with field markers and conditions (default), or HTML with its CSS to show it.
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
version |
query | |
format |
query |
POST /v2/templates/{id}/draft
Open the working draft
The template’s current version as a draft document to edit with every document tool (fields, conditions, co-editing). One per template, shared; it is never sent. Publish it to make the next version; until then the template does not change.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
POST /v2/templates/{id}/publish
Publish the working draft as a version
Makes the template’s next version from its working draft, and removes the draft. Documents made earlier keep their version.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
document * |
string | |
note |
string | null |
POST /v2/templates/{id}/duplicate
Duplicate a template
A copy to change apart from it: its current version, parties and settings; the copy starts as a draft.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
name |
string |
POST /v2/templates/{id}/unarchive
Bring a template back from the archive
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
Sessions
POST /v2/sessions
Create a session for an embedded component
Returns a short-lived client_secret for the browser. signing needs a party and is refused for agent keys; viewing shows a document; editing opens a draft in the editor.
| Поле | Тип | Описание |
|---|---|---|
kind * |
string | |
document * |
string | |
party |
string | null |
expires_in |
integer | |
return_url |
string | null |
features |
array |
Webhooks
POST /v2/webhook_endpoints
Create a webhook endpoint
The response holds the signing secret; it is shown only here.
| Поле | Тип | Описание |
|---|---|---|
url * |
string | |
enabled_events * |
array | |
description |
string | null |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
GET /v2/webhook_endpoints
List webhook endpoints
| Параметр | Где | Описание |
|---|---|---|
limit |
query | |
starting_after |
query | |
ending_before |
query |
GET /v2/webhook_endpoints/{id}
Retrieve a webhook endpoint
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
PATCH /v2/webhook_endpoints/{id}
Update a webhook endpoint
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
url |
string | |
enabled_events |
array | |
description |
string | null |
status |
string | |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
DELETE /v2/webhook_endpoints/{id}
Delete a webhook endpoint
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
GET /v2/webhook_endpoints/{id}/deliveries
Delivery log
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
limit |
query | |
starting_after |
query | |
ending_before |
query |
POST /v2/webhook_endpoints/{id}/deliveries/{delivery}/retry
Retry a delivery now
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
delivery * |
path |
Events
GET /v2/events
List events
The last 30 days, newest first.
| Параметр | Где | Описание |
|---|---|---|
limit |
query | |
starting_after |
query | |
ending_before |
query | |
type |
query | |
document |
query |
GET /v2/events/{id}
Retrieve an event
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
Account
GET /v2/account
The account and key in use
GET /v2/usage
Usage by month
| Параметр | Где | Описание |
|---|---|---|
months |
query |
API keys
POST /v2/api_keys
Create an API key
Restricted keys carry permissions; agent: true keys can do everything their permissions allow except sign, and every key they create is an agent key too. The secret is shown only here.
| Поле | Тип | Описание |
|---|---|---|
kind |
string | |
name |
string | null |
permissions |
array | |
tenant |
string | null |
agent |
boolean | |
allowed_recipient_domains |
array | null |
expires_at |
string | null |
GET /v2/api_keys
List API keys
| Параметр | Где | Описание |
|---|---|---|
limit |
query | |
starting_after |
query | |
ending_before |
query |
POST /v2/api_keys/{id}/revoke
Revoke an API key
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
Tenants
POST /v2/tenants
Create a tenant
A customer of your platform with its own brand, sender name and documents. Act for it with the Monoclan-Tenant header.
| Поле | Тип | Описание |
|---|---|---|
name * |
string | |
email |
string | null |
locale |
string | null |
branding |
object | |
sender |
object | |
external_id |
string | null |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
GET /v2/tenants
List tenants
| Параметр | Где | Описание |
|---|---|---|
limit |
query | |
starting_after |
query | |
ending_before |
query |
GET /v2/tenants/{id}
Retrieve a tenant
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
PATCH /v2/tenants/{id}
Update a tenant
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
name |
string | |
email |
string | null |
locale |
string | null |
branding |
object | |
sender |
object | |
external_id |
string | null |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
Client
GET /v2/client/session
What the session’s browser sees
Signing sessions get the signing view. Viewing and editing sessions get the document view: status, parties, history, content, readiness and the actions the session allows.
POST /v2/client/session/values
Save field values
A signer saves their own fields; an editing session with "values" fills the sender’s fields of a draft.
| Поле | Тип | Описание |
|---|---|---|
data * |
object |
POST /v2/client/session/sign
Sign
The signature is a PNG (drawn, or a typed name drawn in a script face by the component). Consent must be true.
| Поле | Тип | Описание |
|---|---|---|
data |
object | |
name |
string | |
signature * |
object | |
initials |
object | |
consent * |
boolean |
POST /v2/client/session/decline
Decline to sign
| Поле | Тип | Описание |
|---|---|---|
reason |
string |
POST /v2/client/session/decision
Approve or return a draft (an approver’s turn)
In the editing session opened for an approver’s turn on a draft out for approval: approve (with a comment) or return (with the reason).
| Поле | Тип | Описание |
|---|---|---|
decision * |
string | |
text |
string | null |
POST /v2/client/session/approve
Approve the document (an approver in the workflow)
| Поле | Тип | Описание |
|---|---|---|
comment |
string |
POST /v2/client/session/return
Send the document back with what has to change (an approver)
| Поле | Тип | Описание |
|---|---|---|
reason |
string |
GET /v2/client/session/source.pdf
The PDF being signed (PDF documents)
GET /v2/client/session/signed.pdf
The signed PDF, once everyone signed
POST /v2/client/session/send
Send for signature
Editing sessions with "send". Fails with the first readiness issue.
POST /v2/client/session/remind
Remind waiting signers
Sessions with "remind". Without a party, every signer whose turn it is gets a reminder.
| Поле | Тип | Описание |
|---|---|---|
party |
string |
POST /v2/client/session/void
Withdraw the document
Sessions with "void". Signers can no longer open it.
| Поле | Тип | Описание |
|---|---|---|
reason |
string |
POST /v2/client/session/unsend
Back to a draft
Sessions with "void", while nobody has signed, approved or declined: the document becomes a draft again and its links stop working.
POST /v2/client/session/parties
Change the parties of a draft
Editing sessions with "parties". Removals run first, then updates, then additions.
| Поле | Тип | Описание |
|---|---|---|
add |
array | |
update |
array | |
remove |
array |
POST /v2/client/session/settings
Change the draft’s name, message or signing order
Editing sessions with "values". The message is what signers read above the document.
| Поле | Тип | Описание |
|---|---|---|
name |
string | |
message |
string | null |
signing_order |
string |
POST /v2/client/session/content
Edit the text of a draft
Editing sessions with "content". Operations address blocks by id; revision guards against lost updates.
| Поле | Тип | Описание |
|---|---|---|
revision * |
integer | |
operations * |
array |
GET /v2/client/session/revisions
The document’s revisions
Viewing and editing sessions. Newest first, saves made in one sitting as one entry; group=none lists every save; before pages back.
| Параметр | Где | Описание |
|---|---|---|
before |
query | |
limit |
query | |
group |
query |
GET /v2/client/session/blocks/{block}/history
A paragraph’s history
| Параметр | Где | Описание |
|---|---|---|
block * |
path |
GET /v2/client/session/changes
Changes since a version, with who made them
| Параметр | Где | Описание |
|---|---|---|
since |
query |
GET /v2/client/session/revisions/compare
Compare two revisions
Viewing and editing sessions. Defaults: to = current, from = the one before.
| Параметр | Где | Описание |
|---|---|---|
from |
query | |
to |
query | |
rows |
query |
POST /v2/client/session/revisions/restore
Restore an earlier revision
Editing sessions with "content". target becomes current again as a new revision; revision is the current one you saw.
| Поле | Тип | Описание |
|---|---|---|
target * |
integer | |
revision * |
integer | |
note |
string | null |
POST /v2/client/session/fields
Place and change the fields of a draft
Editing sessions with "content". For a PDF, a field's placements are its boxes on the pages, in points from the top-left corner.
| Поле | Тип | Описание |
|---|---|---|
upsert |
array | |
remove |
array |
GET /v2/client/session/document
The draft in the Monoclan model, for an editor
Editing sessions with "content". Send it back changed with a replace_body operation to /v2/client/session/content.
Agents
GET /v2/me/agent-inbox
My agent inbox
Where Monoclan tells your own agent about your documents, or null.
PUT /v2/me/agent-inbox
Connect my agent
Your agent hears when a document waits for you to approve or sign, and what happens to the documents you sent (approved, returned with edits, signed, declined, completed). Replaces the earlier one. A webhook’s signing secret is shown once.
| Поле | Тип | Описание |
|---|---|---|
kind * |
string | eggent: a turn through Eggent’s external API. webhook: a signed JSON for any other harness. |
url * |
string | Eggent: the workspace address (https://name.cloud.eggent.ai). Webhook: the full address to post to. |
token |
string | null |
project |
string | null |
DELETE /v2/me/agent-inbox
Disconnect my agent
POST /v2/me/agent-inbox/test
Send a test message
Sends a short check to your agent now and says whether it got through.
Review
GET /v2/documents/{id}/review
Review state
Rounds of approval (newest first) with each reviewer’s status, decision, comment and review link; comments with threads; suggested edits.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
POST /v2/documents/{id}/reviews
Start a review round
Asks named people to approve the draft as it is now, in order or all at once. Each gets a review link (review_url) to pass on. Any later change to the text makes the round outdated. Sending waits for an approved round (or a cancelled one).
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
name |
string | null |
reviewers |
array | People to ask by name; none: whoever the circle's shared link is passed to joins |
order |
string | Default: all at once |
message |
string | null |
POST /v2/documents/{id}/reviews/{review}/cancel
Cancel a review round
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
review * |
path |
POST /v2/documents/{id}/reviews/word
Bring in a Word file that came back from review
The .docx reviewers sent back (uploaded as a file with purpose "document"): tracked changes, edits made without tracking and Word comments become suggestions and comments in a review circle, under each Word author. The text does not change; revision is the version it stood at.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
file * |
string | |
review |
string | null |
name |
string | null |
POST /v2/documents/{id}/reviews/{review}/reviewers
Add people to an open circle
More reviewers in a circle that is open; each gets their own review_url.
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
review * |
path |
| Поле | Тип | Описание |
|---|---|---|
reviewers * |
array |
POST /v2/documents/{id}/reviews/{review}/close
Close a circle
The circle takes no more comments or decisions; its discussion stays. Sending waits for open circles.
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
review * |
path |
POST /v2/documents/{id}/comments
Comment on the text
On a block and the exact words (quote), or a reply in a thread.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
body * |
string | |
whole |
boolean | null |
block |
string | null |
quote |
string | null |
thread |
string | null |
POST /v2/documents/{id}/comments/{comment}/resolve
Resolve a comment thread (or reopen it)
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
comment * |
path |
| Поле | Тип | Описание |
|---|---|---|
resolved |
boolean |
POST /v2/documents/{id}/suggestions
Suggest an edit
Exact text in a block and what to put instead. The sender’s side accepts it (it becomes a new version) or rejects it.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
block * |
string | |
find * |
string | Exact text in the block to change |
replace * |
string | What to put instead (empty to delete) |
note |
string | null |
POST /v2/documents/{id}/return
Return to the author with proposed edits
For the workspace member whose approval step it is (directly or through their agent): the document, signed by no one yet, goes back to its author as a draft, with the reason as a comment and each proposed edit as a suggestion to accept or reject. Approving is done by the person in their workspace.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
reason |
string | null |
edits |
array | Exact edits to propose |
POST /v2/documents/{id}/approve
Approve a draft on your turn
For the workspace member whose turn it is on a draft out for approval, signed in as themselves (never an agent): approve, or return with the reason. The approver may have changed the draft first; every change is a version under their name.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
decision * |
string | |
text |
string | null |
POST /v2/documents/{id}/suggestions/{suggestion}/accept
Accept a suggested edit
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
suggestion * |
path |
POST /v2/documents/{id}/suggestions/{suggestion}/reject
Reject a suggested edit
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
suggestion * |
path |
Negotiation
GET /v2/documents/{id}/negotiation
Negotiation state
The latest negotiation on the document: whose move it is, the points of both sides (yours including drafts not yet sent), what the other side answered on its last turn, and the link for the other side. from adds your view of the text as blocks with ids, to propose edits by.
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
words |
query | Each point’s words, went and came |
from |
query | Include your view’s text from this block number |
blocks |
query | How many blocks of text (default 200), at most 2000 |
POST /v2/documents/{id}/negotiation
Start a negotiation
Opens a negotiation with the other side on the draft as it is now and gives a link (link) for them: they read, propose changes and decide on yours there, or through their own agent. The first move is theirs. While it is open the text changes only by accepted points.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
name * |
string | Who negotiates for the other side |
email |
string | null |
company |
string | null |
message |
string | null |
POST /v2/documents/{id}/negotiation/edits
Propose changes
Changes your view of the text; each changed paragraph or table becomes a point (a draft until you pass the turn). An edit that undoes another removes the point.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
operations * |
array | The same operations a draft is edited with, by block id from the negotiation’s text: replace_text, replace, insert_after, insert_before, append, delete. They change your view, not the agreed text. |
reason |
string | null |
PUT /v2/documents/{id}/negotiation/view
Save your whole view
An editor’s save: your view of the text as a whole; the points are what it differs from the agreed text by.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
content * |
object | Your whole view as the editor saves it (JSON content) |
reason |
string | null |
GET /v2/documents/{id}/negotiation/view
Your view of the text
The agreed text with your drafts, as JSON content an editor opens.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
POST /v2/documents/{id}/negotiation/proposals/{proposal}/decision
Decide on a point
On your move: accept, reject or counter one point of the other side. Accepting changes the agreed text (a new revision).
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
proposal * |
path |
| Поле | Тип | Описание |
|---|---|---|
decision * |
string | accept: the point goes into the agreed text. reject: it does not. counter: it does not, and you propose your own wording of that place (edit it before passing the turn). |
note |
string | null |
DELETE /v2/documents/{id}/negotiation/proposals/{proposal}
Take back a draft
Removes one of your points not yet sent.
| Параметр | Где | Описание |
|---|---|---|
id * |
path | |
proposal * |
path |
POST /v2/documents/{id}/negotiation/pass
Pass the turn
Sends your drafts to the other side and gives them the move. Every point of theirs must be decided first.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
| Поле | Тип | Описание |
|---|---|---|
message |
string | null |
POST /v2/documents/{id}/negotiation/agree
Agree to the text
You agree to the text as it is now (nothing of theirs waiting, no drafts of yours). When the other side agrees to the same version the negotiation closes as agreed and the document can be sent.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
POST /v2/documents/{id}/negotiation/stop
Stop the negotiation
Ends it: points not decided go, the text stays as agreed so far and can be edited again.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
GET /v2/documents/{id}/negotiation/word
Your view as a Word file
The agreed text with your drafts as a .docx, each paragraph marked so the file maps back exactly. Edit it in Word (plainly or with tracked changes) and upload it back: what it changes becomes your drafts.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
POST /v2/documents/{id}/negotiation/word
Upload your Word file back
Your view edited in Word: the body is the .docx (raw bytes, or JSON { "base64": "…", "reason": "…" }). What it changes against your view becomes your drafts, replacing those you had.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
GET /v2/documents/{id}/negotiation/protocol
Protocol of disagreements
A Word table of every point put forward: each side’s wording, the reason and the outcome.
| Параметр | Где | Описание |
|---|---|---|
id * |
path |
Search
GET /v2/search
Search documents and templates
Finds documents and templates by their name, text, field values, recipients (names, emails) and counterparty, best matches first. Every word must match, as the start of a word (договор finds договора); "quoted words" in that order; -word excludes; a | b either. Each hit says where it matched (name, details, text) and shows the words in context. Changes made a moment ago are found: the account's index is brought up to date before the search.
| Параметр | Где | Описание |
|---|---|---|
q * |
query | |
kind |
query | document, template, or both (default) |
limit |
query | |
offset |
query |