An API key
Create API keys from the console, where your sign-in is the proof of account ownership. An existing API key cannot create another API key — that restriction is what stops a leaked key from quietly minting itself a wider one.
scopes is required here and lists exactly what the key may do.
curl -X POST https://api.layerv.ai/v1/api-keys \
-H "Authorization: Bearer $LAYERV_CONSOLE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"kind": "api_key",
"name": "Production integration",
"scopes": ["qurl:read", "qurl:write"]
}'
{
"data": {
"key_id": "key_abc123def456",
"api_key": "lv_live_a3x9Kp2mN8qR5sT7wY0zBcDfGhJkLmNp",
"key_prefix": "lv_live_a3x9",
"kind": "api_key",
"name": "Production integration",
"scopes": ["qurl:read", "qurl:write"],
"status": "active",
"created_at": "2026-08-04T10:30:00Z"
},
"meta": { "request_id": "req_abc123" }
}
An enrollment token for a connector
Set target: connector and bind the token to the connector id with one claim. A bound token can enroll that connector and nothing else, so it is safe to hand to whoever runs the install.
An API key can mint this if it holds qurl:agent. The connector id is 3 to 64 characters: lowercase letters, digits and hyphens, starting with a letter and ending with a letter or digit.
curl -X POST https://api.layerv.ai/v1/api-keys \
-H "Authorization: Bearer $QURL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"kind": "enrollment_token",
"name": "prod-dashboard connector enrollment",
"target": "connector",
"claims": [{ "type": "connector", "id": "prod-dashboard" }],
"expires_in": "2h"
}'
{
"data": {
"key_id": "key_def456abc123",
"api_key": "lv_live_b7k2...",
"key_prefix": "lv_live_b7k2",
"kind": "enrollment_token",
"target": "connector",
"claims": [{ "type": "connector", "id": "prod-dashboard" }],
"name": "prod-dashboard connector enrollment",
"scopes": ["qurl:agent", "qurl:write"],
"status": "active",
"created_at": "2026-08-04T10:30:00Z",
"expires_at": "2026-08-04T12:30:00Z"
},
"meta": { "request_id": "req_def456" }
}
An enrollment token for an agent
Set target: agent and leave claims out for a token that can enroll any one agent. Add a connector claim if you want the agent restricted to a single connector.
expires_in is optional and defaults to 24 hours, which is also the ceiling. Mint the token close to when it will be used.
curl -X POST https://api.layerv.ai/v1/api-keys \
-H "Authorization: Bearer $QURL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"kind": "enrollment_token",
"name": "headless agent enrollment",
"target": "agent"
}'
Things the endpoint will not do
- It will not accept
scopes on an enrollment token. Token scopes are server-assigned from target: an agent token gets qurl:agent, a connector token gets qurl:agent and qurl:write. - It will not accept
target, claims, or expires_in on an API key. API keys are durable and general by definition. - It will not create a device credential. Those are minted by the platform when an enrollment completes.
- It will not let an enrollment token mint anything. A one-shot credential cannot create credentials.
- It will not accept more than one claim. One claim is the supported shape today.
Seeing what you have
GET /v1/api-keys lists every credential on the account, including the device credentials the platform minted for your machines. The plaintext secret is never in a list response.
Names and scopes are editable on an API key. An enrollment token’s scopes are server-assigned and a device credential cannot be edited at all; a credential’s kind never changes.
curl https://api.layerv.ai/v1/api-keys \
-H "Authorization: Bearer $LAYERV_CONSOLE_TOKEN"
{
"data": [
{
"key_id": "key_abc123def456",
"key_prefix": "lv_live_a3x9",
"kind": "api_key",
"name": "Production integration",
"scopes": ["qurl:read", "qurl:write"],
"status": "active"
},
{
"key_id": "key_ghi789jkl012",
"key_prefix": "lv_live_c4m8",
"kind": "device",
"name": "prod-dashboard (host-7)",
"scopes": ["qurl:agent", "qurl:write"],
"status": "active"
}
],
"meta": { "request_id": "req_ghi789", "page_size": 2, "has_more": false }
}