Skip to main content

API Keys

Manage API keys programmatically.

Endpoints Overview

MethodEndpointDescription
POST/api/api-keysCreate new API key
GET/api/api-keysList all API keys
GET/api/api-keys/:idGet API key details
PATCH/api/api-keys/:idUpdate API key
POST/api/api-keys/:id/revokeRevoke API key
GET/api/api-keys/:id/statsGet usage statistics
DELETE/api/api-keys/:idDelete API key
note

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

FieldTypeRequiredDescription
namestringYesDescriptive name for the key
permissionsobjectNoPermission settings

Permissions Object

FieldTypeDescription
send_emailsbooleanAllow sending emails and generating documents
read_analyticsbooleanAllow reading analytics data
manage_templatesbooleanAllow 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"
}
warning

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

ParameterTypeDefaultDescription
pagenumber1Page number
limitnumber20Items per page
sortBystringcreatedAtSort field
sortOrderstringdescSort order: asc or desc
isActiveboolean-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
}
}
note

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

ParameterTypeDescription
idstringAPI 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

ParameterTypeDescription
idstringAPI key ID

Request Body

FieldTypeRequiredDescription
namestringNoNew name for the key
permissionsobjectNoUpdated permissions
isActivebooleanNoActive 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

ParameterTypeDescription
idstringAPI key ID

Response

{
"id": "key_abc123",
"name": "Production API Key",
"isActive": false,
"updatedAt": "2025-01-15T12:00:00Z"
}
note

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

ParameterTypeDescription
idstringAPI 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

ParameterTypeDescription
idstringAPI 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 prefix
  • sk - Secret key indicator
  • <random_string> - Unique identifier

Best Practices

  1. Use descriptive names - Name keys by environment or purpose
  2. Limit permissions - Only grant the permissions the key needs
  3. Store securely - Use environment variables or secrets managers
  4. Separate environments - Use different keys for dev/staging/production
  5. Revoke unused keys - Remove keys that are no longer needed
  6. Monitor usage - Check the stats endpoint regularly

Error Codes

CodeDescription
ERR_AKEY_001API key not found
ERR_AKEY_002Invalid API key
ERR_AKEY_003API key has been deactivated
ERR_AKEY_004You do not have permission to access this API key
ERR_AUTH_006Email not verified (please verify your email address before performing this action)

Related: Authentication | API Keys Dashboard