Scopes & permissions.
Understanding scope enforcement and what each permission level allows.
Scopes define what an agent key may do. Every agent endpoint checks the request's key for the required scope before executing. If the key lacks the required scope, the API rejects the request with a 403 error.
How scopes work
Each key carries an array of scopes assigned at creation. When a request hits an endpoint:
- The controller checks which scope(s) the endpoint requires
- The platform compares the key's scopes against the requirement
- If any required scope matches, the request proceeds (OR logic)
- If no scope matches, the platform returns a
403 AUTH_INSUFFICIENT_SCOPEerror
Available scopes
Read scope
| Scope | What It Allows |
|---|---|
read |
Read access to all resources (clubs, cards, members, rewards, etc.) |
The read scope is a global read permission. Any key with read can call any GET endpoint.
Write scopes
| Scope | What It Allows |
|---|---|
write:clubs |
Create, update, and delete clubs |
write:cards |
Create, update, and delete loyalty cards |
write:rewards |
Create, update, and delete rewards |
write:transactions |
Record purchases and deduct points |
write:stamps |
Create, update, and delete stamp cards; add stamps; redeem stamp rewards |
write:vouchers |
Create, update, and delete vouchers; validate and redeem voucher codes |
write:passes |
Create, update, and delete prepaid pass products; sell, scan, and undo visits |
write:tiers |
Create, update, and delete membership tiers |
write:staff |
Create, update, and delete staff members |
Write scopes are resource-specific. A key with write:transactions can record purchases but cannot create clubs.
Member write scopes
Member keys use a separate set of write scopes:
| Scope | What It Allows |
|---|---|
write:profile |
Update own profile (name, locale) |
write:redeem |
Submit reward claim requests |
Member write scopes are self-scoped. They affect the key owner's data and nothing else.
Super scope
| Scope | What It Allows |
|---|---|
admin |
Full access to all read and write operations |
The admin scope bypasses all scope checks. Use it for keys that need unrestricted access.
Admin scopes
Admin keys have platform-level scopes:
| Scope | What It Allows |
|---|---|
read:partners |
View all partner profiles and permissions |
write:partners |
Update partner permissions, activate/deactivate partners |
read:members |
Platform-wide member search and details |
read:analytics |
Platform and per-partner analytics metrics |
Scope hierarchy
Scopes follow a hierarchy:
graph LR
A["admin"] -->|"grants everything"| B["read"]
A --> C["write:*"]
C --> D["write:clubs"]
C --> E["write:cards"]
C --> F["write:rewards"]
C --> G["write:transactions"]
C --> H["write:stamps"]
C --> I["write:vouchers"]
C --> L["write:passes"]
C --> J["write:tiers"]
C --> K["write:staff"]
style A fill:#fef3c7,stroke:#f59e0b,stroke-width:2px,color:#92400e
How the hierarchy behaves:
- Write implies read on that resource. A key with
write:cardscan callGET /partner/cards, but cannot read members or other resources - Admin grants all. The
adminscope acts as a super-scope for everything - Read cannot write. A
readkey cannot create, update, or delete anything - Write scopes are isolated.
write:clubscannot read rewards,write:transactionscannot read staff
Permission presets
When creating a key in the dashboard, you choose from presets that map to scope arrays:
| Preset | Scopes | Best For |
|---|---|---|
| View | read |
Reporting dashboards, balance checks, AI queries |
| Point of Sale | read, write:transactions, write:rewards |
Point-of-sale systems (earn, burn, and rewards) |
| Full Management | read, write:cards, write:rewards, write:stamps, write:vouchers, write:passes, write:clubs |
Automation tools, general integrations |
| Full Access | admin |
Full programmatic control, development |
Member presets
Member keys have two presets:
| Preset | Scopes | Best For |
|---|---|---|
| View | read |
Balance checks, browsing rewards, transaction history |
| Full Access | read, write:redeem, write:profile |
Full wallet: claims + profile updates + save cards |
Admin presets
Admin keys manage the platform:
| Preset | Scopes | Best For |
|---|---|---|
| View | read:partners, read:members, read:analytics |
Monitoring dashboards, CRM exports |
| Standard | read:partners, read:members, read:analytics, write:partners |
SaaS billing integration, partner management |
| Full Access | admin |
Full platform control |
Endpoint scope requirements
Partner CRUD resources share one pattern:
| Request Type | Required Scope |
|---|---|
GET (list and detail) |
read or the resource's write scope |
POST, PUT, DELETE, and action endpoints |
The resource's write scope |
The pattern covers clubs (write:clubs), loyalty cards (write:cards), rewards (write:rewards), stamp cards (write:stamps), vouchers (write:vouchers), prepaid passes (write:passes), tiers (write:tiers), and staff (write:staff). Action endpoints, such as adding stamps or validating vouchers, require the same write scope as their resource.
See the Complete endpoint reference for the full per-endpoint listing with scopes, parameters, and response fields.
The groups below differ from the CRUD pattern:
Transactions
| Endpoint | Required Scope |
|---|---|
GET /partner/transactions |
read or write:transactions |
POST /partner/transactions/purchase |
write:transactions |
POST /partner/transactions/redeem |
write:rewards |
POST /partner/transactions/deduct |
write:transactions |
Redeeming a reward requires write:rewards, not write:transactions.
Members
Partner member endpoints are read-only. There is no write:members scope.
| Endpoint | Required Scope |
|---|---|
GET /partner/members |
read |
GET /partner/members/{id} |
read |
GET /partner/members/{id}/balance/{cardId} |
read |
Member key endpoints
| Endpoint | Required Scope |
|---|---|
GET /member/profile |
read |
PUT /member/profile |
write:profile |
GET /member/balance |
read |
GET /member/cards and GET /member/cards/{id} |
read |
GET /member/transactions and GET /member/transactions/{cardId} |
read |
GET /member/rewards |
read |
POST /member/rewards/{id}/claim |
write:redeem |
GET /member/passes and GET /member/passes/{id} |
read |
GET /member/discover |
read |
POST /member/discover/resolve |
read |
POST /member/discover/follow |
write:profile |
POST /member/discover/unfollow |
write:profile |
Following and unfollowing a card counts as a profile write. Both change the member's own "My Cards" collection, so they require write:profile.
Admin partners
| Endpoint | Required Scope |
|---|---|
GET /admin/partners |
read:partners |
GET /admin/partners/{id} |
read:partners |
PATCH /admin/partners/{id}/permissions |
write:partners |
POST /admin/partners/{id}/activate |
write:partners |
POST /admin/partners/{id}/deactivate |
write:partners |
Admin members
| Endpoint | Required Scope |
|---|---|
GET /admin/members |
read:members |
GET /admin/members/{id} |
read:members |
Admin analytics
| Endpoint | Required Scope |
|---|---|
GET /admin/analytics/overview |
read:analytics |
GET /admin/analytics/partners/{id} |
read:analytics |
Scope errors
When a key lacks the required scope:
{
"error": true,
"code": "AUTH_INSUFFICIENT_SCOPE",
"message": "This action requires the 'write:cards' scope.",
"retry_strategy": "no_retry",
"details": {
"required_scope": "write:cards"
}
}
The retry_strategy is no_retry. The key cannot gain scopes at runtime. Create a new key with the required scopes instead.
Related topics
- Tool Discovery: Machine-readable tool definitions filtered by the key's scopes
- Enabling & Managing Keys: Create keys with the right presets
- Authentication: How the platform verifies keys
- Error Handling: Full error response format