Developers & automation
Use the provider API with least privilege.
Every request is tenant-scoped by the authenticated key. A caller cannot choose another provider ID, grant scopes it does not hold, or recover plaintext credentials.
Authentication
Send the provider key in the HTTP Authorization header.
Never place it in a URL/query, request body, log field, analytics
event, source repository, ticket or screenshot.
GET /v1/provider/session HTTP/1.1
Host: panel.nodif.app
Authorization: Bearer <provider-key-from-secret-manager>
Accept: application/json
For command-line testing, inject the key from an approved secret manager into a short-lived process environment variable. Do not paste the value into shell history.
curl --fail-with-body --silent --show-error \
--header "Authorization: Bearer ${NODIF_PROVIDER_KEY}" \
--header "Accept: application/json" \
https://panel.nodif.app/v1/provider/session
Start with the session capability response
GET /v1/provider/session requires
provider:read and returns the current key’s
role/scopes, active plan features, subscription state, cohort
threshold and raw-event retention policy. It does not return the key
ID, token or hashes.
{
"role": "analyst",
"scopes": ["provider:read", "analytics:read"],
"plan": {
"code": "intelligence",
"name": "Intelligence",
"subscription_status": "active"
},
"capabilities": {
"provider_write": false,
"branding_read": false,
"branding_write": false,
"billing_read": false,
"analytics_read": true,
"branding_entitled": true,
"analytics_entitled": true,
"platform_access": false
},
"policy": {
"minimum_cohort_size": 20,
"raw_event_retention_days": 30
}
}
The values above are illustrative. Always use the live response; policy and entitlement can change.
Roles and scopes
Scopes enforce API authorization. Roles are governance labels plus two creation safeguards: owner/admin keys may create keys; only an owner may create another owner. A key cannot grant a scope it does not already hold.
| Scope | Allows | Recommended role |
|---|---|---|
provider:read |
Provider profile, key lifecycle metadata, session capabilities. | All portal/API users. |
provider:write |
Provider name/public slug updates and key create/revoke subject to role controls. | Owner or admin only. |
branding:read |
Approved branding and branding-token lifecycle metadata. | Owner, admin, branding operator. |
branding:write |
Branding-token create/revoke. Production profile/logo edits still require NODIF moderation. | Owner or controlled branding operator. |
billing:read |
Subscription, plan and service-period metadata. | Owner, admin or billing role. |
analytics:read |
Entitled aggregate overview, time series and cohorts. | Analyst/NOC or owner. |
Provider endpoint matrix
| Method and path | Scope | Purpose |
|---|---|---|
GET /v1/provider/session |
provider:read |
Current role, scopes, plan capabilities and active policy. |
GET /v1/provider/me |
provider:read |
Read the authenticated tenant profile. |
PUT /v1/provider/me |
provider:write |
Update name and public slug; status is preserved server-side. |
GET /v1/provider/subscription |
billing:read |
Read plan and manual subscription period/state. |
GET /v1/provider/branding |
branding:read |
Read approved production profile and moderation metadata. |
PUT /v1/provider/branding |
branding:write |
Currently returns 409 branding_review_required;
NODIF moderation protects the live profile.
|
PUT /v1/provider/assets/logo |
branding:write |
Currently returns the same moderation requirement. |
GET/POST /v1/provider/branding/tokens |
read/write branding scope | List lifecycle metadata or create a one-time plaintext replacement. |
POST …/branding/tokens/{token_id}/revoke |
branding:write |
Revoke a token in the authenticated tenant. |
GET/POST /v1/provider/keys |
read/write provider scope | List lifecycle metadata or create a non-escalating key. |
POST …/keys/{key_id}/revoke |
provider:write |
Revoke another key; the active key cannot revoke itself. |
GET /v1/provider/analytics/overview |
analytics:read + entitlement |
Tenant overview with disclosure control. |
GET /v1/provider/analytics/timeseries |
analytics:read + entitlement |
Hourly/daily suppressed trend. |
GET /v1/provider/analytics/cohorts |
analytics:read + entitlement |
Allowlisted dimension comparison, maximum 200 rows. |
GET /v1/provider/guidance |
analytics:read + active Platform/Ultimate plan
|
Recommendation-only route and reliability guidance. No raw cohort rows, endpoints, or user-level records. |
Error envelope and incident reference
Non-success responses use a stable code, safe message and request
ID. The same ID appears in X-Request-ID.
{
"error": {
"code": "insufficient_scope",
"message": "Provider key does not include the required scope",
"request_id": "00000000-0000-4000-8000-000000000000"
}
}
| Status/code | Meaning | Action |
|---|---|---|
401 unauthorized |
Missing, malformed, revoked or inactive key. | Do not retry in a loop. Replace/revoke through an authorized owner. |
403 insufficient_scope |
Key lacks the endpoint scope. | Use a least-privilege key with the required scope. |
403 not_entitled |
Plan/subscription does not include active analytics/branding. |
Check /session and provider subscription.
|
403 scope_escalation |
Caller tried to grant a scope it does not hold. | Use an authorized owner/admin key; do not broaden automation keys. |
403 role_escalation |
Non-owner tried to create an owner. | Use an owner key through the approved change process. |
409 self_revoke_blocked |
Active key tried to revoke itself. | Create/verify another owner key first. |
409 branding_review_required |
Live branding/logo needs NODIF moderation. | Submit reviewed material; the current approved profile stays live. |
429 rate_limited |
Provider API limit reached. |
Honor Retry-After: 60, add jitter and reduce
polling.
|
500 internal_error |
Server could not complete the request. | Record request ID/time and retry with bounded backoff. |
Rate limiting and retries
Provider-authenticated endpoints allow up to
600 requests per minute for the keyed key/source
identity. On 429, stop and honor Retry-After: 60. For
500/503, use exponential backoff with jitter and a finite attempt
limit. Never retry 401, 403, 409 or schema errors automatically.
Analytics time windows
- Default: the previous seven days ending at server “now”.
-
from/to: RFC 3339 timestamps, normalized to UTC. -
Maximum: the active raw-event retention returned by
/session. -
tomay not be more than five minutes in the future. -
Time series defaults to hourly for windows up to 14 days and daily
for longer windows; callers may request
hourorday. - Cohort
limitdefaults to 50 and accepts 1–200.
GET /v1/provider/analytics/cohorts?from=2026-08-25T00:00:00Z&to=2026-09-01T00:00:00Z&dimension=platform&limit=50
Safe key rotation
- Create a replacement with the minimum role/scopes.
- Store plaintext immediately in the approved secret manager.
-
Test
/v1/provider/sessionand one required read endpoint. - Update one automation/portal operator at a time.
- Confirm
last_used_aton the replacement. - Revoke the old key from a different active owner/admin key.
- Remove old secret references and document only key label/ID—not plaintext.
Rotate immediately after disclosure, staff departure, device loss, unexpected use or a scope change. Never solve access problems by sharing the owner key.
