API for developers

Send contracts for signature straight from your CRM: the file and signers in one request, status and the signed PDF via the API, events via webhooks.

Your first document in 5 minutes

  1. The company owner creates a key: account → “API & webhooks”. Start with a sandbox key.
  2. Send a PDF or DOCX and the signers in one request with send: true.
  3. In the sandbox the response has a signingUrl — open it and sign with code 000000.
  4. Receive the sign.envelope.signed webhook and download the signed PDF.
curl https://api.dokumo.global-travel.by/v1/sign/envelopes \
  -H "Authorization: Bearer dk_test_…" \
  -H "Idempotency-Key: crm-deal-1042" \
  -F "file=@contract.pdf" \
  -F 'data={"title":"Договор № 1042","externalId":"1042",
    "recipients":[{"fullName":"Анна Сидорова","phone":"+375291234567"}],
    "send":true};type=application/json'

Pages and signers are numbered from 1 in the API. Coordinates are PDF points from the top-left corner of the page.

Signature places as tags in the document

Don't want to compute coordinates? Put tags right into the contract text. If the request has no fields, Dokumo finds the tags itself. The number after the colon is the signer number.

{{signature}}  {{signature:2}}  {{initials}}  {{date}}  {{name:2}}  {{checkbox}}  {{checkbox?}}

Russian tags work too: {{подпись}}, {{инициалы}}, {{дата}}, {{фио}}, {{галочка}}. Making the tag white text is handy.

Status and the signed PDF

An envelope goes DRAFT → SENT → OPENED → VERIFIED → PARTIALLY_SIGNED → SIGNED; a refusal is DECLINED. Each signer has their own status. The signed PDF with the audit trail and PAdES seal is ready when assembly = READY.

curl https://api.dokumo.global-travel.by/v1/sign/envelopes/{id} \
  -H "Authorization: Bearer dk_test_…"

curl https://api.dokumo.global-travel.by/v1/sign/envelopes/{id}/signed \
  -H "Authorization: Bearer dk_test_…" -o signed.pdf

Templates

Make a template in the account: the document, roles, fields and values filled in on creation. Via the API you pass only the signers and values.

curl https://api.dokumo.global-travel.by/v1/sign/templates/{id}/envelopes \
  -H "Authorization: Bearer dk_live_…" -H "Content-Type: application/json" \
  -H "Idempotency-Key: crm-deal-1043" \
  -d '{"recipients":[{"fullName":"Иван Петров","email":"ivan@mail.by"}],
       "values":{"contract_no":"1043"},"send":true}'

Webhooks

Set the URL in the account. The body is signed: Dokumo-Signature: t=…,v1=… — HMAC-SHA256 of “t.body” with your secret. Reply 2xx; otherwise we retry after 1 min, 5 min, 30 min, 2 h, 6 h and 12 h.

  • sign.envelope.sent — sent
  • sign.recipient.signed — one of the signers signed
  • sign.envelope.signed — signed by everyone, PDF ready
  • sign.envelope.declined — declined
  • sign.envelope.expired — expired
  • sign.envelope.cancelled — cancelled
  • ping — test from the account
{
  "id": "4b0c…", "type": "sign.envelope.signed", "createdAt": "2026-11-29T10:15:00Z", "test": false,
  "data": { "envelopeId": "9f1e…", "number": "1042", "status": "SIGNED", "externalId": "1042",
            "signedSha256": "a3f…", "signedAt": "2026-11-29T10:14:58Z" }
}
import crypto from 'node:crypto';

// header = req.headers['dokumo-signature'], body — сырое тело запроса (строка)
export function verify(header, body, secret) {
  const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
  const age = Math.abs(Date.now() / 1000 - Number(parts.t));
  const expected = crypto.createHmac('sha256', secret).update(`${parts.t}.${body}`).digest('hex');
  return age < 300 && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}
$parts = [];
foreach (explode(',', $_SERVER['HTTP_DOKUMO_SIGNATURE']) as $p) {
  [$k, $v] = explode('=', $p, 2); $parts[$k] = $v;
}
$body = file_get_contents('php://input');
$expected = hash_hmac('sha256', $parts['t'] . '.' . $body, $secret);
$ok = abs(time() - (int) $parts['t']) < 300 && hash_equals($expected, $parts['v1']);

Limits and errors

  • 120 requests a minute per key; above that — 429 and a Retry-After header.
  • Errors are JSON {"code", "params"}: VALIDATION, INVALID_PHONE, PLAN_LIMIT_REACHED, SUBSCRIPTION_EXPIRED and more — the full list is in the spec.
  • An Idempotency-Key is kept for 24 hours; the same key with a different request — 422 IDEMPOTENCY_KEY_REUSED.
  • A live key works on a plan with API; the sandbox always works.

Sandbox

  • No subscription, documents aren't counted.
  • No SMS or emails are sent, the code is 000000.
  • The response contains the signingUrl.
  • The final PDF has a “TEST” watermark and no legal effect.
  • Sandbox and live keys don't see each other's envelopes.