API

Met de API van SignTuesday laat je contracten tekenen vanuit je eigen software. Een envelop maken is gratis en levert altijd een concept op. Versturen is een aparte aanroep.

Snelstart in vijf minuten

  1. Maak een testsleutel op de pagina Claude en API in de app. Een testsleutel begint met st_test_ en verstuurt nooit echt iets.
  2. Maak een concept met een document en een ondertekenaar. De handtekeningvelden komen vanzelf onderaan.
  3. Verstuur het concept. Met een testsleutel krijgt niemand mail en telt het niet mee voor je limiet.
  4. Vraag de status op. Is alles getekend, dan download je het bewijsrapport en het getekende document.

Voorbeelden

curl

curl https://signtuesday.com/api/v1/envelopes \
  -H "Authorization: Bearer $SIGN_TUESDAY_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: nda-acme-1" \
  -d '{"title": "NDA Acme", "document": {"text": "# Geheimhouding\nPartijen houden alles geheim."},
       "signers": [{"name": "Sanne de Vries", "email": "sanne@voorbeeld.nl"}]}'

curl -X POST https://signtuesday.com/api/v1/envelopes/env_.../send -H "Authorization: Bearer $SIGN_TUESDAY_KEY" -d '{}'

JavaScript

const api = (path, body) =>
  fetch("https://signtuesday.com/api/v1" + path, {
    method: body ? "POST" : "GET",
    headers: { Authorization: `Bearer ${process.env.SIGN_TUESDAY_KEY}`, "Content-Type": "application/json" },
    body: body && JSON.stringify(body),
  }).then((response) => response.json());

const envelope = await api("/envelopes", {
  title: "NDA Acme",
  document: { file_name: "nda.pdf", content_base64: fs.readFileSync("nda.pdf").toString("base64") },
  signers: [{ name: "Sanne de Vries", email: "sanne@voorbeeld.nl" }],
});
await api(`/envelopes/${envelope.id}/send`, {});

Python

import base64, os, requests

api = requests.Session()
api.headers["Authorization"] = f"Bearer {os.environ['SIGN_TUESDAY_KEY']}"

with open("nda.pdf", "rb") as f:
    pdf = base64.b64encode(f.read()).decode()
envelope = api.post("https://signtuesday.com/api/v1/envelopes", json={
    "title": "NDA Acme",
    "document": {"file_name": "nda.pdf", "content_base64": pdf},
    "signers": [{"name": "Sanne de Vries", "email": "sanne@voorbeeld.nl"}],
}).json()
api.post(f"https://signtuesday.com/api/v1/envelopes/{envelope['id']}/send", json={})

Goed om te weten

  • Sleutels: st_test_… voor testen, st_live_… voor echt. Je ziet een sleutel één keer.
  • ID's hebben een voorvoegsel: env_ voor enveloppen, doc_ voor documenten en rcp_ voor ondertekenaars.
  • Fouten komen terug als {"error": {"code", "message", "field"}}, met een HTTP-status die erbij past.
  • Hooguit 120 aanroepen per minuut per sleutel. Daarboven krijg je 429 met de header Retry-After.
  • Stuur bij POST een header Idempotency-Key mee. Doe je dezelfde aanroep twee keer, dan krijg je hetzelfde antwoord en gebeurt er niets dubbel.

Alle endpoints

De volledige OpenAPI-specificatie wordt uit de code gemaakt en loopt dus nooit achter.

OpenAPI-specificatie (JSON)

Alle endpoints
MethodePadWat het doet
GET/envelopesList envelopes (filters: status, category, q)
POST/envelopesCreate a draft envelope, optionally with a document and signers
GET/envelopes/{envelope_id}Get an envelope with its documents and recipients
POST/envelopes/{envelope_id}/documentsAdd a PDF or Word document to a draft
POST/envelopes/{envelope_id}/recipientsAdd a signer, approver or cc to a draft
DELETE/envelopes/{envelope_id}/recipients/{recipient_id}Remove a recipient from a draft
PUT/envelopes/{envelope_id}/fieldsReplace all fields of a draft, or place them automatically with {"auto": true}
POST/envelopes/{envelope_id}/sendSend a draft. With a test key nothing is mailed and nothing counts towards your limit
POST/envelopes/{envelope_id}/remindRemind everyone who has not signed yet
POST/envelopes/{envelope_id}/voidVoid an envelope; signers get the reason
GET/envelopes/{envelope_id}/auditThe audit trail of an envelope
GET/envelopes/{envelope_id}/files/{file}Download the evidence report (file = report) or a signed document (file = doc_…), once completed

Elke dag kan tekendag zijn.