keys

Embed
Preview of the card
<a href="https://lucidace.com/docs/ref-keys"><img src="https://lucidace.com/docs/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/da916cd3-c0fc-4b63-b971-b3c13623daf3/pages/4a00d76b-e07e-42ea-b940-e3987a710a86/social-card.svg?v=3e7ae33eec8b" alt="keys" width="600" height="315"></a>
GEThttps://lucidace.com/v1/keys/lookup

Whether an account key (`lc_pat_...`) with this display prefix is active or revoked. Looks only among the caller's own keys; instance admins see every key and the owner's email.

Parameters

prefixstringqueryrequired
The key's display prefix, e.g. lc_pat_AbCd

Code samples

cURL
curl -X GET "https://lucidace.com/v1/keys/lookup?prefix=<prefix>"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "created_at": "2024-01-01T00:00:00Z",
  "name": "string",
  "owner_email": "string",
  "revoked_at": "2024-01-01T00:00:00Z",
  "status": "string"
}
Schema
created_atstring
namestring
owner_emailstring
Instance admins only.
revoked_atstring
statusstringrequired
active, revoked or unknown (also for keys of other users, unless the caller is an instance admin).
400
404
GEThttps://lucidace.com/v1/keys/self

The calling key's kind, scopes, reach, environment and expiry. Sessions and other non-key callers get 404.

Code samples

cURL
curl -X GET "https://lucidace.com/v1/keys/self" \
  -H "Authorization: Bearer $LUCIDACE_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "environment": "string",
  "expires_at": "2024-01-01T00:00:00Z",
  "kind": "string",
  "name": "string",
  "org_ids": [
    "string"
  ],
  "prefix": "string",
  "project_id": "string",
  "scopes": [
    "string"
  ]
}
Schema
environmentstring
SDK keys: the environment the key serves (its binding, else the project default); null for personal and account keys.
expires_atstring
kindstringrequired
public, secret or personal (project keys); account for an account key.
namestringrequired
org_idsarray
Account keys: the orgs the key is limited to; null means every org the owner belongs to.
prefixstringrequired
project_idstring
Project keys: the project the key belongs to.
scopesstring[]required
An empty list on a legacy secret key means it reads the whole project.
401
404 The caller is not authenticated by a key
GEThttps://lucidace.com/v1/me/keysScope admin

The caller's account keys (metadata only, newest first).

Code samples

cURL
curl -X GET "https://lucidace.com/v1/me/keys"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Page of AccountKey
Example
{
  "data": [
    {
      "created_at": "2024-01-01T00:00:00Z",
      "expires_at": "2024-01-01T00:00:00Z",
      "id": "string",
      "key_prefix": "string",
      "last_used_at": "2024-01-01T00:00:00Z",
      "name": "string",
      "org_ids": [
        "string"
      ],
      "revoked_at": "2024-01-01T00:00:00Z",
      "scopes": [
        "string"
      ],
      "user_id": "string"
    }
  ],
  "next_cursor": "string"
}
Schema
dataAccountKey[]required
Show child parameters
created_atstringrequired
expires_atstring
idstringrequired
key_prefixstringrequired
last_used_atstring
namestringrequired
org_idsstring[]required
Empty = every org the owner belongs to.
revoked_atstring
scopesstring[]required
user_idstringrequired
next_cursorstring
404
POSThttps://lucidace.com/v1/me/keysScope admin

The secret is in the response once (as `value`, and `secret` as a deprecated alias) and cannot be fetched again. `?dry_run=true` validates without creating (200, no secret); an `Idempotency-Key` retry within 24h returns the first response without the secret.

Parameters

dry_runbooleanquery
validate only
Idempotency-Keystringheader
replay-safe retries for 24h

Request body

