API Keys
Manage API keys programmatically.
Endpoints Overview
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/api-keys | Create new API key |
| GET | /api/api-keys | List all API keys |
| GET | /api/api-keys/:id | Get API key details |
| PATCH | /api/api-keys/:id | Update API key |
| POST | /api/api-keys/:id/revoke | Revoke API key |
| GET | /api/api-keys/:id/stats | Get usage statistics |
| DELETE | /api/api-keys/:id | Delete API key |
All API key management endpoints require JWT authentication.
Create API Key
POST /api/api-keys
Create a new API key for programmatic access.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Descriptive name for the key |
permissions | object | No | Permission settings |
Permissions Object
| Field | Type | Description |
|---|---|---|
send_emails | boolean | Allow sending emails and generating documents |
read_analytics | boolean | Allow reading analytics data |
manage_templates | boolean | Allow template management |
Request Example
{
"name": "Production API Key",
"permissions": {
"send_emails": true,
"read_analytics": true,
"manage_templates": false
}
}
Response
{
"id": "key_abc123",
"teamId": "team_xyz789",
"name": "Production API Key",
"keyType": "secret",
"keyPrefix": "rd_sk_abc1...",
"permissions": ["emails:write", "attachments:write", "emails:read", "attachments:read"],
"isActive": true,
"plainKey": "rd_sk_abc123xyz456...",
"createdAt": "2025-01-15T00:00:00Z"
}
Save your API key immediately! The plainKey field containing the full key is only shown once. Store it securely in environment variables or a secrets manager.
Example
curl -X POST https://api.renderdoc.dev/api/api-keys \
-H "Authorization: Bearer <jwt_token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Production API Key",
"permissions": {
"send_emails": true,
"read_analytics": true
}
}'
List API Keys
GET /api/api-keys
Get all API keys for your team with pagination.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number |
limit | number | 20 | Items per page |
sortBy | string | createdAt | Sort field |
sortOrder | string | desc | Sort order: asc or desc |
isActive | boolean | - | Filter by active status |
Response
{
"data": [
{
"id": "key_abc123",
"teamId": "team_xyz789",
"name": "Production API Key",
"keyType": "secret",
"keyPrefix": "rd_sk_abc1...",
"permissions": ["emails:write", "templates:read"],
"isActive": true,
"lastUsedAt": "2025-01-15T10:30:00Z",
"createdAt": "2025-01-01T00:00:00Z",
"updatedAt": "2025-01-15T10:30:00Z"
}
],
"meta": {
"total": 5,
"page": 1,
"limit": 20,
"totalPages": 1,
"hasNextPage": false,
"hasPreviousPage": false
}
}
For security, the full API key is only shown once when created. Only the keyPrefix is returned in list responses.
Example
curl https://api.renderdoc.dev/api/api-keys \
-H "Authorization: Bearer <jwt_token>"
Get API Key Details
GET /api/api-keys/:id
Get details of a specific API key.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | API key ID |
Response
{
"id": "key_abc123",
"teamId": "team_xyz789",
"name": "Production API Key",
"keyType": "secret",
"keyPrefix": "rd_sk_abc1...",
"permissions": ["emails:write", "templates:read"],
"isActive": true,
"lastUsedAt": "2025-01-15T10:30:00Z",
"createdAt": "2025-01-01T00:00:00Z",
"updatedAt": "2025-01-15T10:30:00Z"
}
Update API Key
PATCH /api/api-keys/:id
Update name, permissions, or active status of an API key.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | API key ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | New name for the key |
permissions | object | No | Updated permissions |
isActive | boolean | No | Active status |
Request Example
{
"name": "Updated Production Key",
"isActive": true
}
Response
Returns the updated API key object.
Revoke API Key
POST /api/api-keys/:id/revoke
Deactivate an API key so it can no longer be used. This sets isActive to false.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | API key ID |
Response
{
"id": "key_abc123",
"name": "Production API Key",
"isActive": false,
"updatedAt": "2025-01-15T12:00:00Z"
}
Revoked keys can be reactivated by updating isActive to true via the PATCH endpoint.
Example
curl -X POST https://api.renderdoc.dev/api/api-keys/key_abc123/revoke \
-H "Authorization: Bearer <jwt_token>"
Get Usage Statistics
GET /api/api-keys/:id/stats
Get usage statistics and metrics for a specific API key.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | API key ID |
Response
{
"totalRequests": 1500,
"requestsToday": 45,
"lastUsedAt": "2025-01-15T10:30:00Z",
"documentsGenerated": 1200,
"emailsSent": 300
}
Delete API Key
DELETE /api/api-keys/:id
Permanently delete an API key. This action cannot be undone.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | API key ID |
Response
Returns 204 No Content on success.
Example
curl -X DELETE https://api.renderdoc.dev/api/api-keys/key_abc123 \
-H "Authorization: Bearer <jwt_token>"
API Key Format
RenderDoc API keys follow this format:
rd_sk_<random_string>
rd- RenderDoc prefixsk- Secret key indicator<random_string>- Unique identifier
Best Practices
- Use descriptive names - Name keys by environment or purpose
- Limit permissions - Only grant the permissions the key needs
- Store securely - Use environment variables or secrets managers
- Separate environments - Use different keys for dev/staging/production
- Revoke unused keys - Remove keys that are no longer needed
- Monitor usage - Check the stats endpoint regularly
Error Codes
| Code | Description |
|---|---|
ERR_AKEY_001 | API key not found |
ERR_AKEY_002 | Invalid API key |
ERR_AKEY_003 | API key has been deactivated |
ERR_AKEY_004 | You do not have permission to access this API key |
ERR_AUTH_006 | Email not verified (please verify your email address before performing this action) |
Related: Authentication | API Keys Dashboard