Developers

Search the docs

Search guides and headings.

Connections

A connection is a customer's or patient's consent for your company to act for them; learn its statuses, scopes and return URLs.

View as Markdown

You will understand how a customer or patient agrees that your company may act for them, and how to follow that agreement safely.

Your company cannot act for a person until they say so. The person approves on a Nurish'd page, not on yours. The record of that approval is a connection.

  1. You create the customer (meals) or patient (care). The answer holds a connect_url.
  2. You send the person to the connect_url as a full page or a new tab. Never open it in a frame or a web view. The page refuses to render inside another site.
  3. The person approves or declines on the Nurish'd page.
  4. Nurish'd sends them back to your return URL, if you gave one.
  5. You learn the result from an event or by reading the connection.

The connect_url is valid for 24 hours and works once. Create again with the same external_id to get a fresh link.

Statuses#

StatusMeaning
pendingWaiting for the person to decide. Nothing can be done for them yet.
activeThe person approved.
declinedThe person declined. Start again with a fresh link.
revokedThe connection ended. The person, your company or Nurish'd can revoke. revoked_by says who: patient (the customer or patient), partner (your company) or admin.

A connection that is not active refuses actions with 409 connection_not_active. A care connection and a meals connection have the same shape. user is the id of the customer or patient.

json
{
	"connection_id": "connection-0001",
	"company_id": "company-0001",
	"user": "6f1c0d2e-0000-4000-8000-000000000101",
	"external_id": "customer-1001",
	"status": "active",
	"scopes": ["meals.orders"],
	"created_at": "2026-11-30T15:04:05Z",
	"approved_at": "2026-11-30T15:10:12Z",
	"revoked_at": null,
	"revoked_by": null
}

Connection scopes#

A connection carries what the person approved.

Connection scopeWhat the person approvesCompany scope it needs
meals.ordersPlace meal orders for them and see the orders placedorder:write
care.bookingsBook and manage visitsbooking:write
care.reportsReceive reports of visits you bookreport:read
care.health-profileRead and update the health profilehealth-profile:read or health-profile:write

If a call needs a connection scope the person did not approve, it answers 403 connection_scope_not_granted. For care, the patient is asked to allow every care scope your key can use when you create the patient.

Care scopes need a signed BAA on your company, and the patient signs the health privacy agreement and the telehealth consent on the connect page. See BAA handling.

Return URLs#

You can pass a return_url when you create a customer or a patient. The person goes there after the approval page.

  • Return URLs must be allowlisted in the console. Owners and admins manage them. See Company settings.
  • A return_url that is not on the list answers 422 validation_error.
  • The return URL carries connection_id and status.
text
https://shop.example.com/nurishd/return?connection_id=connection-0001&status=approved

One external id per person#

A customer or patient is known to your company under one external_id. Create refuses two requests with 409 and creates nothing: external_id_conflict when the external_id already belongs to someone with a different email, and person_already_connected when the email is already connected under a different external_id. Keep using the first id.

Asking for more scopes later#

Create again with the same external_id and a scope the connection does not hold. The connection goes back to pending with the old and new scopes together, and you get a fresh link. Nothing works for that person until they approve again.

Events#

EventWhen
connection.approvedThe person approved.
connection.declinedThe person declined.
connection.revokedThe connection ended.

Each event carries the connection id. See Events.

Revoke#

Your company revokes a connection with PUT /meals/v1/connection/{connection_id}/revoke/document (meals) or PUT /care/v1/connection/{connection_id}/revoke/document (care). The person can revoke in their Nurish'd account. Revoking raises connection.revoked.

Next#