# Scopes

A scope names one kind of resource and whether the key may read or write it. This page is generated from the server's own rules.

## How scopes work

- A key with no scopes has full access. So does a key with the scope `*`.
- A `:write` scope includes the matching `:read`. A key that can create a customer can read it back.
- A key whose scopes cover no write at all is refused on every `POST`, `PUT`, `PATCH` and `DELETE`.
- An endpoint that belongs to no scope needs full access.
- A request outside the key's scopes answers `403 forbidden`, and the message names the scope it needs, for example `api key scope checkout:write required`.

Choose scopes when you create a key in the dashboard. The dashboard sends them like this (key management needs a signed-in session, not an API key):

```json title="POST /api/v1/api-keys"
{
  "name": "Usage reporter",
  "key_type": "developer",
  "scopes": ["usage:write", "entitlements:read"]
}
```

A key takes at most 50 scopes. A publishable key takes none.

## Every scope

Open a row to see the endpoints it allows.

| Scope | Opens |
| --- | --- |
| `customers:read` | Read customers, their balance history, saved payment methods, subscriptions and invoices. |
| `customers:write` | Create and update customers, save or remove payment methods, set tax details and grant credits. |
| `subscriptions:read` | Read subscriptions, their discounts and their invoices. |
| `subscriptions:write` | Create, change, pause, resume and cancel subscriptions, and manage their items and discounts. |
| `checkout:write` | Open hosted checkout sessions. |
| `portal:write` | Open customer portal sessions. |
| `entitlements:read` | Read what a customer may use: plan, features, limits, credits and usage. |
| `usage:read` | Read usage totals. |
| `usage:write` | Report usage and consume credits. |
| `invoices:read` | Read invoices, credit notes, refunds and invoice PDFs. |
| `invoices:write` | Create, finalize, charge, void and settle invoices, and issue credit notes. Refunds need full access. |
| `catalog:read` | Read products, plans, features, meters, coupons, tax rates and pricing tables. |
| `catalog:write` | Create and change products, plans, features, meters, coupons, tax rates and pricing tables. |
| `webhooks:read` | Read webhook endpoints and their delivery history. |
| `webhooks:write` | Add, change, rotate and remove webhook endpoints, and replay deliveries. |

**`customers:read`**

- `GET /api/v1/customers`
- `GET /api/v1/customers/{id}`
- `GET /api/v1/customers/{id}/balance-transactions`
- `GET /api/v1/customers/{id}/invoices`
- `GET /api/v1/customers/{id}/payment-methods`
- `GET /api/v1/customers/{id}/subscriptions`
- `GET /api/v1/customers/by-external-id/{externalId}`

**`customers:write`**

- `POST /api/v1/customers`
- `POST /api/v1/customers/{id}/credits/grant`
- `POST /api/v1/customers/{id}/payment-methods`
- `DELETE /api/v1/customers/{id}/payment-methods/{pmId}`
- `POST /api/v1/customers/{id}/setup-intent`
- `PUT /api/v1/customers/{id}/tax`
- `PUT /api/v1/customers/by-external-id/{externalId}`
- `POST /api/v1/customers/by-external-id/{externalId}/credits/grant`

**`subscriptions:read`**

- `GET /api/v1/subscriptions`
- `GET /api/v1/subscriptions/{id}`
- `GET /api/v1/subscriptions/{id}/discounts`
- `GET /api/v1/subscriptions/{id}/invoices`

**`subscriptions:write`**

- `POST /api/v1/subscriptions`
- `PATCH /api/v1/subscriptions/{id}`
- `POST /api/v1/subscriptions/{id}/cancel`
- `POST /api/v1/subscriptions/{id}/change-plan`
- `POST /api/v1/subscriptions/{id}/change-plan/preview`
- `POST /api/v1/subscriptions/{id}/discounts`
- `DELETE /api/v1/subscriptions/{id}/discounts/{discountId}`
- `POST /api/v1/subscriptions/{id}/items`
- `DELETE /api/v1/subscriptions/{id}/items/{itemId}`
- `PATCH /api/v1/subscriptions/{id}/items/{itemId}`
- `POST /api/v1/subscriptions/{id}/pause`
- `DELETE /api/v1/subscriptions/{id}/pending-change`
- `POST /api/v1/subscriptions/{id}/reactivate`
- `POST /api/v1/subscriptions/{id}/resume`

**`checkout:write`**

- `POST /api/v1/checkout-sessions`

**`portal:write`**

- `POST /api/v1/portal-sessions`

**`entitlements:read`**

- `GET /api/v1/customers/{id}/entitlements`
- `GET /api/v1/customers/by-external-id/{externalId}/entitlements`

**`usage:read`**

- `GET /api/v1/meter-events/summary`
- `GET /api/v1/usage-events/aggregate`

**`usage:write`**

- `POST /api/v1/customers/{id}/credits/consume`
- `POST /api/v1/customers/by-external-id/{externalId}/credits/consume`
- `POST /api/v1/meter-events`
- `POST /api/v1/usage-events`

**`invoices:read`**

