Skip to the content

Developers

SDKs

Typed clients for JavaScript and TypeScript, and for Python, generated from the same OpenAPI file as the API.

The clients are written and tested against the sandbox. They are not yet published to the npm or PyPI registries, so today you install them from the files in the documentation. When they are published this page will give the install lines.

Because they are generated from the OpenAPI file, a new operation appears in the clients when the file changes, and the clients cannot drift from the API.

Use the API directly

Everything the SDKs do is one request away.

The Developer settings screen with API keys and webhook endpoints
The Developer settings screen with API keys and webhook endpoints

What the clients do for you

Both clients cover every operation in the API reference. They add an Idempotency-Key to every write and reuse it on retries, retry 429 and 5xx responses and honour Retry-After, throw a typed error with the status, kind and request id, page through lists for you, and verify webhooks.

Requirements

The JavaScript and TypeScript client, @docustay/sdk, needs Node 18 or newer, a browser, Deno or Bun, and has no dependencies. The Python client, docustay, needs Python 3.9 or newer and uses only the standard library.

Using them from other languages

Any language can call the REST API. The OpenAPI 3.1 file at /api/openapi.json can feed a code generator for Go, Java, Ruby or PHP, and the Postman collection lets you try each call by hand.

What the clients do for you

Both clients wrap the same REST API the documentation describes, so anything you can do in a request you can do in a method call. They set the Authorization header from the key you give them, send an Idempotency-Key on every write so a retry never acts twice, and turn an error answer into an error your language can catch, with the kind, the message and the request id still attached.

Where to start

Create a key in Settings under Developers, turn on test mode, and send a document to yourself. Nothing leaves your own address in test mode, every page is stamped TEST and nothing is counted or billed, so you can rehearse the whole flow, including the webhook that tells your system the document is done.

When not to use a client

If you work in another language, or in a place where adding a package is a burden, call the REST API directly. It is a plain JSON API with bearer keys, and the OpenAPI file in the documentation can generate a client for almost any language.

Send a document with the JavaScript client

import { Docustay } from "@docustay/sdk";
const docustay = new Docustay(process.env.DOCUSTAY_KEY);
const doc = await docustay.sendDocument({ templateId: "TEMPLATE_ID", parties: [{ seat: "signer_1", name: "Rosa Alvarez", email: "rosa@example.com" }] });

Keep reading