Skip to main content

Scopes

Scopes control what actions an application can perform. Each app type has its own scope set.

Least Privilege Principle

Only request the scopes you need. Requesting unnecessary scopes increases security risk and may require additional user consent.


M2M Scopes​

M2M (Machine-to-Machine) applications use dot-notation scopes (product.feature.action) to control API access. Assign scopes in the Developer Portal configure modal — grouped by product and feature, matching the catalog below.

For endpoint-level scope requirements, see Token Scopes in the API reference.

Scope format​

Anatomy of a scope

product.feature.action

e.g. kyb.invite.read reads business invites · kyb.invite.write creates and manages them

product

The service area — e.g. kyb, kyc, file.

feature

The resource within that product — e.g. invite, report.

action

read to query · write to create, update & delete.

Available scopes (by product)​

Scopes are grouped by product, then feature. Each row is a scope string you assign to the app or pass in accessTokenScopes when requesting a token.

readquery & retrieve onlywritecreate, update & delete
Expand a product to view scopes by feature.|

The KYB (Know Your Business) scope grants access to business onboarding and verification — verification workflows, organization compliance data, verification status retrieval, and the full onboarding lifecycle. Required for platforms onboarding and managing business entities.

Invite
read
kyb.invite.read

List and retrieve pending and completed business invitations.

write
kyb.invite.write

Create, update, resend, and delete KYB business invites.

Onboarding
write
kyb.onboarding.write

Onboard new businesses through the KYB workflow.

Organization
read
kyb.organization.read

Read organization details, associated users, and business groups.

Verification
read
kyb.verification.read

Read business verification status and UBO task progress.

write
kyb.verification.write

Edit verification data and trigger reverification.

Report
read
kyb.report.read

Generate and read KYB compliance reports.

M2M Scope Usage

M2M scopes are for server-to-server API access only. They cannot be used for user authentication or login flows.


IDP Scopes (OIDC)​

IDP applications use OIDC scopes to control what identity information is returned.

ScopeDescriptionClaims ReturnedRequired
openidRequired for OIDCsub✅ Yes
profileBasic profilename, given_name, picture○ No
emailEmail addressemail, email_verified○ No
phonePhone numberphone_number, phone_number_verified○ No

Hosted UI Scopes​

Hosted UI does not use scopes. Access is controlled via the hosted auth flow and token claims.


Scope Assignment​

Scopes are assigned from the Developer Portal when you create or edit an application:

  1. Open Applications in the portal and pick the application.
  2. Open the Scopes section.
  3. Tick the scopes the application needs (M2M and IDP); Hosted UI does not expose this picker.
  4. Save — new tokens issued after the change carry the updated scope set.

See Create application — step-by-step for the full registration walkthrough.

Default Scopes​

  • IDP: If no scopes provided, defaults to openid, profile, email
  • M2M: No default scopes; all scopes must be explicitly assigned
  • Hosted UI: No scopes applicable

Scope Definitions (IDP)​

export const WebScopeDefinitions = {
[WebAppScopes.OPENID]: {
scope: "openid",
description: "Required for OpenID Connect authentication",
fields: ["sub"],
},
[WebAppScopes.PROFILE]: {
scope: "profile",
description: "Access to basic profile information",
fields: [
"name",
"given_name",
"family_name",
"picture",
"preferred_username",
"updated_at",
],
},
[WebAppScopes.EMAIL]: {
scope: "email",
description: "Access to email address",
fields: ["email", "email_verified"],
},
[WebAppScopes.PHONE]: {
scope: "phone",
description: "Access to phone number",
fields: ["phone_number", "phone_number_verified"],
},
};

Using M2M Scopes​

Requesting Scopes During Token Acquisition​

curl -X POST "https://sandbox-api.chainit.online/v1/auth/token" \
-H "Content-Type: application/json" \
-u "{clientId}:{clientSecret}" \
-d '{
"accessTokenScopes": [
"kyb.invite.read",
"file.upload.write",
"pactvera.request.read"
]
}'

Verifying Scopes in Token​

Decoded access token contains the granted scopes:

{
"scope": "kyb.invite.read file.upload.write pactvera.request.read",
"permissions": [
"kyb.invite.read",
"file.upload.write",
"pactvera.request.read"
],
"azp": "<<your_client_id>>",
"exp": 1715086400
}

Error Responses​

CodeDescriptionAction
INVALID_SCOPERequested scope not assigned to appUpdate app scopes in dev-portal
INSUFFICIENT_SCOPEToken does not have required scope for endpointRequest token with proper scopes

Best Practices​

Best practices
  • Least privilege: Only request scopes you need

  • Validate server-side: Always verify scopes on the receiving end

  • Token scopes: Granted scopes may be a subset of requested scopes

M2M Scope Usage

M2M scopes are for server-to-server API access only. They cannot be used for user authentication or login flows.