Skip to content

API Tokens

API tokens let you access Papermerge functionality programmatically — through scripts, tools, or other applications. To give an external application access to Papermerge, you first need to provide it with an API token issued by Papermerge.

To create an API token:

  1. Click the user icon in the upper-right corner of the web interface.
  2. Select API Tokens, then click Create Token.
  3. Give the token a name (e.g. “Used by my script”) and choose how many days it should remain valid.

Once created, a Token Created dialog shows the token in clear text. Copy the token and store it somewhere secure.

To use an API token, add an Authorization header with the value Bearer <your token>. For example:

Authorization: Bearer pm_MAxxThisxxxisxxxxExamplexxxTokenxxxt7I

The REST API documentation is available from the user menu (upper-right corner of the web interface) under REST API.

  • For private accounts, the API server is https://app.papermerge.com.
  • For Team accounts, the API server is https://<tenant-name>-app.papermerge.com.

All API endpoints include an /api/ prefix between the server host and the rest of the endpoint, for example:

curl https://app.papermerge.com/api/users/me -H ...

Note that endpoint URLs do not have a trailing /.

Here are a couple of examples of using an API token with the curl client.

Upload a document:

curl https://app.papermerge.com/api/documents/upload \
-H "Authorization: Bearer pm_MAxxThisxxxisxxxxExamplexxxTokenxxxt7I" \
-F "file=@/home/frederik/Documents/utility_01.pdf" \
-F "lang=eng"

Get current user details:

curl https://app.papermerge.com/api/users/me \
-H "Authorization: Bearer pm_MAxxThisxxxisxxxxExamplexxxTokenxxxt7I"