Learn how to authenticate API requests with API keys and use JWT tokens for embedded template and signing request editors
The Firma API uses two authentication methods: API key authentication for server-to-server requests, and JWT tokens for embedding the template and signing request editors in your application.
Your API key authenticates your requests and determines which workspace resources you can access. Each workspace has its own unique API key that you can retrieve via the Get Workspace endpoint.Protected Workspace: Every company account has one protected workspace that cannot be deleted. This protected workspace holds the main API key for your account, which has access to all workspace, API key, company/account, and webhook endpoints. Use this key for account-wide operations or when you need to manage multiple workspaces.
You can regenerate API keys for non-protected workspaces to enhance security. When you regenerate a key:
A new API key is created immediately and returned in the response
Old keys are set to expire in 24 hours - they continue working during this grace period
You can manually expire old keys early once you’ve verified the new key works
Protected workspace keys cannot be regenerated via the API. This prevents accidental lockouts from your account. Contact support if you need to rotate your protected workspace key.
Update your application configuration with the new key
Test that the new key works correctly
Call the expire endpoint to immediately invalidate old keys
Monitor for any errors indicating services still using the old key
Never expose your API key in frontend code or client-side applications. API keys should only be used in secure backend services. Always store them as environment variables.
JWT (JSON Web Token) tokens enable you to embed Firma’s template editor and signing request editor directly in your application. These tokens are RSA-256 signed and time-limited for security.
Embed the template editor in your application for users to create/edit document templates
Embed the signing request editor for users to customize documents before sending
Provide secure, time-limited access to specific templates or signing requests
Control which resources users can access without exposing your API key
JWT tokens should always be generated from your secure backend, never from frontend code. Your backend uses the API key to generate tokens, which are then passed to the frontend for editor initialization.