Orgs & admin API

Manage organization members, service accounts, and embed tokens under /api/orgs/{orgId}.

The admin endpoints manage organization members, the service accounts that hold API tokens, and embed tokens. Most require org-admin privileges on the calling account.

#List members

GET /api/orgs/{orgId}/members — return the members of the organization.

curl https://flax-analytics.com/api/orgs/org_123/members \
  -H "Authorization: Bearer flax_pat_..."

#Service accounts

GET /api/orgs/{orgId}/service-accounts — list the organization's service accounts.

POST /api/orgs/{orgId}/service-accounts — create a service account with a set of scopes. The flax_pat_... token is returned once in the response and cannot be retrieved again.

{
  "serviceAccount": { "id": "sa_123", "name": "reporting-bot", "scopes": ["read"] },
  "token": "flax_pat_..."
}

#Embed tokens

POST /api/orgs/{orgId}/embed-tokens — mint a token scoped to a single chart or dashboard for embedding. Org-admin only.

curl -X POST https://flax-analytics.com/api/orgs/org_123/embed-tokens \
  -H "Authorization: Bearer flax_pat_..." \
  -H "Content-Type: application/json" \
  -d '{ "resourceType": "dashboard", "resourceId": "dsh_123" }'