API Keys
Create API keys with scoped permissions, expiry, and IP restrictions
API keys authenticate software that calls the LaserData Cloud API. Use them for CI/CD, CLI tools, Terraform providers, and other integrations. They follow the same permission model as interactive sessions.
How It Works
A key follows this sequence:
- You create it with a role and optional IP restrictions.
- The platform shows its generated secret once.
- You send the secret in the
ld-api-keyheader on each request. - The platform evaluates the key, rate limit, IP allowlist, and role permissions.
Save the secret when you create the key. The platform cannot display it again.
A key never carries more authority than its creator. You can create a key only with a role, or inline permissions, that you hold yourself in the same scope: organization, workspace, or environment. Manage includes read. A key that creates keys is bound the same way. Otherwise the request answers 403 with insufficient_permissions.
A key belongs to the member who created it. Removing that member from the organization, the member leaving it, or deleting the user deletes the keys they created there. Deactivating the member suspends the keys they created in the organization until the member is active again. Locking the user suspends their keys in every organization until the user is unlocked. A suspended key answers 401, stays in the key list, and carries suspended: true there. A key limited to one workspace is deleted when that workspace is deleted. For automation that must outlive a person, create the key from an account that stays.
Creating an API Key
From the Console
- Open the tenant's API Keys page.
- Click Create API Key.
- Enter a key name.
- Select an existing role, or enter permissions to create a dedicated role for the key.
- Set an expiration date no more than 365 days away.
- Click Create.
- Copy the secret before you leave the page.
With Inline Permissions
Inline permissions define the tenant, workspace, and environment grants within the request. The platform creates a dedicated role and ties it to the key.
{
"name": "monitoring-key",
"expiry_at": "2026-06-01T00:00:00Z",
"permissions": {
"tenant": ["info:read", "member:read"],
"workspace": ["environment:read"],
"environment": ["deployment:read", "deployment:telemetry:read"]
}
}permissions.environment applies to every environment in every workspace. Use permissions.workspaces[id].environment for a workspace's defaults. Use permissions.workspaces[id].environments[env_id] for an environment override. Roles & Permissions explains precedence.
Security
| Property | Description |
|---|---|
| High entropy | Long random secret - infeasible to brute-force |
| One-way storage | Only the hash is stored - the secret cannot be recovered |
| Required expiry | Maximum 365 days, enforced at creation |
| Rate limiting | Per-key rate limiter prevents abuse |
| IP allowlisting | Optional - restrict the key to specific IP addresses |
| Instant revocation | Deleting the key blocks access immediately |
| Bound to its creator | Keys are deleted with the member who created them and suspended while that member is deactivated or that user is locked |
| Bound to its workspace | A key limited to one workspace is deleted with that workspace |
IP Allowlisting
An allowlist restricts a key to selected source IPs. Other addresses receive 403. You can change an existing key's IP restrictions without recreating it.
The account plan limits allowed IPs per key:
| Plan | Allowed IPs per key |
|---|---|
| Standard | 5 |
| Performance | 20 |
| Enterprise | 100 |
Managing API Keys
Use the API Keys page for these actions:
- Read each key's name, role, expiry, and creation date.
- Change its IP allowlist.
- Delete it to revoke access immediately.
Creation, updates, and deletion require api_key:manage. Listing requires api_key:read. The audit log records all API key operations.
API Reference
Create an API Key with a Role
curl -X POST https://api.laserdata.cloud/tenants/{tenant_id}/api_keys \
-H "ld-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "ci-deploy-key",
"role_id": 67890,
"workspace_id": 123,
"expiry_at": "2026-06-01T00:00:00Z",
"validate_ip": false
}'Supply role_id for an existing role or permissions for a dedicated role. Do not supply both. The optional workspace_id limits the key to one workspace.
Create an API Key with Inline Permissions
curl -X POST https://api.laserdata.cloud/tenants/{tenant_id}/api_keys \
-H "ld-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "monitoring-key",
"expiry_at": "2026-06-01T00:00:00Z",
"validate_ip": true,
"allowed_ips": ["10.0.0.1"],
"permissions": {
"tenant": ["info:read", "member:read"],
"workspace": ["environment:read"]
}
}'List API Keys
curl https://api.laserdata.cloud/tenants/{tenant_id}/api_keys \
-H "ld-api-key: YOUR_API_KEY"{
"items": [
{
"id": 1,
"workspace_id": 123,
"workspace_name": "production",
"user_id": 1,
"role_id": 67890,
"role_name": "deployer",
"name": "ci-deploy-key",
"validate_ip": false,
"allowed_ips": [],
"expiry_at": "2026-06-01T00:00:00Z",
"created_at": "2025-01-15T10:30:00Z",
"suspended": false
}
],
"page": 1,
"total_results": 1,
"total_pages": 1
}Update Security Settings
curl -X PUT https://api.laserdata.cloud/tenants/{tenant_id}/api_keys/{api_key_id}/security \
-H "ld-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"validate_ip": true,
"allowed_ips": ["10.0.0.1", "192.168.1.0"]
}'Delete an API Key
curl -X DELETE https://api.laserdata.cloud/tenants/{tenant_id}/api_keys/{api_key_id} \
-H "ld-api-key: YOUR_API_KEY"