Developers

Search the docs

Search guides and headings.

Revoke a connection

PUT/care/v1/connection/{connection_id}/revoke/document
Scope: patient:writeBAA required

Ends a connection. Visits already booked stay booked, but can no longer be read or changed through your key. To connect again, call create with the same external_id and send the patient to the new connect_url. Raises a connection.revoked event. A connection that is already revoked or declined answers connection_not_active. Needs the patient:write scope.

Path parameters

  • connection_idstringrequired

    The ID of the connection to end.

    Min length 1 · Max length 200 · Pattern ^[A-Za-z0-9_-][A-Za-z0-9._-]{0,199}$

Response 200

  • approved_atstring (date-time)nullable

    When the patient approved the connection, in UTC. null until then.

  • company_idstringrequired

    The ID of your company, the one that owns the connection.

  • connection_idstringrequired

    The ID of the connection. Use it to read or revoke the connection and to match connection.approved, connection.declined and connection.revoked events.

  • created_atstring (date-time)required

    When the connection was created, in UTC.

  • external_idstringrequired

    Your own ID for the patient, as you sent it.

  • revoked_atstring (date-time)nullable

    When the connection ended, in UTC. null while it has not ended.

  • revoked_byenumnullable

    Who ended the connection: patient (the patient), partner (your company) or admin. null while it has not ended.

    • patient
    • partner
    • admin
  • scopesarray of enumrequired

    What the patient allowed your company to do. care.bookings books and reads visits, care.reports reads visit reports, care.health-profile reads and updates the health profile. Only the scopes your key may ask for are listed.

  • statusenumrequired

    pending until the patient decides, then active, declined or revoked. Nothing can be booked for the patient until the connection is active. Trust the connection.approved event or read the connection; never trust the status in the return URL, because anyone can edit a URL.

    • pending
    • active
    • declined
    • revoked
  • userstring (uuid)required

    The ID of the patient's Nurish'd user the connection is with. Use it to read the patient and, later, to book visits for them.

Errors

Every error has this shape. Branch on code, not on message. request_id equals the X-Request-Id response header.

jsonError response
{
  "error": {
    "code": "not_found",
    "message": "The object does not exist.",
    "request_id": "req_0123456789abcdef0123456789abcdef"
  }
}
StatusCodeMeaning
401invalid_api_keyThe API key is missing or not valid.
403company_archivedThis company is archived.
403company_not_liveThe company must be live to use prod keys.
403company_suspendedThis company is suspended.
403scope_not_grantedThis API key does not have the patient:write scope.
404not_foundThe requested resource was not found.
409connection_not_activeThe connection is not active.
422validation_errorpath.connection_id: String should match pattern '^[A-Za-z0-9_-][A-Za-z0-9._-]{0,199}$'
429rate_limitedToo many requests. Wait before calling again.
500internal_errorSomething went wrong on our side. Please try again later.
502upstream_errorA Nurish'd service could not complete the request.
503upstream_unavailableA Nurish'd service is unavailable. Please try again later.
504upstream_timeoutA Nurish'd service did not answer in time. Please try again.

All error codes and what to do about them