Developers

Search the docs

Search guides and headings.

Scopes

The ten API scopes, which ones need a BAA, and how a key's scopes narrow the company's scopes.

View as Markdown

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.

ScopeLets a keyNeeds a BAA
catalog:readRead vendors, menus, products, delivery zones and delivery datesNo
order:writeCreate a customer, revoke their connection, place orders, and save a customer's cardNo
order:readRead a customer, a connection, the orders it placed, and a customer's saved cardsNo
specialist:readList specialists, their services and open timesNo
patient:writeCreate a patient, read a patient, read or revoke a care connection, and save and list a patient's cardsYes
booking:readList and read the bookings it madeYes
booking:writeBook and cancel visitsYes
report:readRead signed reports of its bookings and see report.signed eventsYes
health-profile:readRead a connected patient's health profileYes
health-profile:writeUpdate a connected patient's health profileYes

Every scope has routes. See Care, Visit reports and 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.

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 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 and Saving a card for a customer.

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.

Next#