API reference

NDA and agreements API

An agreement is a set of confidentiality terms written once and picked by name on any link. Readers accept it before the document opens; editing the wording asks everybody who accepted the old version again, while their earlier acceptance is kept.

Base URL https://xdocs.io/api/v1, with Authorization: Bearer xdk_… on every request. Pagination, rate limits, scopes and error codes are the same for every endpoint and are described once, in how the API behaves.

Agreements

Confidentiality terms written once and picked by name on any link. Editing one re-asks everybody who accepted the old wording, while their record keeps the text they actually agreed to.

GET/api/v1/agreementslinks:read

The library, most recently edited first, with how much each one is used.

Returns

{ data: Agreement[] } — id, name, body, requireName, linkCount, acceptedCount, createdAt, updatedAt

GET/api/v1/agreements/:idlinks:read

One agreement with its usage counts.

Returns

{ data: Agreement }

POST/api/v1/agreementslinks:write

Write terms once; pick them by id on any link.

Body (JSON)

namestringrequired
1–120 characters. How it is picked on a link.
bodystringrequired
20–20,000 characters. The exact text a visitor is asked to accept.
requireNameboolean
Also ask the visitor to type their name. Defaults to false.

Returns

201 { data: Agreement }

PATCH/api/v1/agreements/:idlinks:write

Change the wording. New wording is a new agreement for everyone who accepted the old one.

Body (JSON)

namestring
1–120 characters. Renaming re-asks nobody.
bodystring
20–20,000 characters.
requireNameboolean

Returns

{ data: Agreement, regatedLinks: number } — regatedLinks is how many links now ask again, and is 0 unless the wording itself changed

DELETE/api/v1/agreements/:idlinks:write

Remove from the library. Links using it keep the gate, with the text copied onto them, so deleting never quietly opens a document; link presets that named it keep its words the same way.

Returns

204

← The whole API referenceNext: Views and visitors API →