API Keys Generation
API keys are required for programmatic access to the API and for integrating with external services.
Generate an API Key
To generate a new API key, use the POST /api/keys endpoint.
Endpoint
POST /api/keys
Request Body
{
"name": "My API Key",
"scopes": ["read", "write"],
"site_id": "your-site-uuid",
"user_id": "your-user-uuid",
"expirationDays": 90,
"prefix": "my-key",
"metadata": {
"environment": "production"
}
}name(required): A descriptive name for the key.scopes(required): An array of permissions granted to the key (e.g.,read,write).site_id(required): The UUID of the site the key is associated with.user_id(required): The UUID of the user creating the key.expirationDays(optional): Key validity period in days (default: 90).prefix(optional): A prefix for the key string.metadata(optional): Additional key metadata.
Response
The API returns the generated key. This is the only time the full key will be displayed. Store it securely.
List API Keys
To list existing API keys for a site:
GET /api/keys?site_id=your-site-uuid&user_id=your-user-uuid
Revoke API Key
To revoke an API key:
DELETE /api/keys?id=key-uuid&site_id=your-site-uuid&user_id=your-user-uuid
id: The UUID of the API key to revoke.
Last updated on