Authentication

All API requests require authentication using an API key.

Getting Your API Key

  1. 1Sign in to your Dashboard
  2. 2Navigate to the API Keys section
  3. 3Click "Create API Key" and copy your key

Store your key securely

API keys are shown only once when created. Store it securely — you won't be able to see it again.

Using Your API Key

Include your API key in the Authorization header of every request:

http
Authorization: Bearer pk_<your_api_key>

Example Request

bash
curl -X POST "https://api.morphopdf.com/v1/pdf/merge" \
  -H "Authorization: Bearer pk_1a2b3c4d5e6f7890abcdef1234567890" \
  -F "files=@document1.pdf" \
  -F "files=@document2.pdf" \
  --output merged.pdf

API Key Format

  • Prefix: pk_
  • Followed by 32 hexadecimal characters
  • Example: pk_1a2b3c4d5e6f7890abcdef1234567890

Security Best Practices

Store API keys in environment variables
Never expose keys in client-side code
Rotate keys periodically in production
Revoke compromised keys immediately

Never expose your API key

Do not commit API keys to version control or include them in client-side JavaScript.

Authentication Errors

StatusCodeDescription
401AUTHENTICATION_REQUIREDNo API key provided
401AUTHENTICATION_FAILEDInvalid or revoked API key
429RATE_LIMIT_EXCEEDEDMonthly request limit reached

Next Steps