### Tidepool API Sample Request with Tracing Headers Source: https://tidepool.redocly.app/docs/quick-start An example HTTP GET request to the Tidepool API that includes custom tracing headers: 'X-Tidepool-Trace-Request' for individual request tracing and 'X-Tidepool-Trace-Session' for session-based tracing. ```http GET /v1/users/a43d25a01f/images HTTP/1.1 Host: int-api.tidepool.org X-Tidepool-Trace-Request: c836ab48d92c4789abb38d759a021b3e X-Tidepool-Trace-Session: a4928790fbc02cabd749dbc920eb9c73 ``` -------------------------------- ### API Tracing Headers Source: https://tidepool.redocly.app/docs/quick-start Information on using tracing headers for request and session tracing in the Tidepool API. ```APIDOC ## API Tracing ### Description All Tidepool API requests may include two HTTP headers to trace requests and 'sessions' of requests throughout the Tidepool ecosystem. ### Headers - **X-Tidepool-Trace-Request** (string) - Allows for a 1-64 character string value to be associated with all server logging during the request. If not specified, one is generated and returned in the response. The client should capture this header value with any failure for future analysis. - **X-Tidepool-Trace-Session** (string) - Allows for a 1-64 character string value to be associated with all server logging during a 'session' of requests. If not specified by the client, no header is returned in the response. The client should capture this header value with any failure for future analysis. ### Request Example ```http GET /v1/users/a43d25a01f/images HTTP/1.1 Host: int-api.tidepool.org X-Tidepool-Trace-Request: c836ab48d92c4789abb38d759a021b3e X-Tidepool-Trace-Session: a4928790fbc02cabd749dbc920eb9c73 ``` ``` -------------------------------- ### Get Device Settings Source: https://tidepool.redocly.app/reference/prescription.v1/prescriptions/listclinicprescriptions Retrieves the initial settings and therapy configurations for a device. This endpoint allows fetching detailed device setup information, including insulin models, glucose targets, and calculator settings. ```APIDOC ## GET /websites/tidepool_redocly_app/settings ### Description Retrieves the initial settings and therapy configurations for a device. This endpoint allows fetching detailed device setup information, including insulin models, glucose targets, and calculator settings. ### Method GET ### Endpoint /websites/tidepool_redocly_app/settings ### Parameters #### Query Parameters - **clinicId** (string) - Required - Clinic identifier. Example: "2fe2488217ee43e1b2e83c2f" ### Response #### Success Response (200) - **latestRevision.attributes.initialSettings.bloodGlucoseSuspendThreshold** (object) - Initial blood glucose suspend threshold settings. - **latestRevision.attributes.initialSettings.insulinModel** (string) - The insulin model used by the pump. Enum: "rapidChild", "rapidAdult". - **latestRevision.attributes.initialSettings.pumpId** (string) - The unique identifier for the insulin pump. - **latestRevision.attributes.initialSettings.cgmId** (string) - The unique identifier for the continuous glucose monitor (CGM). - **latestRevision.attributes.initialSettings.bloodGlucoseTargetPhysicalActivity** (any) - Target blood glucose level during physical activity. - **latestRevision.attributes.initialSettings.bloodGlucoseTargetPreprandial** (any) - Target blood glucose level before meals. - **latestRevision.attributes.training** (string) - The type of training received. Enum: "inPerson", "inModule". - **latestRevision.attributes.therapySettings** (string) - The current therapy settings. Enum: "initial", "transferPumpSettings". - **latestRevision.attributes.prescriberTermsAccepted** (boolean) - Indicates if the prescriber's terms have been accepted. - **latestRevision.attributes.calculator** (object) - Configuration for the insulin calculation algorithm. - **calculator.method** (string) - The method used for insulin calculation. Enum: "weight", "totalDailyDose", "totalDailyDoseAndWeight". - **calculator.weight** (number) - The user's weight. Required if method is 'weight' or 'totalDailyDoseAndWeight'. - **calculator.weightUnits** (string) - Units for the user's weight. Required if method is 'weight' or 'totalDailyDoseAndWeight'. Enum: "kg", "lbs". - **calculator.totalDailyDoseScaleFactor** (number) - Scale factor for total daily dose. Required if method is 'totalDailyDose' or 'totalDailyDoseAndWeight'. At present, only options are 1 and 0.75. - **calculator.totalDailyDose** (number) - The total daily insulin dose. Required if method is 'totalDailyDose' or 'totalDailyDoseAndWeight'. - **calculator.recommendedBasalRate** (number) - The recommended basal insulin rate. - **calculator.recommendedInsulinSensitivity** (number) - The recommended insulin sensitivity factor. - **calculator.recommendedCarbohydrateRatio** (number) - The recommended carbohydrate-to-insulin ratio. - **latestRevision.attributes.revisionHash** (string) - Canonicalized and SHA-512-encrypted hex output of the sent revision payload. - **latestRevision.attributes.caregiverFirstName** (string) - First name of the caregiver. - **latestRevision.attributes.caregiverLastName** (string) - Last name of the caregiver. - **latestRevision.attributes.accountType** (string) - The type of user account. Enum: "patient", "caregiver". #### Response Example { "latestRevision": { "attributes": { "initialSettings": { "bloodGlucoseSuspendThreshold": {}, "insulinModel": "rapidAdult", "pumpId": "pump123", "cgmId": "cgm456", "bloodGlucoseTargetPhysicalActivity": 120, "bloodGlucoseTargetPreprandial": 100 }, "training": "inModule", "therapySettings": "initial", "prescriberTermsAccepted": true, "calculator": { "method": "totalDailyDose", "weight": 70, "weightUnits": "kg", "totalDailyDoseScaleFactor": 0.75, "totalDailyDose": 40, "recommendedBasalRate": 1.5, "recommendedInsulinSensitivity": 30, "recommendedCarbohydrateRatio": 15 }, "revisionHash": "a1b2c3d4e5f6...", "caregiverFirstName": "John", "caregiverLastName": "Doe", "accountType": "patient" } } } #### Error Response (400) - **code** (integer) - Error reason code. - **reason** (string) - Error reason text. #### Error Response (401) - **code** (integer) - Error reason code. - **reason** (string) - Error reason text. #### Error Response (403) - **code** (integer) - Error reason code. - **reason** (string) - Error reason text. #### Error Response (500) - **code** (integer) - Error reason code. - **reason** (string) - Error reason text. ``` -------------------------------- ### API Error Handling Source: https://tidepool.redocly.app/docs/quick-start Details on how the Tidepool API handles errors using standard HTTP status codes and JSON error responses. ```APIDOC ## Errors ### Description The Tidepool API uses standard HTTP status codes to indicate success or failure of any API call. In the case of failure, the body of the response will provide developer guidance in UTF-8 JSON format. ### Error Response Format - **code** (string) - Required. An error code. - **title** (string) - Required. A human-readable error title. - **detail** (string) - Required. A detailed explanation of the error. - **source** (string) - Optional. The source or location of the error. - **metadata** (object) - Optional. Additional metadata about the error. ### Common Status Codes - `400` Bad Request - `401` Unauthorized - `403` Forbidden - `404` Not Found - `413` Payload Too Large - `429` Too Many Requests - `500` Internal Server Error ### Sample Error Response ```json { 'code': 'length-out-of-range', 'title': 'length is out of range', 'detail': 'length 101 is not less than or equal to 100', 'source': '/name', 'metadata': { 'type': 'image' } } ``` ``` -------------------------------- ### User Authentication API Source: https://tidepool.redocly.app/docs/quick-start Authenticates a user with their email and password to obtain a session token and user ID. ```APIDOC ## POST /auth/login ### Description Authenticates a user using their email and password to obtain a Tidepool session token and user ID. This is a prerequisite for making authenticated requests to the Tidepool API. ### Method POST ### Endpoint https://int-api.tidepool.org/auth/login ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body This endpoint uses Basic Authentication. The username is the user's email and the password is their account password. ### Request Example ```http curl -i -X POST -u [your account email]:[your account password] https://int-api.tidepool.org/auth/login ``` ### Response #### Success Response (200) - **X-Tidepool-Session-Token** (string) - The session token for authenticated requests. - **userid** (string) - The unique identifier for the user. - **emailVerified** (boolean) - Indicates if the user's email has been verified. - **emails** (array of strings) - A list of the user's email addresses. - **termsAccepted** (string) - The date and time the terms were accepted. #### Response Example ```json { "emailVerified": true, "emails": [ "demo+intpublicclinic@tidepool.org" ], "termsAccepted": "2017-08-16T10:30:5607:00", "userid": "4533925fea", "username": "demo+intpublicclinic@tidepool.org" } ``` ``` -------------------------------- ### Tidepool API Sample Response for Authentication Source: https://tidepool.redocly.app/docs/quick-start A sample HTTP response from the Tidepool API after a successful authentication request. It includes CORS headers, a Tidepool session token in the 'X-Tidepool-Session-Token' header, and a JSON body with user information such as email, terms accepted date, user ID, and username. ```http Access-Control-Allow-Headers: Authorization, Content-Type, X-Tidepool-Session-Token Access-Control-Allow-Methods: GET, POST, PUT X-Tidepool-Session-Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkdXIiOjIuNTkyZSswNiwiZXhwIjoxNDcxMTM0MzIzLCJzdnIiOiJubyIsInVzciI6IjU0YzkwZmIzMjUifQ.bbkzG_rwp9IVMI3HVYm_ct8mMW_YTnTALUW12345678 Connection: keep-alive { "emailVerified": true, "emails": [ "demo+intpublicclinic@tidepool.org" ], "termsAccepted": "2017-08-16T10:30:5607:00", "userid": "4533925fea", "username": "demo+intpublicclinic@tidepool.org" } ``` -------------------------------- ### Sample User Data Response - JSON Source: https://tidepool.redocly.app/docs/quick-start This JSON array represents a sample response from the Tidepool API when fetching user information. It includes details such as email verification status, user IDs, profile information (including patient details like birthday and target devices), and trustor permissions. ```json [ { "emailVerified": true, "emails": [ "demo+jill@tidepool.org" ], "termsAccepted": "2017-08-03T12:19:54-07:00", "userid": "5d509deb6b", "username": "demo+jill@tidepool.org", "trustorPermissions": { "view": {} }, "profile": { "fullName": "Jill Jellyfish", "patient": { "birthday": "2000-01-01", "diagnosisDate": "2000-01-01", "targetDevices": [ "omnipod", "dexcom" ], "targetTimezone": "US/Pacific" } } }, { "userid": "0223d994e9", "trustorPermissions": { "custodian": {}, "upload": {}, "view": {} }, "profile": { "fullName": "Marissa Medpumper", "patient": { "birthday": "2000-01-17", "mrn": "123456-mm", "targetDevices": [ "carelink" ], "targetTimezone": "US/Pacific" } } } ] ``` -------------------------------- ### Tidepool API Sample Error Response Source: https://tidepool.redocly.app/docs/quick-start This JSON object represents a typical error response from the Tidepool API. It includes required fields like 'code', 'title', and 'detail', along with optional fields such as 'source' and 'metadata' to provide more context about the error. ```json { 'code': 'length-out-of-range', 'title': 'length is out of range', 'detail': 'length 101 is not less than or equal to 100', 'source': '/name', 'metadata': { 'type': 'image' } } ``` -------------------------------- ### Fetch User Information by User ID - JSON Request Source: https://tidepool.redocly.app/docs/quick-start This JSON request demonstrates how to fetch user information associated with a given user ID from the Tidepool API. It requires a session token for authentication and specifies the content type. ```json { "method": "get", "url": "https://int-api.tidepool.org/metadata/users/{userId}/users", "query": null, "headers": { "X-Tidepool-Session-Token": "{sessionToken}", "Content-Type": "application/json" } } ``` -------------------------------- ### Tidepool API Authentication Request Details Source: https://tidepool.redocly.app/docs/quick-start This JSON object outlines the details of an API request for authentication. It specifies the HTTP method, URL, headers (including Authorization and Content-Type), and indicates that the body is null for this particular request. ```json { "method": "post", "url": "https://int-api.tidepool.org/auth/login", "query": null, "headers": { "Authorization": "Basic {username:password as Base64}", "Content-Type": "application/json" }, "body": null } ``` -------------------------------- ### Access User Accounts Source: https://tidepool.redocly.app/docs/quick-start Retrieves a list of user accounts associated with the provided user ID. This is useful for identifying the specific user whose data you intend to fetch. ```APIDOC ## GET /metadata/users/{userId}/users ### Description Retrieves user information associated with the given user ID. This is a prerequisite step to identify the specific user whose data you wish to fetch. ### Method GET ### Endpoint `https://int-api.tidepool.org/metadata/users/{userId}/users` ### Parameters #### Path Parameters - **userId** (string) - Required - The ID of the user whose associated accounts are to be retrieved. #### Query Parameters None #### Request Body None ### Request Example ```json { "method": "get", "url": "https://int-api.tidepool.org/metadata/users/{userId}/users", "query": null, "headers": { "X-Tidepool-Session-Token": "{sessionToken}", "Content-Type": "application/json" } } ``` ### Response #### Success Response (200) - **Array of User Objects** (array) - Contains user details including `userid`, `emailVerified`, `emails`, `termsAccepted`, `username`, `trustorPermissions`, and `profile`. #### Response Example ```json [ { "emailVerified": true, "emails": [ "demo+jill@tidepool.org" ], "termsAccepted": "2017-08-03T12:19:54-07:00", "userid": "5d509deb6b", "username": "demo+jill@tidepool.org", "trustorPermissions": { "view": {} }, "profile": { "fullName": "Jill Jellyfish", "patient": { "birthday": "2000-01-01", "diagnosisDate": "2000-01-01", "targetDevices": [ "omnipod", "dexcom" ], "targetTimezone": "US/Pacific" } } }, { "userid": "0223d994e9", "trustorPermissions": { "custodian": {}, "upload": {}, "view": {} }, "profile": { "fullName": "Marissa Medpumper", "patient": { "birthday": "2000-01-17", "mrn": "123456-mm", "targetDevices": [ "carelink" ], "targetTimezone": "US/Pacific" } } } ] ``` ``` -------------------------------- ### API Setup for Partner Integration Source: https://tidepool.redocly.app/docs/partner-integration Describes the one-time setup process required for Tidepool Data Platform to fetch user data from partner cloud services. ```APIDOC ## API Setup for Partner Integration ### Description This section outlines the necessary steps for establishing a connection between a partner cloud service and the Tidepool Data Platform. This involves exchanging technical information to enable authentication, authorization, and data fetching. ### Method N/A (Setup Process Description) ### Endpoint N/A (Setup Process Description) ### Parameters #### 1. Partner Provides API Documentation - Partner must provide documentation for API endpoints used for authentication, authorization, and data retrieval. #### 2. Partner Provides Guidance on API Restrictions - Geographical restrictions - IP address restrictions - Token lifetime restrictions - API call frequency limits - Data batch size limits - Service blackout or maintenance windows #### 3. Tidepool Provides Redirect URLs - Tidepool will provide the URLs for browser redirection after the partner's authentication and authorization flow. #### 4. Partner Provides Service Credentials - For OAuth flow, partner must provide `client_id` and `client_secret` for service-to-service API requests. ### Request Example N/A (Setup Process Description) ### Response N/A (Setup Process Description) ``` -------------------------------- ### Example Scheduled Basal Event with Temp Override Start (JSON) Source: https://tidepool.redocly.app/docs/device-data/data-types/basal/suppressed Shows how a scheduled basal event is truncated when a temporary basal starts mid-segment. The duration is reduced to reflect only the time until the temp basal begins. ```json { "type": "basal", "deliveryType": "scheduled", "duration": 1500000, "rate": 0.25, "scheduleName": "Standard", "clockDriftOffset": 0, "conversionOffset": 0, "deviceId": "DevId0987654321", "deviceTime": "2016-10-07T00:00:00", "time": "2016-10-07T07:00:00.000Z", "timezoneOffset": -420, "uploadId": "SampleUploadId" } ``` -------------------------------- ### Get Message Thread by ID Source: https://tidepool.redocly.app/reference/message Retrieves an entire message thread, starting from a given message ID. ```APIDOC ## GET /message/thread/{messageId} ### Description Returns the entire message thread identified by messageId. ### Method GET ### Endpoint /message/thread/{messageId} ### Parameters #### Path Parameters - **messageId** (string) - Required - The ID of a message within the thread to retrieve. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **messages** (array) - An array of message objects representing the thread, ordered chronologically. - **message** (object) - Represents a single message within the thread. - **id** (string) - The unique message ID. - **userId** (string) - The user ID of the account containing the message. - **groupId** (string) - The user ID of the owner of the account. - **datetime** (string) - The timestamp of the message. - **parentMessage** (string or null) - The ID of the parent message if this is a reply, otherwise null. - **type** (string) - The type of message. - **messagetext** (string) - The content of the message. - **createdTime** (string) - The timestamp when the message was created. - **modifiedTime** (string) - The timestamp when the message was last modified. #### Response Example ```json { "messages": [ { "id": "msg_abc123", "userId": "user_xyz789", "groupId": "user_xyz789", "datetime": "2023-10-27T10:00:00Z", "parentMessage": null, "type": "note", "messagetext": "This is the start of the thread.", "createdTime": "2023-10-27T10:00:00Z", "modifiedTime": "2023-10-27T10:00:00Z" }, { "id": "msg_jkl012", "userId": "user_xyz789", "groupId": "user_xyz789", "datetime": "2023-10-27T12:00:00Z", "parentMessage": "msg_abc123", "type": "note", "messagetext": "This is a reply.", "createdTime": "2023-10-27T12:00:00Z", "modifiedTime": "2023-10-27T12:00:00Z" } ] } ``` ``` -------------------------------- ### Get Message Thread by ID Source: https://tidepool.redocly.app/reference/message.v1/messages Retrieves an entire message thread, starting from a specific message ID. Includes the message and all its replies. ```APIDOC ## GET /message/thread/{messageId} ### Description Returns message thread identified by messageId. ### Method GET ### Endpoint /message/thread/{messageId} ### Parameters #### Path Parameters - **messageId** (string) - Required - The unique identifier of a message within the thread to retrieve. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **messages** (array) - An array of message objects representing the entire thread. - **message** (object) - Represents a message within the thread. - **messageId** (string) - Unique identifier for the message. - **userId** (string) - The Tidepool User ID of the account owner. - **groupid** (string) - The Tidepool User ID of the account owner. - **createdTime** (string) - Timestamp when the message was created. - **messagetext** (string) - The content of the message. - **parentmessage** (string or null) - The message ID of the parent message, if this is a reply, otherwise null. - **modifiedTime** (string) - Timestamp when the message was last modified. - **clinicalData** (object) - Associated clinical data, if present. #### Response Example { "messages": [ { "messageId": "msg-def456uvw", "userId": "user-owner-id", "groupid": "user-owner-id", "createdTime": "2023-10-27T11:00:00Z", "messagetext": "This is the first message in a new thread.", "parentmessage": null, "modifiedTime": "2023-10-27T11:00:00Z", "clinicalData": { "value": 5.5, "units": "mmol/L", "type": "glucose" } }, { "messageId": "msg-ghi789uvw", "userId": "user-owner-id", "groupid": "user-owner-id", "createdTime": "2023-10-27T11:05:00Z", "messagetext": "This is a reply to the previous message.", "parentmessage": "msg-def456uvw", "modifiedTime": "2023-10-27T11:05:00Z" } ] } ``` -------------------------------- ### GET /v1/users/{userId}/device_logs Source: https://tidepool.redocly.app/reference/blob.v1/device-logs/listdevicelogs Lists previously uploaded device logs metadata for a user, filterable by start and end time. ```APIDOC ## GET /v1/users/{userId}/device_logs ### Description Lists previously uploaded device logs json data in the user's account. The list must be filtered with startAt and endAt parameters. ### Method GET ### Endpoint /v1/users/{userId}/device_logs ### Parameters #### Path Parameters - **userId** (string) - Required - Tidepool User ID #### Query Parameters - **startAtTime** (string) - Required - Start At Datetime. Example: "2017-02-06T02:37:46Z" - **endAtTime** (string) - Required - End At Datetime. Example: "2017-02-06T02:37:46Z" ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **id** (string) - Blob ID. Example: "97a9fae8a19b4da58bb48dc90c9562c9" - **userId** (string) - String representation of a Tidepool User ID. - **digestMD5** (string) - MD5 digest of the content per RFC 1321, encoded as base64. Example: "HUXZLQLMuI/KZ5KDcJPcOA==" - **mediaType** (string) - Enum: "application/json" - **size** (integer) - Size of the binary blob, in bytes. Example: 1024 - **createdTime** (string) - RFC 3339 / ISO 8601 timestamp with timezone information. Example: "2017-02-06T02:37:46Z" - **startAtTime** (string) - RFC 3339 / ISO 8601 timestamp with timezone information. Example: "2017-02-06T02:37:46Z" - **endAtTime** (string) - RFC 3339 / ISO 8601 timestamp with timezone information. Example: "2017-02-06T02:37:46Z" #### Response Example { "id": "97a9fae8a19b4da58bb48dc90c9562c9", "userId": "some-user-id", "digestMD5": "HUXZLQLMuI/KZ5KDcJPcOA==", "mediaType": "application/json", "size": 1024, "createdTime": "2017-02-06T02:37:46Z", "startAtTime": "2017-02-06T02:37:46Z", "endAtTime": "2017-02-06T02:37:46Z" } #### Error Response (400) - **code** (integer) - Example: 404 - **message** (string) - Example: "Requested resources was not found" #### Error Response (401) - **code** (integer) - Example: 404 - **message** (string) - Example: "Requested resources was not found" #### Error Response (403) - **code** (integer) - Example: 404 - **message** (string) - Example: "Requested resources was not found" #### Error Response (404) - **code** (integer) - Example: 404 - **message** (string) - Example: "Requested resources was not found" ``` -------------------------------- ### POST /v1/clinics Source: https://tidepool.redocly.app/_bundle/reference/clinic Create a new clinic. ```APIDOC ## POST /v1/clinics ### Description Create a new clinic. ### Method POST ### Endpoint /v1/clinics ### Request Body - **clinic.v1** (object) - The clinic object to create. ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **clinic.v1** (object) - The newly created clinic object. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### GET /message/notes/{userId} Source: https://tidepool.redocly.app/docs/quick-start/notes Fetches user notes for a specific user. You can optionally filter notes by a start and end time. ```APIDOC ## GET /message/notes/{userId} ### Description Fetches user notes for a specific user. Optionally filter notes by start and end time. ### Method GET ### Endpoint `https://int-api.tidepool.org/message/notes/{userId}` ### Parameters #### Path Parameters - **userId** (string) - Required - The ID of the user whose notes are to be fetched. #### Query Parameters - **starttime** (string) - Optional - ISO date/time format string to specify the start of the time range for fetching notes. - **endtime** (string) - Optional - ISO date/time format string to specify the end of the time range for fetching notes. ### Request Example ```json { "method": "get", "url": "https://int-api.tidepool.org/message/notes/{userId}", "query": { "starttime": "2015-10-10T15:00:00.000Z", "endtime": "2015-10-11T15:00:00.000Z" }, "headers": { "X-Tidepool-Session-Token": "{sessionToken}", "Content-Type": "application/json" } } ``` ### Response #### Success Response (200) - **notes** (array) - An array of user note objects. - **note** (object) - Represents a single user note. - **id** (string) - The unique identifier for the note. - **userId** (string) - The ID of the user associated with the note. - **text** (string) - The content of the note. - **timestamp** (string) - The timestamp when the note was created in ISO date/time format. #### Response Example ```json { "notes": [ { "id": "note-123", "userId": "user-abc", "text": "Patient reported feeling well today.", "timestamp": "2023-10-27T10:00:00.000Z" } ] } ``` ``` -------------------------------- ### GET /authorize Source: https://tidepool.redocly.app/_bundle/reference/auth The starting point for browser-based OpenID Connect flows. This endpoint authenticates the user and returns an authorization grant or an access token to the callback endpoint at the specified `redirect_uri`. ```APIDOC ## GET /authorize ### Description The starting point for browser-based OpenID Connect flows. This endpoint authenticates the user and returns an authorization grant or an access token to the callback endpoint at the specified `redirect_uri`. ### Method GET ### Endpoint /authorize ### Parameters #### Query Parameters - **client_id** (string) - Required - Client Identifier valid at the Authorization Server - **scope** (array of strings) - Required - OpenID Connect requests MUST contain the `openid` scope value. Allowed values: `openid`, `email` - **response_type** (string) - Required - Response Type value that determines the authorization processing flow to be used, including what parameters are returned from the endpoints used. When using the Authorization Code Flow, this value is `code`. Allowed values: `code` - **redirect_uri** (string) - Required - Redirection URI to which the response will be sent. This URI MUST exactly match one of the Redirection URI values for the Client pre-registered at the OpenID Provider - **login_hint** (string) - Optional - Hint to the Authorization Server about the login identifier the End-User might use to log in - **kc_idp_hint** (string) - Optional - OIDC applications can bypass the login page by hinting at the identity provider they want to use - **prompt** (string) - Optional - Specifies whether the Authorization Server prompts the End-User for reauthentication and consent. Allowed values: `none`, `login` ### Response #### Success Response (301) - Description: Both successful and error responses result in a browser redirect to the callback endpoint #### Error Response (400) - Description: A `Bad Request` response is returned if there are missing or invalid query parameters. ### Request Example ``` GET /authorize?client_id=my_client_id&scope=openid%20email&response_type=code&redirect_uri=https://example.com/callback&login_hint=user@example.com ``` ### Response Example *Note: This endpoint typically results in a redirect, not a direct JSON response.* ``` -------------------------------- ### Device Log Content Schema Example (JSON) Source: https://tidepool.redocly.app/_bundle/reference/blob An example of a device log entry, specifying the type of log, manager and device identifiers, timestamp, and a message. This schema models individual log events from devices. ```json { "device-log-content.v1": { "title": "Device log content", "description": "Device log entry.", "type": "object", "properties": { "type": { "type": "string", "enum": [ "send", "receive", "error", "delegate", "delegateResponse", "connection" ] }, "managerIdentifier": { "$ref": "#/components/schemas/devicemodelname.v1" }, "deviceIdentifier": { "$ref": "#/components/schemas/deviceid.v1" }, "timestamp": { "$ref": "#/components/schemas/datetime.v1" }, "message": { "type": "string", "minLength": 1 } }, "required": [ "type", "managerIdentifier", "deviceIdentifier", "timestamp", "message" ], "example": { "type": "send", "managerIdentifier": "Devicey McDeviceface", "deviceIdentifier": "MMT-1711:12345678", "timestamp": "2017-02-06T02:37:46Z", "message": "sent something ..." } } } ``` -------------------------------- ### Get Patient Count Settings Source: https://tidepool.redocly.app/reference/clinic.v1/clinics/deletepatienttag Retrieves the patient count settings for a clinic, including hard and soft limits with their associated start and end dates. ```APIDOC ## Get Patient Count Settings ### Description Get patient count settings for a clinic. ### Method GET ### Endpoint /v1/clinics/{clinicId}/settings/patient_count ### Parameters #### Path Parameters - **clinicId** (string) - Required - The ID of the clinic. ### Response #### Success Response (200) - **hardLimit** (object) - Patient count hard limit configuration. - **patientCount** (integer) - The maximum number of patients allowed. - **startDate** (string) - The start date for the hard limit. - **endDate** (string) - The end date for the hard limit. - **softLimit** (object) - Patient count soft limit configuration. - **patientCount** (integer) - The soft limit for the number of patients. - **startDate** (string) - The start date for the soft limit. - **endDate** (string) - The end date for the soft limit. #### Response Example ```json { "hardLimit": { "patientCount": 0, "startDate": "2017-02-06T02:37:46Z", "endDate": "2017-02-06T02:37:46Z" }, "softLimit": { "patientCount": 0, "startDate": "2017-02-06T02:37:46Z", "endDate": "2017-02-06T02:37:46Z" } } ``` ``` -------------------------------- ### POST /v1/clinics/{clinicId}/sites Source: https://tidepool.redocly.app/_bundle/reference/clinic Create a new clinic site. ```APIDOC ## POST /v1/clinics/{clinicId}/sites ### Description Create a Site. ### Method POST ### Endpoint /v1/clinics/{clinicId}/sites ### Parameters #### Path Parameters - **clinicId** (string) - Required - The ID of the clinic. #### Request Body - **siteCreation** (object) - Required - The site creation object. - **name** (string) - Required - The name of the site. - **address** (string) - Optional - The address of the site. - **city** (string) - Optional - The city of the site. - **state** (string) - Optional - The state of the site. - **zipCode** (string) - Optional - The zip code of the site. ### Request Example ```json { "siteCreation": { "name": "Downtown Clinic", "address": "123 Main St", "city": "Anytown", "state": "CA", "zipCode": "90210" } } ``` ### Response #### Success Response (200) - **site** (object) - The newly-created clinic site. - **id** (string) - The unique identifier for the site. - **name** (string) - The name of the site. - **address** (string) - The address of the site. - **city** (string) - The city of the site. - **state** (string) - The state of the site. - **zipCode** (string) - The zip code of the site. - **created_at** (string) - The timestamp when the site was created. - **updated_at** (string) - The timestamp when the site was last updated. #### Response Example ```json { "site": { "id": "60f3b2b9c3a3e4a4c8b0e4b4", "name": "Downtown Clinic", "address": "123 Main St", "city": "Anytown", "state": "CA", "zipCode": "90210", "created_at": "2023-01-02T13:00:00Z", "updated_at": "2023-01-02T13:00:00Z" } } ``` ``` -------------------------------- ### Device Configuration Details Source: https://tidepool.redocly.app/_bundle/reference/data This section describes the structure of device configuration data, including insulin sensitivity, carb ratios, and display settings. ```APIDOC ## Device Configuration Details ### Description This section outlines the structure for device configuration, including details about insulin formulation, carb ratios, and display preferences. ### Properties - **`carbRatio`** (number) - Optional - An integer encoding the grams of carbohydrate "covered" by one unit of insulin for the PWD. - **`carbRatios`** (object) - Optional - A set of key-value pairs encoding the PWD's programmed carb ratio schedules, where each key is a schedule name and each value is an array of carb ratio segment objects. - **`display`** (object) - Optional - Configuration for how data is displayed. - **`bloodGlucose`** (object) - Optional - Blood glucose display settings. - **`units`** (string) - Required - The units for blood glucose display. Enum: `mg/dL`, `mmol/L`. - **`firmwareVersion`** (string) - Optional - The firmware version of the device. Example: `1.2`. - **`hardwareVersion`** (string) - Optional - The hardware version of the device. Example: `2.3r45`. - **`insulinFormulation`** (object) - Optional - Details about the insulin formulation used. - **`insulinSensitivity`** (object) - Optional - Configuration for insulin sensitivity. - **`insulinSensitivities`** (object) - Optional - A set of key-value pairs encoding the PWD's programmed insulin sensitivity schedules. - **`manufacturers`** (array) - Optional - A list of device manufacturers. Example: `["Acme"]`. - **`model`** (string) - Optional - The model name of the device. Example: `Pump A Lot`. - **`name`** (string) - Optional - The name of the device, if known. Example: `My Pump`. ``` -------------------------------- ### GET /realms/{realm}/protocol/openid-connect/auth Source: https://tidepool.redocly.app/reference/auth The starting point for browser-based OpenID Connect flows. This endpoint authenticates the user and returns an authorization grant or an access token to the specified redirect_uri. ```APIDOC ## GET /realms/{realm}/protocol/openid-connect/auth ### Description The starting point for browser-based OpenID Connect flows. This endpoint authenticates the user and returns an authorization grant or an access token to the specified redirect_uri. ### Method GET ### Endpoint `/realms/{realm}/protocol/openid-connect/auth` ### Parameters #### Path Parameters - **realm** (string) - Required - The authentication realm. #### Query Parameters - **client_id** (string) - Required - The client identifier. - **redirect_uri** (string) - Required - The URI to redirect to after authentication. - **response_type** (string) - Required - The type of response requested (e.g., `code` for authorization code). - **scope** (string) - Optional - The scope of the request. - **state** (string) - Optional - An opaque value used to maintain state between the request and callback. - **kc_idp_hint** (string) - Optional - Hint for the identity provider to use. ### Request Example ``` GET /realms/tidepool/protocol/openid-connect/auth?client_id=my-app&redirect_uri=https://example.com/callback&response_type=code&scope=openid%20profile&state=xyz123 ``` ### Response #### Success Response (302 Found) Redirects to the `redirect_uri` with an authorization code or token in the query parameters. #### Response Example ``` https://example.com/callback?code=SplxlOBeZQQYbYS6WxSbIA&state=xyz123 ``` ```