Start for Free

Authentication

Authenticate your API requests with bearer tokens.

Bearer token authentication

All API requests must include a valid token in the Authorization header:

Authorization headerbash
Authorization: Bearer YOUR_API_TOKEN

Requests without a valid token receive a 401 Unauthenticated response.

Creating a token

  1. Go to Settings → API Tokens in your dashboard
  2. Click Create New Token
  3. Enter a name (e.g. "Production", "Staging", "CI/CD")
  4. Click Create
  5. Copy the token immediately
Important
The token is only displayed once at creation time. Store it securely. If you lose it, delete the token and create a new one.

If no permissions are selected, the token has full access. We recommend creating tokens with the minimum permissions needed for your use case.

Example request

Authenticated API callbash
curl https://pdfstork.com/api/v1/templates \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"

Revoking tokens

To revoke a token, go to Settings → API Tokens and delete the token. The token becomes immediately invalid and all requests using it will be rejected.

Security best practices

  • Store tokens as environment variables, never in source code
  • Use different tokens for different environments (production, staging, development)
  • Grant the minimum permissions needed for each token
  • Rotate tokens periodically by creating a new one and deleting the old one
  • Revoke tokens immediately if they are compromised