API keys
You can automate Imprime in two ways, both covered in this section:
- the REST API, to generate PDFs from your code, one PDF per request;
- the MCP server, to let AI agents list and fill your templates, and also create and edit them.
Both authenticate scripts and agents with an API key. Interactive AI clients such as Claude can sign in with OAuth instead, with no key to copy.
An API key acts as you, on your templates only. On the REST API it lists, reads, exports and previews them; through MCP, it can also create and edit them. Use one key per integration, so that you can revoke them independently.
Creating a key
Section titled “Creating a key”- Click your avatar (top right) → API Keys.
- Click New key, give it a name you’ll recognize later (
Billing service,Claude Code,Laptop CLI) and click Create. - Copy the key now. It’s displayed only once, and after you close it the list only shows its first characters.
Using a key
Section titled “Using a key”Send it in the x-api-key header:
curl https://app.imprime.io/api/templates -H "x-api-key: $IMPRIME_API_KEY"The same key works for the REST API and for MCP clients such as Claude Code.
Revoking a key
Section titled “Revoking a key”In API Keys, click the trash icon next to the key and confirm. Any program still using it
immediately gets 401 Unauthenticated.
A key also stops working while its owner is shut out of the instance, for example by the administrator’s allowed domains on a self-hosted instance. And when an account’s email address gets verified, the keys created before are revoked, because until then someone else could have been using the account.