Curae Platform
API referenceSDK Connections

Create an SDK patient connection

Starts a connection-oriented Curae Connect flow for the SDK app's authenticated user coordinate, asking for `scope` (SMART App Launch 2.x scopes). The response returns a durable `connection.id` used as `connectionId` in subsequent SDK gateway request bodies, and the granted `scope` in its canonical form. If user action is required, `nextAction` contains the Curae-hosted page to open, once, in the system browser or a top-level browser window; an embedded web view is not supported. A scope that does not parse, that the SDK does not serve, or that lies outside the scope Curae approved the app for is `400` with `code` `invalid_scope` and `details.scope` naming it. An app Curae has not approved for live access is refused `403` `LIVE_ACCESS_NOT_APPROVED`, with either kind of key. If the person taps Don't Allow, nothing is shared: the connection is revoked with the reason `access_denied`, and the person returns to `handoffReturnUrl` with `error=access_denied`.

POST
/api/sdk/v1/connections

Starts a connection-oriented Curae Connect flow for the SDK app's authenticated user coordinate, asking for scope (SMART App Launch 2.x scopes). The response returns a durable connection.id used as connectionId in subsequent SDK gateway request bodies, and the granted scope in its canonical form. If user action is required, nextAction contains the Curae-hosted page to open, once, in the system browser or a top-level browser window; an embedded web view is not supported. A scope that does not parse, that the SDK does not serve, or that lies outside the scope Curae approved the app for is 400 with code invalid_scope and details.scope naming it. An app Curae has not approved for live access is refused 403 LIVE_ACCESS_NOT_APPROVED, with either kind of key. If the person taps Don't Allow, nothing is shared: the connection is revoked with the reason access_denied, and the person returns to handoffReturnUrl with error=access_denied.

Authorization

platformApiKey
headerAuthorizationBearer <token>

Curae Platform API key using the format Bearer . Keys are opaque credentials such as cae_live_..., not JWTs.

Header Parameters

Idempotency-Key*string

Required idempotency key for safe connection-create retries.

Match^[A-Za-z0-9_-]+$
Lengthlength <= 255

Request Body

application/json
  1. body
appUserId*string
Length1 <= length <= 256
brandId?string

Optional opaque SdkCatalogBrand.id from the public catalog. On the silent limited-account path, the hosted Connect flow attempts this institution directly and falls back to its manual picker if the ID is invalid or stale. Other connection paths ignore this hint.

Length1 <= length <= 2048
scope*string

What a connection reads and writes: a space-separated list of SMART App Launch 2.x scopes, as an OAuth client sends them (RFC 6749 §3.3). patient/Observation.rs, patient/Condition.rs and patient/Immunization.rs, each optionally narrowed by one US Core category, the type's codes (code, or vaccine-code for Immunization) and a first day (date=ge<YYYY-MM-DD>, or onset-date for Condition); patient/*.rs?_security=http://terminology.hl7.org/CodeSystem/v3-ActCode|<code> for a sensitive category, read for every record type the scope asks for; and patient/Observation.c?code=https://curaeai.com/fhir/CodeSystem/sdk-signal/<namespace>|<code> for a signal the app writes, at any payload version. A scope the SDK does not serve, or outside what Curae approved the app for, is 400 invalid_scope. The connection returns the granted scope in its canonical form: per type, each list in one order, each code with its system. A sensitive category is off on the Curae Connect screen until the person turns it on, so an authorized connection's scope names only the sensitive categories they granted (SMART App Launch: the scope granted may be narrower than the scope requested).

Match^[!#-\[\]-~]+( [!#-\[\]-~]+)*$
Length1 <= length <= 32768
handoffReturnUrl?|

Where the Curae Connect handoff sends the person back. One of the return addresses registered for the app on Account settings in Curae Platform, exactly as listed there; any other is 400 with code invalid_redirect_uri. Curae sends the person back to it only while it is still registered and the app's website domain is still verified.

Formaturi
Lengthlength <= 2048
deviceKeyCnf?|null
refreshTokenHash?|
Match^[0-9a-f]{64}$
sessionTtlSeconds?integer
Range60 <= value <= 900
authorizationTtlSeconds?integer
Range300 <= value <= 31536000
preferSignup?boolean

Response Body

SDK connection created or recovered from idempotent replay.

application/json
  1. response
connection*
nextAction*|null
Example Request
curl -X POST 'https://api.curaeai.com/api/sdk/v1/connections' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "appUserId": "string",  "scope": "string"}'
Example Response
{  "connection": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "customerAccountId": "d8c60791-7301-441c-98e8-5bea9a162d9b",    "appUserId": "string",    "status": "PENDING",    "scope": "string",    "authorizedAt": "2019-08-24T14:15:22Z",    "expiresAt": "2019-08-24T14:15:22Z",    "revokedAt": "2019-08-24T14:15:22Z",    "actionRequiredReason": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  },  "nextAction": {    "type": "open_webview",    "url": "http://example.com",    "expiresAt": "2019-08-24T14:15:22Z"  }}