Permissions and Access Scope
Why viewerAccess Matters
viewerAccess is the source of truth for what the current key can access.
Run it first to avoid calling unsupported site IDs or endpoint groups.
viewerAccess Response Fields
accountId: account linked to the keyallowedSites: site IDs this key can queryallowedEndpoints: endpoint/query scope granted to this keysiteScope: high-level scope policy label
Access Strategy for Clients
- Query
viewerAccesson app bootstrap. - Query
sitesand intersect withallowedSites. - Hide UI for endpoints not present in
allowedEndpoints. - Add graceful fallback messages instead of hard failures.
Multi-Site Best Practice
- Store selected site ID only after validating membership in
allowedSites. - Re-check access on session refresh or key rotation.
- Treat empty result sets differently from permission-denied behavior.