Reference · Control API
Organization & billing
Read your organization’s charges and audit log, set spend caps and issue API tokens.
- In the schema
- —
Organization profile#
Organization routes manage your profile, daily settled infrastructure charges, self-imposed monthly spend ceilings, scoped napalm_… tokens and the organization-wide audit log.
Role-bounded org tokens and CLI PKCE
Issued napalm_… tokens hash at rest, inherit their creator’s live membership role and revoke immediately via POST /tokens/{id}/revoke.
Daily charge meters and hard spend caps
GET /charges itemizes cluster, storage, search and handler spend while POST /org/spend-limits enforces a hard monthly ceiling (402 monthly_cap_reached).
| Route | Description | Scope |
|---|---|---|
GET /org# | Read the organization’s name, approved monthly quota, configured spend cap and search pool allocation | Scoperead |
POST /org# | Rename the organization | Scopemanage |
POST /orgs# | Create a new organization with the authenticated console user as the initial manager | Scopemanage |
GET /org returns the organization record, including quota.monthlyLimitUsd, quota.searchConcurrency, monthlyCapUsd, monthlyAlertUsd, 30-day searchUsage totals and saved payment metadata with the latest 12 invoices under billing. Creating a new organization with POST /orgs requires a person’s own console sign-in and refuses org tokens (403 forbidden).
Metered charges, rates and spend caps#
| Route | Description | Scope |
|---|---|---|
GET /charges | Break down current or historical monthly charges by cluster and meter, plus the org’s searches (?month=2026-11) | Scoperead |
GET /rates# | Read the machine and metered-use prices the pricing page uses (the same for every org) | Scoperead |
GET /rollout# | Read each feature’s rollout state: announced, early access or closed (the same for every org) | Scoperead |
GET /search-usage# | Read the org’s hourly search counts for the last 30 days | Scoperead |
POST /org/spend-limits | Set a self-imposed monthly cap on machine spend and a charge level for console alerts to managers | Scopemanage |
GET/charges#
Query parameters
- monthstring
- UTC billing month formatted as
YYYY-MM(such as2026-11). Defaults to the current UTC month.
Charges settle daily in UTC, and lastDay names the newest settled day in month. Each entry in clusters breaks down US dollar charges across database machines (membersUsd), engines (enginesUsd), extra volume storage (storageUsd), the public IPv4 address (publicIpv4Usd), SSO connections (ssoConnectionsUsd), object and vector storage, change-log storage and retention, outbound bandwidth and file requests. Organization-wide vector searches (searchesUsd, countedSearches), indexes in use (vectorsInUseUsd) and hosted handler usage (handlerAwakeUsd, handlerCallsUsd, handlerImagesUsd) appear beside the cluster list. Monthly included allowances come off on the invoice rather than in GET /charges.
curl "https://api.napalmdata.com/charges?month=2026-11" \ -H "Authorization: Bearer $NAPALM_TOKEN"{ "month": "2026-11", "lastDay": "2026-11-09", "clusters": [ { "id": "7a1e9c2b-4d3f-4b8a-9e6c-2f1d0b8a7c35", "name": "production", "membersUsd": 38.4, "enginesUsd": 9.6, "storageUsd": 0, "publicIpv4Usd": 0.9, "ssoConnectionsUsd": 0, "objectStorageUsd": 1.12, "backupRetentionUsd": 0, "vectorStorageUsd": 0.45, "changeLogUsd": 0, "changeLogRetentionUsd": 0, "bandwidthUsd": 0.18, "fileDownloadsUsd": 0.04, "fileUploadsUsd": 0.02, "fileDownloadBytesUsd": 0 } ], "searchesUsd": 0.13, "countedSearches": 64000, "vectorsInUseUsd": 9, "searchNodesUsd": 0, "searchNodeStorageUsd": 0, "handlerAwakeUsd": 0.14, "handlerAwakeSeconds": 1820, "handlerCallsUsd": 0.05, "handlerCallCount": 25000, "handlerImagesUsd": 0.03}POST/org/spend-limits#
Request body
- monthlyCapUsdinteger | null
- Monthly cap on the organization’s machine spend in whole US dollars, up to the approved quota. A new cluster, scale, split or core copy that would pass the cap fails with
402 monthly_cap_reached. Lowering the cap stops nothing already running. Passnullor omit for no cap. - monthlyAlertUsdinteger | null
- Monthly charge in whole US dollars (at least
1) that triggers a console alert to the organization’s managers. Passnullor omit for no alert.
An organization’s approved quota (org.quota.monthlyLimitUsd) starts at $0 until a manager saves a card in the console, then opens at $500 and doubles with each paid monthly invoice up to $8,000. Setting monthlyCapUsd places a lower self-imposed ceiling under that quota.
curl https://api.napalmdata.com/org/spend-limits \ -H "Authorization: Bearer $NAPALM_TOKEN" \ -H "Content-Type: application/json" \ -d { "monthlyCapUsd": 500, "monthlyAlertUsd": 300 }{ "org": { "id": "3c8f1a2e-9b4d-4e7c-a1f6-5d2b8e0c9a47", "name": "Northwind", "insertTime": "2026-09-12T10:15:00Z", "monthlyCapUsd": 500, "monthlyAlertUsd": 300, "quota": { "monthlyLimitUsd": 2000, "searchConcurrency": 4 } }}Org tokens#
| Route | Description | Scope |
|---|---|---|
GET /token# | Inspect the metadata (label, scope, expiration) of the bearer token authenticating the active request | Scoperead |
GET /tokens# | List all org tokens (metadata only, because token secrets are never stored in plaintext) | Scoperead |
POST /tokens | Issue a new org token with read or manage scope and a validity window in days | Scopemanage |
POST /tokens/{id}/revoke# | Immediately revoke an org token by ID | Scopemanage |
POST /token-codes# | Create a 5-minute one-time PKCE authorization code for a headless CLI login session | Scopemanage |
POST /token-codes/redeem# | Exchange a CLI sign-in code and PKCE code_verifier for an org token | Scope— |
POST/tokens#
Request body
- labelstringrequired
- Purpose of the token (1–128 characters, not only spaces).
- scopestringrequired
- Permission level:
read(inspection routes) ormanage(provisioning, schema pushes, keys and settings). - daysintegerrequired
- Validity window in days before automatic expiration (1–65,535). The console and CLI offer 30 days by default.
- orgIduuid
- Target organization UUID. Defaults to the calling token’s organization, and any other organization answers
403 forbidden.
The creation response returns { "tokenId", "token" } and shows the napalm_… plaintext token once. Napalm stores only a hash of the token. Every org token acts as the person who created it and never exceeds their current role. A manage token whose creator is no longer a manager acts as read, and a token whose creator left the organization sees nothing.
Revoke a token immediately with POST /tokens/{id}/revoke. Headless CLI sign-ins (napalm login --no-browser) mint a 5-minute S256 PKCE code at POST /token-codes and exchange the code and verifier at POST /token-codes/redeem. See Sessions and keys for a comparison of read and manage permissions.
curl https://api.napalmdata.com/tokens \ -H "Authorization: Bearer $NAPALM_TOKEN" \ -H "Content-Type: application/json" \ -d { "label": "ci-deploy", "scope": "manage", "days": 30 }{ "tokenId": "5d2b8e0c-9a47-4c8f-a1e2-9b4d3c8f1a2e", "token": "napalm_k7Qv9mX2pL4nR8tW1yZ6bC3fH5jM0sA9dE2gK4uP"}Audit event log#
| Route | Description | Scope |
|---|---|---|
GET /events | List chronological audit log events across the organization, newest first | Scoperead |
GET/events#
Audit event object
- iduuid
- Audit event identifier.
- actionstring
- Recorded action name, such as
projectSchemaMigrated,projectKeyIssued,projectPersonAccessChecked,clusterScaleRequestedorapiTokenIssued. - actorstring
- Role or subsystem that recorded the event:
manager,admin,auth,worker,failoverDetector,scheduler,searchPlannerorgithub. - creatorId / tokenIduuid | null
- Acting user UUID and the org token UUID that authenticated the request.
- clusterId / operationIduuid | null
- Associated cluster UUID and asynchronous operation UUID, when applicable.
- detailsobject
- Action-specific metadata, such as affected project, branch or credential identifiers.
- insertTimestring
- RFC 3339 timestamp when the event was recorded.
GET /events returns the organization’s 100 newest audit events, newest first (matching napalm activity in the CLI). Every state-changing operation records the acting user or token and target identifiers, including schema pushes, key issuances and revocations, person access checks (projectPersonAccessChecked), backup and restore operations and token creation.
curl https://api.napalmdata.com/events \ -H "Authorization: Bearer $NAPALM_TOKEN"{ "events": [ { "id": "0192c420-4e5f-7a8b-9c12-3d4e5f6a7b8c", "orgId": "3c8f1a2e-9b4d-4e7c-a1f6-5d2b8e0c9a47", "operationId": null, "clusterId": "7a1e9c2b-4d3f-4b8a-9e6c-2f1d0b8a7c35", "creatorId": "9e6c2f1d-0b8a-4c35-8a7c-1e9c2b4d3f7a", "tokenId": "5d2b8e0c-9a47-4c8f-a1e2-9b4d3c8f1a2e", "actor": "manager", "runId": null, "action": "projectSchemaMigrated", "details": { "projectId": "8a4d2c10-5e3b-4f9a-8c12-6d7e8f9a0b1c", "branch": "main" }, "insertTime": "2026-11-10T18:02:11Z" }, { "id": "0192c418-1a2b-7c3d-8e90-1f2a3b4c5d6e", "orgId": "3c8f1a2e-9b4d-4e7c-a1f6-5d2b8e0c9a47", "operationId": null, "clusterId": null, "creatorId": "9e6c2f1d-0b8a-4c35-8a7c-1e9c2b4d3f7a", "tokenId": "5d2b8e0c-9a47-4c8f-a1e2-9b4d3c8f1a2e", "actor": "manager", "runId": null, "action": "apiTokenIssued", "details": { "label": "ci-deploy", "scope": "manage" }, "insertTime": "2026-11-10T17:58:04Z" } ]}