Basics for Tvarka Sign and Tvarka Proof

Version 1.30.0

Tvarka Sign and Tvarka Proof work the same way. One API key opens both. Paid requests are charged to the same prepaid balance.

Your first request

Create an API key in your workspace. Send it as a bearer token. A key that starts with tsk_test_ works in the sandbox.

BASE=https://sign-api.tvarka.eu
# TVARKA_KEY holds your API key.
curl -sS "$BASE/v1/me" \
  -H "Authorization: Bearer $TVARKA_KEY"

Your API key

Sign in to the Sign app at tvarka.eu, open Settings and click Show or Copy beside API key. Every active member of your business with Sign access has a key. It is prepared on first use and reused on later visits.

Send Authorization: Bearer <key> or X-Api-Key: <key> for REST and MCP. tsk_live_ selects production; tsk_test_ selects sandbox. The key acts as the named member in one business workspace. Keep it in your application's secret store.

Manage access, under Settings, revokes or replaces a key and changes the webhook secret. Removing a member from the business revokes their API access.

Verify webhooks before trusting them

Set a public HTTPS webhookUrl when creating a signing. Verify X-Tvarka-Signature-V2 against the raw body with your integration's webhook secret. V2 authenticates the attempt timestamp as well as the body. The older X-Tvarka-Signature is a body-only HMAC retained for existing consumers.

import hashlib
import hmac
import time


def verify_tvarka_webhook(raw_body: bytes, signature_v2: str, secret: str) -> bool:
    # Call before parsing JSON. Pass the exact request bytes and the integration's
    # webhook secret, not its API key. Keep the server clock synchronized.
    try:
        fields = dict(part.split('=', 1) for part in signature_v2.split(','))
        timestamp = fields['t']
        if abs(time.time() - int(timestamp)) > 300:
            return False
        expected = hmac.new(secret.encode('utf-8'),
                            timestamp.encode('ascii') + b'.' + raw_body,
                            hashlib.sha256).hexdigest()
        return hmac.compare_digest(expected, fields['v1'])
    except (ValueError, KeyError, UnicodeError):
        return False

After verification, parse the JSON and check the signing ID against your own records. Process each event once: use an atomic durable record keyed by the authenticated payload's signing/signature ID, event type and optional signer ID; the supplied X-Tvarka-Idempotency-Key is also stable across retries. Acknowledge with 2xx after durable acceptance, then process asynchronously. Redeliveries may arrive, and polling remains available.

Webhook subscriptions

Automation platforms register their own callback URL: POST /v1/webhooks with url and events answers 201 with a Location header, and DELETE on that location turns it off. The subscription receives the chosen events of every signing this integration creates, signed with the same webhook secret. Each delivery carries eventId (the idempotency key), webhookId and the whole signing, without ceremony links. Answer 410 to remove a subscription from the receiving side. GET /v1/me tests a key and names its workspace; the key may also be sent as X-Api-Key.

Retries, redirects and credentials

Recent contract changes

Documents you can post

PDF, and for a qualified signature also appendable ASiC-E containers (.asice, .sce, .bdoc). A container is signed in place.

Since v1.9.0, Office files and images (.docx, .doc, .odt, .rtf, .xlsx, .xls, .ods, .pptx, .odp, .txt, .jpg, .jpeg, .png) are converted to PDF/A-2b before signing, including file uploads and URL intake. The resulting PDF is signed; the original is not retained. POST /v1/conversions returns just the PDF, without storing or signing it. Conversion has no additional charge and uses Tvarka's conversion service. An unreadable file returns 422; unavailable conversion returns 503.

Instead of one finished file you can send container and have several PDFs composed into a new ASiC-E package that is signed once: asice takes PDFs, first file is the main document, up to 20 files. document and container are mutually exclusive.

A PDF may set flatten: true to freeze its form fields into page content before signing. It fails closed: if any field has no appearance Tvarka can draw faithfully, nothing is flattened and the response names those fields, because a signed document that does not show what the signer approved is worse than a refused request. Flattening allows up to 1,000 pages, 5,000 widgets, 10,000 annotations and 10,000 field-tree nodes, with field depth up to 64. These limits are shared across a batch. A cooperative 20-second processing budget stops work between PDF operations; it cannot interrupt an individual parser or writer call. A refusal returns HTTP 400 with a flatten error pointer. Split the batch or flatten before upload.

Erasure

POST /v1/erasure erases terminal signings and headless signature files in pages. Set limit from 1 to 100 (default 20), and optionally before to an ISO datetime. While hasMore is true, pass nextCursor as the next request's cursor. The cursor keeps the same client and cutoff; omit before on continuation or keep its original value. A page finishes its current resource and returns after ten seconds of processing; an individual storage call still has its own timeout. failedResources identifies failures, which remain retryable. Finish the pages, then retry without a cursor to revisit failures. hasMore: false ends the traversal; it does not mean failures were erased. In-flight signings and pre-existing shared vault documents remain intact.

Errors

RFC 9457 problem documents, and request-body validation collects rather than failing fast: a body with three bad fields comes back once, as validation-failed, with an errors array of {"pointer": "/signers/0/email", "detail": "..."}. The pointer is an RFC 6901 JSON Pointer into what you sent, so a fault maps back to an input without parsing prose.

A temporary webhook-address lookup failure returns 503 callback-resolution-unavailable with Retry-After. Wait, then retry the same request with the same idempotency key. This refusal happens before resource creation. An ambiguous setup failure still requires reconciliation; keep its key and contact support.

Sandbox

A tsk_test_ key drives the whole lifecycle, including POST /v1/signings/{signingId}/simulate. A simulated completion returns a real downloadable file, so your download, hashing and storage code runs for real without a card in anyone's hand. The sandbox never adds a signature: an unsigned PDF comes back as your own pages with a banner saying it is not signed, and anything posted already signed comes back byte-identical, because those signatures are somebody else's and are not ours to disturb. Every artifact is flagged sandbox in the response, the webhook and an X-Tvarka-Sandbox header. Tvarka issues no test signatures.

Pricing

The API uses the same prices as the Sign app. Signatures are billed to your business. Pay for what you use. No subscriptions.

EUR each, excluding VAT
WhatPrice
Qualified signatureEUR 0.19
Qualified timestamp, or web page captureEUR 0.19
Web page capture from a chosen country, state, city or ZIP, per placeEUR 0.49
Cookie test: the page as opened, then after "reject all"EUR 0.99
Non-qualified timestampEUR 0.13

The qualified timestamp of a signature is included. From 1 000 qualified signatures a month the price is agreed individually, and an agreed tariff takes precedence. Sandbox is free. Before the first paid signing, the business adds 5.00 EUR to its balance by card in the Sign app. The whole amount stays its balance. Full pricing.

Next, pick a product

Questions: info@tvarka.eu