---
title: Scopes
description: The ten API scopes, which ones need a BAA, and how a key's scopes narrow the company's scopes.
section: Core concepts
order: 2
---

# Scopes

You will know which scope each route needs, how a key's scopes relate to the company's, and why patient data needs a BAA even to read.

## The ten scopes

Nurish'd grants scopes to your company. Each scope has the form `resource:action`.

| Scope                  | Lets a key                                                                                              | Needs a BAA |
| ---------------------- | ------------------------------------------------------------------------------------------------------- | ----------- |
| `catalog:read`         | Read vendors, menus, products, delivery zones and delivery dates                                        | No          |
| `order:write`          | Create a customer, revoke their connection, place orders, and save a customer's card                    | No          |
| `order:read`           | Read a customer, a connection, the orders it placed, and a customer's saved cards                       | No          |
| `specialist:read`      | List specialists, their services and open times                                                         | No          |
| `patient:write`        | Create a patient, read a patient, read or revoke a care connection, and save and list a patient's cards | Yes         |
| `booking:read`         | List and read the bookings it made                                                                      | Yes         |
| `booking:write`        | Book and cancel visits                                                                                  | Yes         |
| `report:read`          | Read signed reports of its bookings and see `report.signed` events                                      | Yes         |
| `health-profile:read`  | Read a connected patient's health profile                                                               | Yes         |
| `health-profile:write` | Update a connected patient's health profile                                                             | Yes         |

Every scope has routes. See [Care](/docs/care/connecting-a-patient), [Visit reports](/docs/care/reports) and [Health profiles](/docs/care/health-profiles).

## Company scopes and key scopes

- **The company holds scopes.** Only Nurish'd grants and removes them.
- **A key follows the company by default.** A key with no narrowed scopes holds all of the company's scopes.
- **A key can be narrowed.** An owner or admin can pick fewer scopes for one key, for example only `catalog:read`.
- **A key can never hold a scope the company lacks.** If Nurish'd removes a scope from the company, every key loses it within a minute.

Check what a key holds now with `GET /developer/v1/key/get/document`. Its `scopes` field is the key's scopes that your company still holds.

A call without the needed scope answers `403 scope_not_granted`:

```json
{
	"error": {
		"code": "scope_not_granted",
		"message": "This key does not hold the scope this route needs.",
		"request_id": "req-0001"
	}
}
```

The fix is to narrow less (use a key with the scope) or to ask Nurish'd to grant the scope to the company. Retrying does not help.

Events follow scopes too. A key lists and receives only the event types its scopes allow. See [Events](/docs/events/events).

## The BAA rule

A BAA is a business associate agreement. Nurish'd records its signing date on your company.

- Nurish'd cannot grant a scope marked "Yes" above to a company with no BAA.
- If the BAA is cleared, those scopes disappear from the company and from every key within a minute.
- A company with no BAA can use `catalog:read`, `order:read`, `order:write` and `specialist:read`, and nothing about any patient.

### Why read needs a BAA too

A booking says that a person sees a dietitian at a given time. Reading it discloses health information exactly as writing it does. So `booking:read` and `report:read` need a BAA, not only the write scopes.

See [BAA handling](/docs/care/baa) for what a company without a BAA can do.

The card routes follow the same scopes. Under care, starting, confirming and listing a card all need `patient:write`. Under meals, starting and confirming need `order:write` and listing needs `order:read`. See [Saving a card](/docs/care/saving-a-card) and [Saving a card for a customer](/docs/meals/saving-a-card).

## Connection scopes are different

Company scopes say what your company may ask for. A connection scope says what one customer or patient approved. They have different names, such as `meals.orders`. See [Connections](/docs/concepts/connections).

## Next

- [Connections](/docs/concepts/connections): what a customer approves.
- [BAA handling](/docs/care/baa): the rules for care scopes.
- [Managing keys](/docs/console/managing-keys): narrow a key in the console.
