API keys provide programmatic access to your SaaS platform resources. Each API key can be configured with granular scope-based permissions to control exactly which resources and actions are allowed.
All API keys follow the format: sk_<64-character-hex-string>
Example: sk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2
API keys use a scope-based permission model with the following structure:
{
"users": {
"create": true,
"read": true,
"update": false,
"delete": false
},
"applications": {
"create": false,
"read": true,
"update": false,
"delete": false
},
"database": {
"create": false,
"read": true,
"update": false,
"delete": false
}
}
Include your API key in the Authorization header with the Bearer scheme:
Authorization: Bearer sk_your_api_key_here
All API key endpoints are available under the /v1 prefix:
https://your-domain.com/api/v1/
users:read scope)curl -X GET https://your-domain.com/api/v1/users \
-H "Authorization: Bearer sk_your_api_key_here"
Response:
{
"data": [
{
"id": "uuid",
"email": "user@example.com",
"first_name": "John",
"last_name": "Doe",
"created_at": "2024-01-01T00:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 50,
"totalPages": 3
}
}
applications:read scope)curl -X GET https://your-domain.com/api/v1/applications/app-uuid \
-H "Authorization: Bearer sk_your_api_key_here"
database:read scope)curl -X GET https://your-domain.com/api/v1/database/tables \
-H "Authorization: Bearer sk_your_api_key_here"
database:read scope)curl -X POST https://your-domain.com/api/v1/database/query \
-H "Authorization: Bearer sk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"query": "SELECT * FROM my_table LIMIT 10"
}'
Note: Only SELECT queries are allowed via API keys. System tables (__sys_*) cannot be queried.
| Method | Endpoint | Required Scope | Description |
|---|---|---|---|
| GET | /v1/users |
users:read |
List all users |
| GET | /v1/users/:id |
users:read |
Get user by ID |
| Method | Endpoint | Required Scope | Description |
|---|---|---|---|
| GET | /v1/applications |
applications:read |
List all applications |
| GET | /v1/applications/:id |
applications:read |
Get application by ID |
| Method | Endpoint | Required Scope | Description |
|---|---|---|---|
| GET | /v1/deployments |
deployments:read |
List all deployments |
| GET | /v1/deployments?applicationId=:id |
deployments:read |
List deployments for an application |
| Method | Endpoint | Required Scope | Description |
|---|---|---|---|
| GET | /v1/database/tables |
database:read |
List all database tables |
| POST | /v1/database/query |
database:read |
Execute SELECT query |
| Method | Endpoint | Required Scope | Description |
|---|---|---|---|
| GET | /v1/api-keys |
api_keys:read |
List all API keys (metadata only) |
API key is missing, invalid, or expired.
{
"error": "Invalid or expired API key"
}
API key doesn't have required permissions.
{
"error": "Insufficient permissions",
"required": {
"resource": "users",
"action": "read"
},
"message": "API key does not have 'read' permission for 'users'"
}
Invalid request parameters or query.
{
"error": "Query execution failed"
}
last_used_at timestamps to identify unused keysCurrently, rate limiting is disabled for testing. In production, implement appropriate rate limits per API key to prevent abuse.
Scopes:
users:readapplications:readdeployments:readdatabase:readScopes:
users:read, users:updateapplications:readdatabase:readScopes:
applications:read, applications:updatedeployments:create, deployments:readScopes:
create, read, update, delete