Skip to main content
The Doctly API uses API keys for authentication. Every request must include your API key in the Authorization header.

Getting Your API Key

  1. Sign in to your Doctly dashboard
  2. Navigate to Settings then API Keys
  3. Click Create API Key
  4. Copy and securely store your key
API keys grant full access to your account. Never share them publicly or commit them to version control.

Using Your API Key

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

Example Requests

Environment Variables

Store your API key in an environment variable:

Authentication Errors

401 Unauthorized

Returned when the API key is missing or invalid:
Common causes:
  • Missing Authorization header
  • Missing Bearer prefix
  • Invalid or revoked API key
  • Using a test key in production or vice versa

403 Forbidden

Returned when the API key does not have permission for the requested resource:

Security Best Practices

Keep Keys Secret

Never expose API keys in client-side code, public repositories, or logs.

Use Environment Variables

Store keys in environment variables or a secrets manager, not in code.

Rotate Regularly

Create new keys periodically and revoke old ones.

Limit Scope

Create separate keys for different environments like development, staging, production.

Managing API Keys

Revoke a Key

If a key is compromised, revoke it immediately in your dashboard:
  1. Go to Settings then API Keys
  2. Find the key to revoke
  3. Click Revoke
Revoking a key is immediate and cannot be undone. Any applications using that key will stop working.

Testing Your Key

Verify your API key works by listing your documents:
A successful response confirms your key is working: