sign.ytDocs

SDKs

Python SDK

signyt is a typed client for Python 3.10+, built on httpx and pydantic v2, with matching sync and async APIs.

Install#

pip install signyt

Create a client#

import os
from signyt import Signyt

with Signyt(os.environ["SIGNYT_API_KEY"]) as client:
    print([d.title for d in client.documents.list(limit=10)])
OptionDefaultDescription
api_keyrequiredAn sk_live_... key.
base_urlhttps://api.sign.yt/v1API base URL.
timeout30.0Seconds per request.
max_retries2Retries for GET/PUT/DELETE on 429, 5xx and network errors.
retry_backoff0.5Base backoff in seconds (exponential with jitter; Retry-After wins, capped at 60 s).
http_clientnoneBring your own httpx.Client (proxies, custom transport).

Async code uses AsyncSignyt with the same resources and await:

import asyncio
import os
from signyt import AsyncSignyt

async def main() -> None:
    async with AsyncSignyt(os.environ["SIGNYT_API_KEY"]) as client:
        doc = await client.documents.get(os.environ["DOC_ID"])
        print(doc.status)

asyncio.run(main())

Resources#

MethodEndpoint
documents.list(limit=50, offset=0)GET /documents
documents.get(id)GET /documents/{id}
documents.create(pdf, title, recipients, *, signing_order, verification_type, metadata, expires_at, allow_delegation, team_id, folder_id, filename)POST /documents; pdf is bytes, a path or a binary file object
documents.set_fields(id, fields)PUT /documents/{id}/fields
documents.detect_fields(id)POST /documents/{id}/detect-fields
documents.update_recipient(id, recipient_id, ...)PATCH /documents/{id}/recipients/{recipient_id}
documents.resend(id, recipient_id)POST /documents/{id}/recipients/{recipient_id}/resend
documents.send(id)POST /documents/{id}/send
documents.cancel(id, reason, copy_as_draft=False)POST /documents/{id}/cancel
documents.remind(id)POST /documents/{id}/remind
documents.delete(id), documents.restore(id)DELETE /documents/{id}, POST /documents/{id}/restore
documents.download_signed_pdf(id), documents.download_original_pdf(id)Return bytes
documents.audit(id)GET /documents/{id}/audit
templates.list(), templates.create(pdf, name, description, category), templates.use(id, title, recipients), templates.delete(id)/templates
webhooks.list(), webhooks.create(url, events), webhooks.update(id, *, url, events, active), webhooks.delete(id)/webhooks

Responses are pydantic models from signyt.models; request helpers RecipientInput and FieldInput are exported too (plain dicts work as well). Endpoints without a method (flows, template public links, webhook deliveries, signing links, evidence downloads, cursor pagination) can be called with any HTTP client; see the guides for examples.

End-to-end example#

import os
from signyt import Signyt

with Signyt(os.environ["SIGNYT_API_KEY"]) as client:
    doc = client.documents.create(
        "contract.pdf",
        title="Service agreement",
        recipients=[{"email": "[email protected]", "name": "Anna Nowak"}],
        verification_type="EMAIL_OTP",
        metadata={"crm_deal_id": "D-1042"},
    )
    client.documents.set_fields(doc.id, [{
        "type": "SIGNATURE", "page": 1, "position_x": 15, "position_y": 80,
        "width": 25, "height": 8, "recipient_id": doc.recipients[0].id,
    }])
    client.documents.send(doc.id)
    print("sent", doc.id)

Errors#

Non-2xx responses raise a subclass of SignytError with status, code, message, extra and request_id:

ExceptionStatus
BadRequestError400, 413, 422
AuthenticationError401
PaymentRequiredError402
PermissionDeniedError403
NotFoundError404
ConflictError409
RateLimitError429 (with retry_after)
ServerError5xx
APIConnectionErrorNetwork failure or timeout
import os
from signyt import ConflictError, Signyt, SignytError

client = Signyt(os.environ["SIGNYT_API_KEY"])
try:
    client.documents.remind(os.environ["DOC_ID"])
except ConflictError as e:
    if e.code == "document_not_pending":
        print("nothing to remind: the document is not pending")
except SignytError as e:
    print(e.status, e.code, e.message, e.request_id)

Verify webhooks#

import os
from signyt import SignatureVerificationError
from signyt.webhooks import construct_event

def handle(raw_body: bytes, headers: dict[str, str]) -> int:
    try:
        event = construct_event(raw_body, headers, os.environ["SIGNYT_WEBHOOK_SECRET"])
    except SignatureVerificationError:
        return 400
    if event["event"] == "document.completed":
        print("completed:", event["data"]["id"])
    return 204

construct_event verifies X-Signyt-Signature against X-Signyt-Timestamp and the raw body, enforces a 5-minute window (tolerance=300) and returns the parsed envelope. See Webhooks.