Discovery API3
Check an XDocs API key before you build on it: the scopes it holds, the workspace and plan it acts for, the rate limit, and the OpenAPI 3.1 spec for a client.
Discovery referenceAPI reference
Write a document, send it for legally binding signature, publish a tracked link behind whatever gates the deal needs, and read back who read which paragraph and for how long. One REST API, 135 endpoints, scoped keys, signed webhooks.
Create a key under Settings → Developer, choosing the scopes it needs. It is shown once. Then check it, and write something.
curl "https://xdocs.io/api/v1/me" \ -H "Authorization: Bearer $XDOCS_API_KEY"
# 1. Write it, with the people who will sign
curl -X POST "https://xdocs.io/api/v1/documents" \
-H "Authorization: Bearer $XDOCS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Consulting agreement",
"markdown": "# Consulting agreement\n\nThe parties agree…",
"recipients": [{ "name": "Dana Reyes", "email": "dana@example.com" }]
}'
# 2. Give each signer somewhere to sign. Markdown has no fields in it,
# and an envelope refuses a recipient with nothing to complete.
# (Starting from a template instead? It already has them — skip this.)
curl -X POST "https://xdocs.io/api/v1/documents/doc_…/signature-blocks" \
-H "Authorization: Bearer $XDOCS_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "heading": "Consultant" }'
# 3. Send it — recipients and fields come from the document
curl -X POST "https://xdocs.io/api/v1/envelopes" \
-H "Authorization: Bearer $XDOCS_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "documentId": "doc_…", "sequential": false }'curl -X POST "https://xdocs.io/api/v1/links" \
-H "Authorization: Bearer $XDOCS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"documentId": "doc_…",
"name": "Acme — Series B",
"requireEmailVerification": true,
"requireNda": true,
"watermark": true,
"expiresAt": "2026-12-31T23:59:59Z"
}'curl "https://xdocs.io/api/v1/views?documentId=doc_…&limit=20" \ -H "Authorization: Bearer $XDOCS_API_KEY" # Per-section attention for one document curl "https://xdocs.io/api/v1/analytics/documents/doc_…" \ -H "Authorization: Bearer $XDOCS_API_KEY"
Authorization: Bearer xdk_… on every request. Only a hash of the key is stored, so a lost key is replaced rather than recovered. A key can carry an expiry, and can be revoked at any time.
A key holds only what it needs. A reporting integration can be given one that cannot send anything; a CRM writeback can publish links without being able to read every visit. A call outside a key’s scopes answers 403 naming the scope it wanted.
Lists take ?limit= (max 100) and ?cursor=, and return nextCursor. Cursors are keyset rather than offset, because a list of visits moves under you while you page through it — offsets skip and repeat, keysets do not. Treat the value as opaque.
A filter value that is not recognised answers 400, naming what was expected. A mistyped ?status= would otherwise come back as an empty page, and a ?active=yes as an unfiltered one — neither distinguishable from a true answer.
120 requests a minute per key, counted in the database so every instance sees the same total. Every reply carries x-ratelimit-limit, x-ratelimit-remaining and x-ratelimit-reset (Unix seconds); a 429 carries retry-after.
One resource comes back as { data }, a list as { data, nextCursor }, a failure as { error }. Timestamps are ISO 8601 in UTC and durations are milliseconds. Deletes answer 204 with no body.
A signing token, a link password, an assignee’s upload token or a storage URL — each is a capability, and handing one to a caller would hand over the thing it protects. Files are streamed through the API instead, and a password is reported as hasPassword.
details with the exact fields.retry-after says how long to wait.requestId, as every reply's x-request-id header does — quote it when you report the problem, and it finds the exact request in our logs.Base URL https://xdocs.io/api/v1. Every path below is relative to it. Each resource has its own page with every parameter, response and refusal in full.
Check an XDocs API key before you build on it: the scopes it holds, the workspace and plan it acts for, the rate limit, and the OpenAPI 3.1 spec for a client.
Discovery referenceCreate documents from Markdown or HTML, upload PDFs, edit spreadsheet rows, columns and sheets, add signature blocks and export files with the Documents API.
Save an agreement once with its signer roles and fields, then make a ready-to-send document from it for each deal. Templates in the XDocs e-signature API.
Templates referenceSend a document for legally binding e-signature by API: create an envelope, remind or reassign signers, void it, and download the signed PDF and certificate.
Publish tracked links to documents and data rooms by API, with passwords, email verification, NDAs, watermarks, expiry and download controls set per link.
Create virtual data rooms by API: file documents into folders, set viewer groups with per-file permissions, freeze it at closing and share it by link.
Write confidentiality terms once and require them on any share link by API. Readers accept the NDA before the document opens, and each acceptance is recorded.
Agreements referenceRead who opened a shared document and how long they spent on each section. Visits, visitors, section-level reading time and a CSV export, from the XDocs API.
Views and visitors referencePull document engagement analytics by API: visits, readers and completion across the workspace, and the attention profile of one document section by section.
Analytics referenceList the people a share link turned away and approve or deny them by API: readers outside a link's allow-list, domains or viewer group, waiting on you.
Access requests referenceRead the questions people ask from inside a shared document or data room, and answer them by API. Each answer is emailed back to the reader who asked it.
Viewer questions referenceAsk named people for named documents by API. Each assignee gets their own upload link and reminders, and each file that arrives is filed as a document.
Subscribe to XDocs webhooks for recipient signed, envelope completed and link viewed events. HMAC-SHA256 signed deliveries, retries and a delivery log.
Place legal holds and set document retention rules by API. Nothing a hold covers can be trashed or deleted, in the app or the API, until it is released.
Read the XDocs audit trail by API: every signing, sharing and document event, with who did it, to what and from where. Filter by type and page through it.
Audit log referenceRather than polling, subscribe a URL and hear about things as they happen. Each delivery is a POST of { id, event, createdAt, data } carrying x-xdocs-event, x-xdocs-event-id, x-xdocs-timestamp and x-xdocs-signature, a hex HMAC-SHA256 of {timestamp}.{body} using the secret returned when you subscribe. Verify the raw body before parsing it. Answer with any 2xx within eight seconds. A delivery is tried up to three times with a short backoff — a 4xx other than 429 is taken as a refusal and not retried — and an endpoint that fails 10 deliveries in a row is switched off with its log kept.
curl -X POST "https://xdocs.io/api/v1/hooks" \
-H "Authorization: Bearer $XDOCS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/hooks/xdocs",
"events": ["link.viewed", "envelope.completed"]
}'import { createHmac, timingSafeEqual } from "node:crypto";
const timestamp = req.headers["x-xdocs-timestamp"];
const signature = req.headers["x-xdocs-signature"];
const expected = createHmac("sha256", process.env.XDOCS_WEBHOOK_SECRET)
.update(`${timestamp}.${rawBody}`)
.digest("hex");
const ok =
signature.length === expected.length &&
timingSafeEqual(Buffer.from(signature), Buffer.from(expected));For AI agents
All 135 endpoints, the authentication, the pagination and the rules that are not expressible in a schema — as one block of text to paste, a URL to fetch, a spec to generate a client from, or a tool server your agent can call directly.
Roughly what a model needs and nothing it does not: the base URL, the header, the scopes, the pagination, and every endpoint with its parameters. Paste it into a system prompt or a context file.
Loading the reference…
There is also a command line — npx xdocs documents list — and a Zapier app, both thin clients over exactly these endpoints. Anything they can do, curl can do.