Authentication

The Paperarchive API uses Bearer token authentication with API keys. Every request must include your API key in the Authorization header.

Creating an API Key

Create and manage API keys in the Paperarchive app at Settings > API Keys. Each key can be scoped to specific permissions and spaces.

Using Your API Key

Include the key in the Authorization header as a Bearer token:

Authorization: Bearer pa_live_abc123def456...

Key Format

API keys use the prefix pa_live_ followed by a random string. The full key is only shown once at creation time - store it securely.

Scopes

Each API key is assigned scopes that control what it can access. Available scopes:

ScopeDescription
documents:readList and retrieve documents
documents:writeCreate and delete documents
searchSearch across documents
spaces:readList and retrieve spaces
categories:readList categories
categories:writeCreate and delete categories
tags:readList tags
tags:writeCreate and delete tags
senders:readList senders
senders:writeCreate and delete senders

Space Restrictions

API keys can optionally be restricted to specific spaces. When restricted, the key can only access documents, categories, tags, and senders within those spaces.

Security Best Practices

  • Use the minimum scopes needed for your integration
  • Restrict keys to specific spaces when possible
  • Rotate keys periodically
  • Never expose keys in client-side code or public repositories
  • Revoke compromised keys immediately