- `GET /api/v1/credit-notes/{id}`
- `GET /api/v1/invoices`
- `GET /api/v1/invoices/{id}`
- `GET /api/v1/invoices/{id}/credit-notes`
- `GET /api/v1/invoices/{id}/pdf`
- `GET /api/v1/invoices/{id}/refunds`

**`invoices:write`**

- `POST /api/v1/invoices`
- `POST /api/v1/invoices/{id}/charge`
- `POST /api/v1/invoices/{id}/credit-notes`
- `POST /api/v1/invoices/{id}/finalize`
- `POST /api/v1/invoices/{id}/pay-link`
- `POST /api/v1/invoices/{id}/record-payment`
- `POST /api/v1/invoices/{id}/uncollectible`
- `POST /api/v1/invoices/{id}/void`
- `POST /api/v1/invoices/one-off`

**`catalog:read`**

- `GET /api/v1/coupons`
- `GET /api/v1/coupons/{id}`
- `GET /api/v1/entitlement-settings`
- `GET /api/v1/features`
- `GET /api/v1/features/{id}`
- `GET /api/v1/meters`
- `GET /api/v1/meters/{id}`
- `GET /api/v1/plans`
- `GET /api/v1/plans/{id}`
- `GET /api/v1/plans/{id}/entitlements`
- `GET /api/v1/plans/{id}/price-changes/preview`
- `GET /api/v1/pricing-tables`
- `GET /api/v1/pricing-tables/{id}`
- `GET /api/v1/products`
- `GET /api/v1/products/{id}`
- `GET /api/v1/promotion-codes`
- `GET /api/v1/promotion-codes/{id}`
- `POST /api/v1/promotion-codes/validate`
- `GET /api/v1/tax-rates`
- `GET /api/v1/tax-rates/{id}`
- `POST /api/v1/tax-rates/calculate`

**`catalog:write`**

- `POST /api/v1/coupons`
- `DELETE /api/v1/coupons/{id}`
- `PATCH /api/v1/coupons/{id}`
- `PUT /api/v1/entitlement-settings`
- `POST /api/v1/features`
- `PATCH /api/v1/features/{id}`
- `POST /api/v1/meters`
- `PATCH /api/v1/meters/{id}`
- `POST /api/v1/plans`
- `PATCH /api/v1/plans/{id}`
- `PUT /api/v1/plans/{id}/entitlements`
- `POST /api/v1/plans/{id}/price-changes`
- `PUT /api/v1/plans/{id}/price-points`
- `PUT /api/v1/plans/by-code/{code}`
- `POST /api/v1/pricing-tables`
- `DELETE /api/v1/pricing-tables/{id}`
- `PATCH /api/v1/pricing-tables/{id}`
- `POST /api/v1/products`
- `PATCH /api/v1/products/{id}`
- `POST /api/v1/promotion-codes`
- `DELETE /api/v1/promotion-codes/{id}`
- `PATCH /api/v1/promotion-codes/{id}`
- `POST /api/v1/tax-rates`
- `DELETE /api/v1/tax-rates/{id}`
- `PATCH /api/v1/tax-rates/{id}`

**`webhooks:read`**

- `GET /api/v1/webhook-endpoints`
- `GET /api/v1/webhook-endpoints/{id}/deliveries`

**`webhooks:write`**

- `POST /api/v1/webhook-endpoints`
- `DELETE /api/v1/webhook-endpoints/{id}`
- `PATCH /api/v1/webhook-endpoints/{id}`
- `POST /api/v1/webhook-endpoints/{id}/end-secret-overlap`
- `POST /api/v1/webhook-endpoints/{id}/replay`
- `POST /api/v1/webhook-endpoints/{id}/rotate-secret`
- `POST /api/v1/webhook-endpoints/{id}/test`
- `POST /api/v1/webhook-endpoints/deliveries/{id}/replay`

**Full access only (`*`)**

- `GET /api/v1/audit-log`
- `GET /api/v1/dashboard`
- `GET /api/v1/gateway-credentials/stripe`
- `POST /api/v1/gateway-credentials/stripe/{mode}/check`
- `GET /api/v1/onboarding`
- `GET /api/v1/price-changes`
- `GET /api/v1/price-changes/{id}`
- `POST /api/v1/price-changes/{id}/cancel`
- `GET /api/v1/settings`
- `GET /api/v1/team/invites`
- `GET /api/v1/team/members`

**No API key (signed-in users only)**

- `POST /api/v1/invoices/{id}/refunds`
- `PATCH /api/v1/settings`
- `DELETE /api/v1/settings`
- `PUT /api/v1/gateway-credentials/stripe`
- `DELETE /api/v1/gateway-credentials/stripe/{mode}`
- `PATCH /api/v1/team/members/{userId}`
- `DELETE /api/v1/team/members/{userId}`
- `POST /api/v1/team/invites`
- `DELETE /api/v1/team/invites/{id}`
- `POST /api/v1/api-keys`
- `GET /api/v1/api-keys`
- `DELETE /api/v1/api-keys/{id}`
- `POST /api/v1/api-keys/{id}/roll`

## Older keys

Keys created before scopes were enforced may carry `read` or `write`. They still work: `write` means full access, and `read` means every `:read` scope.
