Monoclan Docs

Working together

Versions, live updates, a workflow of approvers and signers, comments and suggested edits, negotiation with the other side, conditional clauses, page setup and editing together — for people and agents alike.

Versions

Every edit of a draft is a version, kept whole: who made it (the sender's side or an agent, by name), its note and how it was made. Give each edit a note (PATCH /v2/documents/{id}/content); it becomes the change log.

  • GET /v2/documents/{id}/revisions — newest first.
  • GET /v2/documents/{id}/revisions/compare?from=&to= — blocks added, removed, changed (the words that went and came), reformatted and shown under another condition; fields added, removed, changed; page setup.
  • POST /v2/documents/{id}/revisions/{n}/restore — an earlier version becomes current as a new one; nothing in between is lost.
  • GET /v2/documents/{id}/blocks/{block}/history — one paragraph's life: each version where it appeared, changed (which words went and came) or went away, by whom and with what note.
  • GET /v2/documents/{id}/changes?since= — what changed since version since (by default, since it went out for approval), each block with who changed it.

Components show the same in the editor's History panel and in the paragraph history under the cursor; agents use list_versions, compare_versions, restore_version, paragraph_history and changes_since.

Live updates

Every event is pushed as it happens. A component listens to its session (GET /v2/client/session/stream, the secret in the Authorization header), a server to its account (GET /v2/events/stream, optionally ?document=). Each change names the event type, the document, the revision and who did it; read what changed through the ordinary routes. The components follow by themselves: an agent's edit appears in an open editor, a signature in a status card.

Workflow: approvers and signers

A document's participants are a workflow of steps. In each step one or more people act at the same time: sign (kind: "signer"), approve ("approver") or only get the result ("cc"). The next step starts when everyone in the previous one is done (signing_order: "sequential"; "parallel" runs everyone at once). The step is the participant's order. Typical workflows: legal approves → both sides sign; a manager approves → the client signs → the director signs last.

Colleagues come from the directory (member) and act in their workspace; people outside get a link. An approver reads the document and approves it (with a comment if they like) or returns it with what has to change. If nobody has signed yet, the document goes back to draft: the author sees the note, edits and sends it again, and the workflow starts over. After the first signature the text is fixed, so returning declines it.

Approval in the draft

When the workflow's first step is colleagues who approve, sending does not let the document out to the signers: it stays a draft out for approval (in_approval: true, approval_base_revision), and the approvers get the draft itself. On their turn an approver changes the text as they like (every change a version under their name), then approves it (decision: "approve", a comment if they like) or sends it back (decision: "return" with the reason): POST /v2/documents/{id}/approve from their workspace, or POST /v2/client/session/decision from the component. The author sees the approvers' changes: what changed since it went out, and who changed it.

Once every approving step is done, the draft is marked approved (approved_revision). If the signers are named and it is ready, it goes on to them at once; with no signers it comes back to the author approved. That is how a text is approved before anyone decides who signs it, and how a template's draft is approved before its version is published. If the text changes after approval, the next sending goes to the approvers again. An agent cannot approve: the Monoclan window opens the person's own turn, and the choice is theirs.

While it is a draft, anyone in the discussion comments (POST …/comments with block and an exact quote, or a reply in thread) and suggests edits (POST …/suggestions). The sender's side accepts a suggestion (it becomes a new version) or rejects it. GET /v2/documents/{id}/review returns the threads and suggestions, including what approvers wrote when they returned it. Agents comment and suggest (add_comment, suggest_edit) and lay out the workflow (find_people, set_workflow), but never approve or sign for a person.

Negotiation with the other side

When the text has to be agreed with the other side of the contract, open a negotiation on the draft. The agreed text is the document itself; each side changes its own view of it, and every changed paragraph or table becomes a point the other side decides on. Sides move in turns: on your move you decide on each of their points — accept (it goes into the agreed text as a new version), reject, or counter (reject and propose your own wording of that place) — add your own changes and pass the turn. Both sides agreeing to the same version closes it, and the document can go out for signature.

In the app a negotiation opens full screen from the «Negotiation» button on the draft's page. At the top it says whose move it is and what to do next, with the four steps: you edit the text, pass the move, decide on the other side's points, both sides agree the text. Below is the link for the other side with «Copy the link»: when letters do not go out (mail is not set up, or no address for the other side), send the link yourself. The other side works by the link, with no account, on the same screen.

  • POST /v2/documents/{id}/negotiation { name, company?, email?, message? } — opens it on the draft as it is and returns link for the other side (…/n/ng_…). The first move is theirs. With email they get a letter with the link, and another each time the move passes to them.
  • GET /v2/documents/{id}/negotiation?words=true&from=1 — whose move it is, the points of both sides (yours including drafts not sent), what the other side answered on its last turn (since_your_turn), and with from your view of the text as blocks with ids.
  • POST …/negotiation/edits { operations, reason? } — the same operations a draft is edited with (replace_text, replace, insert_after, insert_before, append, delete), on your view. Each changed paragraph becomes a draft point; an edit that undoes another removes it. A point you make at the place of their point answers it (answers).
  • POST …/negotiation/proposals/{proposal}/decision { decision: "accept" | "reject" | "counter", note? }; DELETE …/negotiation/proposals/{proposal} takes back a draft.
  • POST …/negotiation/pass { message? } — sends your drafts and gives the move. Every point of theirs must be decided first.
  • POST …/negotiation/agree — you agree to the text as it is (nothing of theirs waiting, no drafts of yours). POST …/negotiation/stop — the owner ends it; the text stays as agreed so far.
  • GET …/negotiation/word — your view as a Word file, each paragraph marked; edit it in Word (plainly or with tracked changes) and send it back with POST …/negotiation/word (the .docx as the body, or { "base64": "…" }): what it changes becomes your drafts.
  • GET …/negotiation/protocol — the protocol of disagreements: a Word table of every point, each side's wording, the reason and the outcome.

While a negotiation is open the text changes only through it: an ordinary edit is refused with negotiation_open. The points keep Word formatting, fields and conditions: an accepted point carries the paragraph as it was written, not only its words.

The other side works through the link: in a browser, or with its own agent. The same calls live under /v2/client/negotiation with Authorization: Bearer ng_… (the secret from the link), and the page …/n/ng_….md tells an agent where things stand and what to call. In the app the owner opens it from the draft (Negotiate with the other side).

Events: negotiation.started, negotiation.turn, negotiation.agreed, negotiation.stopped, proposal.decided. The owner's agent is told when the move comes back to them and when the text is agreed.

Conditional clauses

A block can show only when field values say so. In Markdown:

{{#if payment = installments}}
## Installments
The buyer pays in {{Months:number}} parts.
{{/if}}

Or on existing blocks: { "op": "set_condition", "blocks": ["p12"], "condition": "payment = installments" }. Conditions read field keys: =, !=, in [a, b], >, <, a key alone (filled), !key (empty), joined by and or or. A block may be a paragraph inside a table cell too (requisites or a signature cell with a variant per kind of party): read_document and content?format=blocks list a cell's paragraphs with their ids and conditions. The preview, the signing page, the signed text and its PDF leave hidden blocks out, inside tables as well, and fields that stand only in hidden blocks are not asked for. A decision field need not stand in the text: define it by key with fields on PATCH /v2/documents/{id}.

In the editor each condition has a bar on the left and an «If …» label: green means the text is in the document with the field values as they are now, red means it is not (that text is also paler), grey means not known yet: the condition reads a field that is not filled in (a template, or a field another party fills in). An unticked checkbox counts as «no». The label's tooltip says the same in words. The Conditions panel (click a label) shows, for each condition, the fields it reads and their values now. While a condition is open, every place in the text it governs is highlighted; «Show in the text» steps through them. A field that stands in the text opens with «Show the field»; a field outside the text that you fill in can be set right in the panel, and the colours change at once; it carries the same number as in your list of fields on the left; a field a participant fills in says who. «Remove condition» drops the condition and keeps the text in the document always.

Page setup

Paper size, orientation and margins: { "op": "set_page", "page": { "pageWidth": 11906, "pageHeight": 16838, "orientation": "landscape", "margins": { "left": 1701 } } } (twips: 1440 per inch, 567 per cm), or the editor's Page menu. The Word file keeps everything else.

Editing together

Everyone with an editing session on one draft edits it together, live, with each other's cursors and names. One of them saves for everyone, so versions, review and conditions work as usual; an edit from outside (an agent, a restored version) brings everyone to the new text.