application/json
expires_atstring
namestringrequired
org_idsstring[]
Optional: only these orgs (each must be one the caller belongs to). Empty = all of them.
scopesstring[]required
Org administration scopes (members:read|write, roles:read|write, audit:read, billing:read, sso:read|write, scim:read|write) are capped by the creator's role in each org; admin opens every org route the creator's role allows. At least one: org:read, org:write, project:read, project:write and the project scopes (*:read, flag:write, ...). *:read and *:write also read orgs and project settings. Applied to every project the owner can access. See GET /v1/scopes.
{
  "expires_at": "2024-01-01T00:00:00Z",
  "name": "string",
  "org_ids": [
    "string"
  ],
  "scopes": [
    "string"
  ]
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/me/keys" \
  -H "Idempotency-Key: <value>" \
  -H "Content-Type: application/json" \
  -d '{"expires_at":"2024-01-01T00:00:00Z","name":"string","org_ids":["string"],"scopes":["string"]}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 dry run
201
Example
{
  "created_at": "2024-01-01T00:00:00Z",
  "expires_at": "2024-01-01T00:00:00Z",
  "id": "string",
  "key_prefix": "string",
  "last_used_at": "2024-01-01T00:00:00Z",
  "name": "string",
  "org_ids": [
    "string"
  ],
  "revoked_at": "2024-01-01T00:00:00Z",
  "scopes": [
    "string"
  ],
  "user_id": "string",
  "secret": "string",
  "value": "string"
}
Schema
created_atstringrequired
expires_atstring
idstringrequired
key_prefixstringrequired
last_used_atstring
namestringrequired
org_idsstring[]required
Empty = every org the owner belongs to.
revoked_atstring
scopesstring[]required
user_idstringrequired
secretstringrequired
Deprecated alias of value.
valuestringrequired
Shown once; only its SHA-256 is stored. Same field name as every other key create.
400
404
409 idempotency key reused
DELETEhttps://lucidace.com/v1/me/keys/{key_id}Scope admin

Parameters

key_idstringpathrequired

Code samples

cURL
curl -X DELETE "https://lucidace.com/v1/me/keys/{key_id}"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

204
404
POSThttps://lucidace.com/v1/me/keys/{key_id}/rotateScope admin

Issues a replacement with the same name, scopes, org list and expiry, and revokes the old key.

Parameters

key_idstringpathrequired

Code samples

cURL
curl -X POST "https://lucidace.com/v1/me/keys/{key_id}/rotate"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

404
GEThttps://lucidace.com/v1/orgs/{org_id}/keysScope admin

Every key in the org with its owner, project, scopes and last use (newest first), for owners and admins auditing access. Secrets are never included.

Parameters

org_idstringpathrequired
kindstringquery
public, secret or personal
include_revokedbooleanquery
limitintegerquery
cursorstringquery

Code samples

cURL
curl -X GET "https://lucidace.com/v1/orgs/{org_id}/keys"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Page of OrgKey
Example
{
  "data": [
    {
      "created_at": "2024-01-01T00:00:00Z",
      "created_by": "string",
      "environment": "string",
      "expires_at": "2024-01-01T00:00:00Z",
      "id": "string",
      "key_prefix": "string",
      "kind": "string",
      "last_used_at": "2024-01-01T00:00:00Z",
      "legacy_read_all": true,
      "name": "string",
      "org_id": "string",
      "project_id": "string",
      "public_value": "string",
      "revoked_at": "2024-01-01T00:00:00Z",
      "scopes": [
        "string"
      ],
      "owner_email": "string",
      "project_name": "string"
    }
  ],
  "next_cursor": "string"
}
Schema
dataOrgKey[]required
Show child parameters
created_atstringrequired
created_bystring
environmentstring
Environment an SDK key is bound to. null means unbound: it serves the project's default environment, looked up when the key is used (so it follows a change of default); personal keys are never bound.
expires_atstring
idstringrequired
key_prefixstringrequired
kindstringrequired
last_used_atstring
legacy_read_allbooleanrequired
A secret key with no scopes: it reads the whole project (issued before secret keys needed explicit scopes). Rotate it to a scoped key.
namestringrequired
org_idstringrequired
project_idstringrequired
public_valuestring
The full key, kept only for public keys (they ship in web pages); null for secret and personal keys, which are shown once, and for public keys minted before this was stored.
revoked_atstring
scopesstring[]required
owner_emailstring
project_namestringrequired
next_cursorstring
400
403
404
GEThttps://lucidace.com/v1/projects/{project_id}/environmentsScope settings:read

The project's environments, for choosing what a new SDK key is bound to.

Parameters

project_idstringpathrequired

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/environments"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 oldest first
Example
{
  "data": [
    {
      "id": "string",
      "is_default": true,
      "name": "string"
    }
  ],
  "next_cursor": "string"
}
Schema
dataobject[]required
Show child parameters
idstringrequired
is_defaultbooleanrequired
namestringrequired
next_cursorstring
404
GEThttps://lucidace.com/v1/projects/{project_id}/keysScope admin

Key metadata only (prefix, scopes, last use); secrets are never returned after creation.

Parameters

project_idstringpathrequired
include_revokedbooleanquery
also list revoked keys (revoked_at set); default false
limitintegerquery
cursorstringquery

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/keys"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Page of ApiKey; revoked keys only with include_revoked=true
Example
{
  "data": [
    {
      "created_at": "2024-01-01T00:00:00Z",
      "created_by": "string",
      "environment": "string",
      "expires_at": "2024-01-01T00:00:00Z",
      "id": "string",
      "key_prefix": "string",
      "kind": "string",
      "last_used_at": "2024-01-01T00:00:00Z",
      "legacy_read_all": true,
      "name": "string",
      "org_id": "string",
      "project_id": "string",
      "public_value": "string",
      "revoked_at": "2024-01-01T00:00:00Z",
      "scopes": [
        "string"
      ]
    }
  ],
  "next_cursor": "string"
}
Schema
dataApiKey[]required
Show child parameters
created_atstringrequired
created_bystring
environmentstring
Environment an SDK key is bound to. null means unbound: it serves the project's default environment, looked up when the key is used (so it follows a change of default); personal keys are never bound.
expires_atstring
idstringrequired
key_prefixstringrequired
kindstringrequired
last_used_atstring
legacy_read_allbooleanrequired
A secret key with no scopes: it reads the whole project (issued before secret keys needed explicit scopes). Rotate it to a scoped key.
namestringrequired
org_idstringrequired
project_idstringrequired
public_valuestring
The full key, kept only for public keys (they ship in web pages); null for secret and personal keys, which are shown once, and for public keys minted before this was stored.
revoked_atstring
scopesstring[]required
next_cursorstring
403
404

Updated