Org admin API
Manage members, invites, roles, projects, audit, billing, SSO and SCIM tokens from a script or Terraform with an account key restricted to one organization.
Everything an org admin does in Settings for people and access can be done with the API: provision members from a script, rotate SCIM tokens, pull the audit log into your SIEM, or manage client orgs as an agency.
The key
Use an account key (lc_pat_...) restricted to one organization, with the area scopes you need:
Scope | Allows |
|---|---|
| list and read members and open invites; change a role, remove a member, invite, revoke an invite |
| list and read roles; create, edit, delete custom roles; assign a custom role to a member |
| the existing |
| read the audit log, CSV and NDJSON exports, verify the chain |
| plan, usage and quota, invoices |
| list and read SSO connections; create, update, delete, verify a domain, enforce |
| list SCIM token metadata; issue (shown once) and revoke tokens |
write includes read. There is no audit:write or billing:write.
Create it in Personal settings > API keys (tick the scopes, and optionally the organizations it may reach), or with a signed-in session:
POST /v1/me/keys {"name": "provisioning", "scopes": ["members:write", "roles:read", "audit:read"], "org_ids": ["<org_id>"]}The secret is shown once; Lucida stores only its hash.
What limits a key
Organizations. A key with
org_idsanswers404for any other org. A key with noorg_idsreaches every org you belong to, including ones you create with it later.adminis the setup key. An account key holdingadminopens every org route your role allows (members, roles, audit, billing, SSO, SCIM, domains, teams, security, org keys) without listing the area scopes. With noorg_idsit can also create orgs and mint, rotate and revoke your other account keys (/v1/me/keys), so one key can set up a whole org from start to finish. Any other key calling/v1/me/keysanswers403.Your role is the ceiling, at creation and on every call. You can only hand out a scope your role could use yourself: a plain member cannot mint
members:write,sso:readorbilling:read(400). If your role drops later, the key drops with it. An admin's key still cannot grant ownership or remove an owner (403); only an owner can.Scopes are exact. A missing scope answers
403and names it (this key needs the members:write scope).org:write,*:writeandadmindo not open these routes.Project keys (
lc_sk_) never reach them (404).Every change is written to the audit log with the key id.
Routes
All under /v1/orgs/{org_id}. Lists answer {data, next_cursor}. Errors are RFC 9457 problem+json. The OpenAPI document lists each route's x-required-scopes.
Route | Scope |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| none for keys |
| none |
|
|
|
|
|
|
|
|
|
|
SSO secrets are write-only: the OIDC client secret and the SAML certificate are sealed on write and never returned. PATCH /sso/{id} changes the default role, the just-in-time switch and, if you send oidc or saml, replaces the sealed config (the protocol cannot change; to change domains, delete and recreate). Deleting a project, removing the last owner and the other safety rules are the same as in the app.
curl -H "Authorization: Bearer $LUCIDA_ACCOUNT_KEY" https://<your-host>/v1/orgs/$ORG/members
curl -X POST -H "Authorization: Bearer $LUCIDA_ACCOUNT_KEY" -H 'Content-Type: application/json' \
-d '{"email":"new@example.com","role":"member"}' https://<your-host>/v1/orgs/$ORG/invitesAn invite answers the one-time token; deliver it to the invitee yourself (Lucida does not email it from this route).
SCIM
Set up automatic provisioning from your IdP: SCIM setup for Okta, Entra ID and Google.