Authentication
All API requests require authentication using an API key.
Getting Your API Key
- 1Sign in to your Dashboard
- 2Navigate to the API Keys section
- 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.pdfAPI 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
| Status | Code | Description |
|---|---|---|
401 | AUTHENTICATION_REQUIRED | No API key provided |
401 | AUTHENTICATION_FAILED | Invalid or revoked API key |
429 | RATE_LIMIT_EXCEEDED | Monthly request limit reached |