Skip to main content

Authentication

Learn how to authenticate your API requests to RenderDoc.

Overview

RenderDoc API uses API Keys for authentication. API keys are designed for programmatic access and server-to-server communication.


API Key Authentication

How It Works

API Keys are long-lived credentials that allow your application to make authenticated requests to the RenderDoc API. Each request must include your API key in the Authorization header.

Creating an API Key

  1. Visit the RenderDoc Dashboard and sign in
  2. Navigate to SettingsAPI Keys
  3. Click Create API Key
  4. Configure your key:
    • Name: A descriptive name (e.g., "Production Server")
    • Permissions: Select required permissions
    • Expiration (optional): Set an expiration date
  5. Click Create and copy your key immediately
warning

The API key is only shown once. Save it securely!

API Key Format: rd_sk_abc123xyz456...

Using Your API Key

Include your API key in the Authorization header:

curl https://api.renderdoc.dev/api/v1/documents/generate \
-H "Authorization: Bearer rd_sk_abc123xyz456..." \
-H "Content-Type: application/json" \
-d '{
"templateId": "invoice-template",
"format": "pdf",
"variables": { "invoiceNumber": "INV-001" }
}'

Code Examples

JavaScript

const API_KEY = 'rd_sk_abc123xyz456...';

const response = await fetch('https://api.renderdoc.dev/api/v1/documents/generate', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
templateId: 'invoice-template',
format: 'pdf',
variables: {
invoiceNumber: 'INV-001',
customerName: 'Acme Corp',
},
}),
});

const data = await response.json();
console.log('Download URL:', data.downloadUrl);

Python

import requests

API_KEY = 'rd_sk_abc123xyz456...'

response = requests.post(
'https://api.renderdoc.dev/api/v1/documents/generate',
headers={
'Authorization': f'Bearer {API_KEY}',
'Content-Type': 'application/json',
},
json={
'templateId': 'invoice-template',
'format': 'pdf',
'variables': {
'invoiceNumber': 'INV-001',
'customerName': 'Acme Corp',
},
},
)

data = response.json()
print('Download URL:', data['downloadUrl'])

Security Best Practices

Do

  • Store API keys in environment variables
  • Use separate keys for development and production
  • Set expiration dates for added security
  • Rotate keys regularly (every 90 days)
  • Revoke unused keys

Don't

  • Commit API keys to version control
  • Share API keys via email or chat
  • Hardcode keys in client-side code
  • Expose keys in public repositories

Error Responses

StatusCodeMessageSolution
401ERR_AUTH_001You are not authorized to access this resourceInclude valid Authorization header
401ERR_AUTH_004Invalid authentication tokenVerify your API key is correct
401ERR_AKEY_002Invalid API keyCheck that the API key format is valid
401ERR_AKEY_003API key has been deactivatedCreate a new API key or reactivate the existing one
403ERR_AUTH_005You do not have permission to perform this actionCheck API key permissions

See Error Codes for the complete error reference.


Next Steps


Back to API Reference