Firma lets you add legally binding e-signatures to any Databutton application. Use Databutton’s built-in Python backend to call the Firma REST API, manage templates, send signing requests, and track completions via webhooks. This guide walks through the full flow: storing your API key, sending a signing request, wiring it to your React UI, and handling completion events.Documentation Index
Fetch the complete documentation index at: https://docs.firma.dev/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- A Firma account with an API key
- A Databutton account (free trial works for development; paid plans for production)
- At least one Firma template with signing fields configured
Firma uses the raw API key as the
Authorization header value - do not prefix it with Bearer. This differs from many other APIs.Step 1: Store your API key as a secret
Databutton manages secrets through a dedicated panel in the editor. Values are injected as environment variables into your backend functions at runtime.- Open your app in the Databutton editor
- Click Secrets in the sidebar
- Click Add Secret
- Set the name to
FIRMA_API_KEYand paste your Firma API key - Save
os.environ["FIRMA_API_KEY"] in any backend function.
Step 2: Create a backend function to send signing requests
In Databutton, backend functions are Python FastAPI endpoints. Create a new HTTP API endpoint that calls the Firmacreate-and-send endpoint:
The
create-and-send endpoint creates the signing request and sends it to recipients atomically. If you need to review or modify the request before sending, use POST /signing-requests to create a draft, then POST /signing-requests/{id}/send separately.Step 3: Call the backend from your React UI
Databutton apps use React for the frontend. Call your backend endpoint when the user submits the form:Webhook integration
To track when documents are signed, add a webhook backend endpoint and register it in the Firma dashboard.- Deploy your Databutton app so the endpoint is publicly reachable
- In the Firma dashboard under Settings → Webhooks, add a webhook pointing to
https://<your-app-domain>/api/webhooks/firma - Select the events you want to receive. See the webhooks guide for all event types and signature verification
Embedded signing
For apps where signers complete documents inside your UI instead of jumping to email, Firma provides an embeddable signing experience. Thecreate-and-send response includes a first_signer.id (the signing_request_user_id) and a ready-made first_signer.signing_link. Render it in an iframe:
Bonus: MCP connection for AI-assisted building
Firma offers a Docs MCP server that Databutton’s AI chat can use as context. When connected, the AI references Firma documentation while generating code so it uses accurate endpoints, field names, and patterns. This is a build-time aid and does not affect your deployed app.Next steps
- API authentication - API keys and workspace scoping
- Webhooks guide - event types, payloads, and signature verification
- Embedded signing - in-app signing experience
- Creating workspaces - multi-tenant setups for SaaS apps
- Complete setup guide - end-to-end Firma integration walkthrough
- API reference - full endpoint documentation