### HttpClient request example Source: https://rosetta-sync-api-docs.up.railway.app/api/fat-cursor-addressable-change-feed C# implementation for making an authenticated GET request to the change feed. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://sync.example.com/api/v1/changes"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Unauthorized request example Source: https://rosetta-sync-api-docs.up.railway.app/records-api Example request and response when the authentication token is missing. ```bash curl "https://sync.example.com/api/v1/records/patient?_limit=2" ``` ```json { "code": "unauthorized" } ``` -------------------------------- ### Poll Change Feed Example Source: https://rosetta-sync-api-docs.up.railway.app/change-feed Example request and response for polling the change feed. ```bash curl -H "Authorization: Bearer $ROSETTA_SYNC_TOKEN" \ "https://sync.example.com/api/v1/changes?since=0&limit=100" ``` ```json { "events": [ { "sequence": 1, "resourceType": "patient", "canonicalId": "f3024f2e-0583-4759-a9b8-c534e6763391", "operation": "create", "version": 1, "occurredAt": "2026-07-14T04:32:56.082Z", "orgSlug": "default", "record": { "identifiers": [{ "system": "urn:michels:pid", "value": "1234567" }], "familyName": "Mueller", "givenNames": ["Anna"], "birthDate": "1980-05-01", "gender": "female" } } ], "nextSince": 1 } ``` -------------------------------- ### C# HttpClient Request Example Source: https://rosetta-sync-api-docs.up.railway.app/api/lists-webhook-subscriptions-never-includes-the-signing-secret Example implementation using C# HttpClient to perform the GET request with bearer authentication. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://sync.example.com/api/v1/subscriptions"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Failed Request Example Source: https://rosetta-sync-api-docs.up.railway.app/authentication Example of a request using an invalid token, resulting in a 401 error. ```bash curl https://sync.example.com/api/v1/changes?since=0 \ -H "Authorization: Bearer not-a-real-token" ``` ```json { "code": "unauthorized" } ``` -------------------------------- ### Webhook Subscription Schema Example Source: https://rosetta-sync-api-docs.up.railway.app/api/partially-updates-a-webhook-subscriptions-name-endpoint-filter-payload-mode-or-status Example JSON structure representing a webhook subscription object. ```json { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "string", "endpointUrl": "string", "filter": { "resourceTypes": [ "patient" ], "operations": [ "create" ], "sourceSystems": [ "string" ], "orgSlugs": [ "string" ], "excludeSourceSystems": [ "string" ] }, "payloadMode": "full", "status": "active", "lastDeliveredSequence": 0, "createdAt": "2024-07-29T15:51:28.071Z", "updatedAt": "2024-07-29T15:51:28.071Z" } ``` -------------------------------- ### Authenticated Request Example Source: https://rosetta-sync-api-docs.up.railway.app/authentication Example of using curl to send an authenticated request to the API. ```bash curl https://sync.example.com/api/v1/changes \ -H "Authorization: Bearer " ``` -------------------------------- ### Change feed response schema example Source: https://rosetta-sync-api-docs.up.railway.app/api/fat-cursor-addressable-change-feed A generic example of the JSON structure returned by the change feed. ```json { "events": [ { "sequence": 0, "resourceType": "patient", "canonicalId": "string", "operation": "create", "version": 0, "occurredAt": "2024-07-29T15:51:28.071Z", "sourceSystem": "string", "record": {} } ], "nextSince": 0 } ``` -------------------------------- ### Create Webhook Subscription with HttpClient Source: https://rosetta-sync-api-docs.up.railway.app/api/registers-a-webhook-subscription-the-201-body-is-the-only-place-the-signing-secret-is-ever-returned Example of creating a subscription using the C# HttpClient library. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://sync.example.com/api/v1/subscriptions"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{\n \"name\": \"string\",\n \"endpointUrl\": \"string\",\n \"filter\": {\n \"resourceTypes\": [\n \"patient\"\n ],\n \"operations\": [\n \"create\"\n ],\n \"sourceSystems\": [\n \"string\"\n ],\n \"orgSlugs\": [\n \"string\"\n ],\n \"excludeSourceSystems\": [\n \"string\"\n ]\n },\n \"payloadMode\": \"full\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Request Source: https://rosetta-sync-api-docs.up.railway.app/api/fetches-one-webhook-subscription-by-id-never-includes-the-signing-secret Example implementation using C# HttpClient to fetch the subscription. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://sync.example.com/api/v1/subscriptions/:id"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Example Webhook Delivery Headers Source: https://rosetta-sync-api-docs.up.railway.app/webhooks Headers received in a sample signed webhook delivery. ```text content-type: application/json x-rosetta-signature: t=1752469976082,v1=6f2a9c1e4b7d0f3a8c5e2b9d6f1a4c7e0b3d6f9a2c5e8b1d4f7a0c3e6b9d2f5a x-rosetta-subscription-id: 8d9e4a9a-9c2b-4a9e-8c9d-4f6b0a2e6f11 x-rosetta-delivery-id: 1b2c3d4e-5f60-4718-9a2b-3c4d5e6f7a8b ``` -------------------------------- ### Canonical Record JSON Response Example Source: https://rosetta-sync-api-docs.up.railway.app/api/fetches-one-canonical-record-by-resource-type-and-canonical-id An example of the JSON structure returned by the API for a successful request. ```json { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "resourceType": "patient", "version": 0, "payload": { "identifiers": [ { "system": "string", "value": "string" } ], "familyName": "string", "givenNames": [ "string" ], "birthDate": "2024-07-29", "gender": "male", "deceased": true }, "updatedAt": "string", "identifiers": [ { "system": "string", "value": "string" } ] } ``` -------------------------------- ### Change feed response data example Source: https://rosetta-sync-api-docs.up.railway.app/api/fat-cursor-addressable-change-feed A concrete example of a patient resource creation event in the change feed. ```json { "events": [ { "sequence": 1, "resourceType": "patient", "canonicalId": "f3024f2e-0583-4759-a9b8-c534e6763391", "operation": "create", "version": 1, "occurredAt": "2026-07-14T04:32:56.082Z", "record": { "identifiers": [ { "system": "urn:michels:pid", "value": "1234567" } ], "familyName": "Mueller", "givenNames": [ "Anna" ], "birthDate": "1980-05-01", "gender": "female" } } ], "nextSince": 1 } ``` -------------------------------- ### Procedure Example Payload Source: https://rosetta-sync-api-docs.up.railway.app/data-types/procedure A standard JSON representation of a procedure resource. ```json { "identifiers": [{ "system": "urn:michels:procedure", "value": "PROC-6001" }], "patientRef": { "sourceSystem": "michels", "resourceType": "patient", "sourceId": "pat-1" }, "encounterRef": { "sourceSystem": "michels", "resourceType": "encounter", "sourceId": "enc-1" }, "code": { "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", "code": "1-208", "display": "Blood pressure measurement" }, "status": "completed", "performedAt": "2026-07-05T08:00:00.000Z" } ``` -------------------------------- ### C# HttpClient Request Source: https://rosetta-sync-api-docs.up.railway.app/api/fetches-one-canonical-record-by-resource-type-and-canonical-id Example implementation using C# HttpClient to fetch a record. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://sync.example.com/api/v1/records/:resourceType/:canonicalId"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Liveness Check with HttpClient Source: https://rosetta-sync-api-docs.up.railway.app/api/liveness-check-unauthenticated Example implementation of the liveness check using C# HttpClient. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://sync.example.com/health"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Webhook Subscription Response Schema Source: https://rosetta-sync-api-docs.up.railway.app/api/fetches-one-webhook-subscription-by-id-never-includes-the-signing-secret Example JSON structure returned by the API. ```json { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "string", "endpointUrl": "string", "filter": { "resourceTypes": [ "patient" ], "operations": [ "create" ], "sourceSystems": [ "string" ], "orgSlugs": [ "string" ], "excludeSourceSystems": [ "string" ] }, "payloadMode": "full", "status": "active", "lastDeliveredSequence": 0, "createdAt": "2024-07-29T15:51:28.071Z", "updatedAt": "2024-07-29T15:51:28.071Z" } ``` -------------------------------- ### C# HttpClient Request Source: https://rosetta-sync-api-docs.up.railway.app/api/lists-a-webhook-subscriptions-delivery-attempt-log-newest-first Example implementation using C# HttpClient to fetch delivery logs. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://sync.example.com/api/v1/subscriptions/:id/deliveries"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Webhook Subscriptions Response Example Source: https://rosetta-sync-api-docs.up.railway.app/api/lists-webhook-subscriptions-never-includes-the-signing-secret A sample JSON response body containing an array of subscription objects. ```json { "subscriptions": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "string", "endpointUrl": "string", "filter": { "resourceTypes": [ "patient" ], "operations": [ "create" ], "sourceSystems": [ "string" ], "orgSlugs": [ "string" ], "excludeSourceSystems": [ "string" ] }, "payloadMode": "full", "status": "active", "lastDeliveredSequence": 0, "createdAt": "2024-07-29T15:51:28.071Z", "updatedAt": "2024-07-29T15:51:28.071Z" } ] } ``` -------------------------------- ### GET /api/v1/subscriptions Source: https://rosetta-sync-api-docs.up.railway.app/webhooks Lists all existing webhook subscriptions. ```APIDOC ## GET /api/v1/subscriptions ### Description Retrieves a list of all webhook subscriptions. ### Method GET ### Endpoint /api/v1/subscriptions ``` -------------------------------- ### Discharge Change-Feed Event Source: https://rosetta-sync-api-docs.up.railway.app/data-types/discharge Example of a discharge resource wrapped in a change-feed event structure. ```json { "sequence": 202, "resourceType": "discharge", "canonicalId": "3c6d9e1a-5d8f-4b2c-9e3d-6d9c2f5a8b1a", "operation": "create", "version": 1, "occurredAt": "2026-07-14T09:15:05.000Z", "orgSlug": "default", "record": { "identifiers": [{ "system": "urn:rosetta-app:discharge", "value": "dis-7001" }], "patientRef": { "sourceSystem": "rosetta-app", "resourceType": "patient", "sourceId": "pat-1" }, "discipline": "occupational-therapy", "capturedAt": "2026-07-14T09:00:00.000Z", "completedAt": "2026-07-14T09:15:00.000Z", "formData": { "outcome": "goals-met" } } } ``` -------------------------------- ### GET https://sync.example.com/health Source: https://rosetta-sync-api-docs.up.railway.app/api/liveness-check-unauthenticated Performs an unauthenticated liveness check to verify that the service is operational. ```APIDOC ## GET https://sync.example.com/health ### Description Performs an unauthenticated liveness check to verify that the service is operational. ### Method GET ### Endpoint https://sync.example.com/health ### Response #### Success Response (200) - **status** (string) - The status of the service, which is always 'ok'. #### Response Example { "status": "ok" } ``` -------------------------------- ### Condition Example Payload Source: https://rosetta-sync-api-docs.up.railway.app/data-types/condition A standard JSON representation of a condition record. ```json { "identifiers": [{ "system": "urn:michels:condition", "value": "COND-3001" }], "patientRef": { "sourceSystem": "michels", "resourceType": "patient", "sourceId": "pat-1" }, "encounterRef": { "sourceSystem": "michels", "resourceType": "encounter", "sourceId": "enc-1" }, "code": { "system": "http://hl7.org/fhir/sid/icd-10", "code": "I63.9", "display": "Cerebral infarction, unspecified" }, "clinicalStatus": "active", "recordedAt": "2026-07-10T09:15:00.000Z" } ``` -------------------------------- ### Discharge Resource Payload Example Source: https://rosetta-sync-api-docs.up.railway.app/data-types/discharge A standard JSON representation of a discharge report snapshot. ```json { "identifiers": [{ "system": "urn:rosetta-app:discharge", "value": "dis-7001" }], "patientRef": { "sourceSystem": "rosetta-app", "resourceType": "patient", "sourceId": "pat-1" }, "discipline": "occupational-therapy", "capturedAt": "2026-07-14T09:00:00.000Z", "completedAt": "2026-07-14T09:15:00.000Z", "formData": { "outcome": "goals-met" } } ``` -------------------------------- ### GET https://sync.example.com/api/v1/changes Source: https://rosetta-sync-api-docs.up.railway.app/api/fat-cursor-addressable-change-feed Retrieves a list of changes from the system. This endpoint supports cursor-based pagination using the sequence field. ```APIDOC ## GET https://sync.example.com/api/v1/changes ### Description Retrieves a list of changes from the system. This endpoint supports cursor-based pagination using the sequence field. ### Method GET ### Endpoint https://sync.example.com/api/v1/changes ### Response #### Success Response (200) - **events** (array) - A list of change events. - **nextSince** (integer) - The cursor value to use for the next request. #### Response Example { "events": [ { "sequence": 1, "resourceType": "patient", "canonicalId": "f3024f2e-0583-4759-a9b8-c534e6763391", "operation": "create", "version": 1, "occurredAt": "2026-07-14T04:32:56.082Z", "record": { "identifiers": [ { "system": "urn:michels:pid", "value": "1234567" } ], "familyName": "Mueller", "givenNames": [ "Anna" ], "birthDate": "1980-05-01", "gender": "female" } } ], "nextSince": 1 } ``` -------------------------------- ### Records API Condition Retrieval Source: https://rosetta-sync-api-docs.up.railway.app/data-types/condition Example of fetching a specific condition record using the Records API. ```bash curl -H "Authorization: Bearer $ROSETTA_SYNC_TOKEN" \ "https://sync.example.com/api/v1/records/condition/4a7c1e9b-2d5f-4b8a-9e1c-6f3a8d2b5c7e" ``` ```json { "id": "4a7c1e9b-2d5f-4b8a-9e1c-6f3a8d2b5c7e", "resourceType": "condition", "version": 1, "payload": { "identifiers": [{ "system": "urn:michels:condition", "value": "COND-3001" }], "patientRef": { "sourceSystem": "michels", "resourceType": "patient", "sourceId": "pat-1" }, "encounterRef": { "sourceSystem": "michels", "resourceType": "encounter", "sourceId": "enc-1" }, "code": { "system": "http://hl7.org/fhir/sid/icd-10", "code": "I63.9", "display": "Cerebral infarction, unspecified" }, "clinicalStatus": "active", "recordedAt": "2026-07-10T09:15:00.000Z" }, "updatedAt": "2026-07-10T09:15:05.000Z", "orgSlug": "default", "identifiers": [{ "system": "urn:michels:condition", "value": "COND-3001" }] } ``` -------------------------------- ### GET https://sync.example.com/api/v1/subscriptions Source: https://rosetta-sync-api-docs.up.railway.app/api/lists-webhook-subscriptions-never-includes-the-signing-secret Retrieves a list of all webhook subscriptions. The response includes details such as subscription ID, name, endpoint URL, filter criteria, payload mode, status, and timestamps. ```APIDOC ## GET https://sync.example.com/api/v1/subscriptions ### Description Lists all webhook subscriptions. This operation does not include the signing secret in the response. ### Method GET ### Endpoint https://sync.example.com/api/v1/subscriptions ### Response #### Success Response (200) - **subscriptions** (array) - A list of subscription objects. - **id** (string) - The UUID of the subscription. - **name** (string) - The name of the subscription. - **endpointUrl** (string) - The destination URL for the webhook. - **filter** (object) - The filter criteria for the subscription. - **payloadMode** (string) - The mode of the payload (full or id-only). - **status** (string) - The current status (active, paused, or suspended). - **lastDeliveredSequence** (integer) - The sequence number of the last delivered event. - **createdAt** (string) - ISO-8601 timestamp of creation. - **updatedAt** (string) - ISO-8601 timestamp of last update. #### Response Example { "subscriptions": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "string", "endpointUrl": "string", "filter": { "resourceTypes": ["patient"], "operations": ["create"], "sourceSystems": ["string"], "orgSlugs": ["string"], "excludeSourceSystems": ["string"] }, "payloadMode": "full", "status": "active", "lastDeliveredSequence": 0, "createdAt": "2024-07-29T15:51:28.071Z", "updatedAt": "2024-07-29T15:51:28.071Z" } ] } ``` -------------------------------- ### GET /health Source: https://rosetta-sync-api-docs.up.railway.app/api/health Performs an unauthenticated liveness check to verify if the service is running. ```APIDOC ## GET /health ### Description Liveness check; unauthenticated. ### Method GET ### Endpoint /health ``` -------------------------------- ### Rosetta-app-origin therapy case payloads Source: https://rosetta-sync-api-docs.up.railway.app/data-types/encounter Examples of a physiotherapy case in rosetta-app, showing both the initial admission state and the final discharged state. ```json { "identifiers": [ { "system": "urn:rosetta-app:therapy-case", "value": "pat-42:physiotherapy" } ], "patientRef": { "sourceSystem": "rosetta-app", "resourceType": "patient", "sourceId": "pat-42" }, "status": "in-progress", "periodStart": "2026-07-01T00:00:00.000Z" } ``` ```json { "identifiers": [ { "system": "urn:rosetta-app:therapy-case", "value": "pat-42:physiotherapy" } ], "patientRef": { "sourceSystem": "rosetta-app", "resourceType": "patient", "sourceId": "pat-42" }, "status": "finished", "periodStart": "2026-07-01T00:00:00.000Z", "periodEnd": "2026-07-10T00:00:00.000Z" } ``` -------------------------------- ### GET https://sync.example.com/api/v1/subscriptions/:id/deliveries Source: https://rosetta-sync-api-docs.up.railway.app/api/lists-a-webhook-subscriptions-delivery-attempt-log-newest-first Retrieves the delivery attempt log for a webhook subscription, newest first. ```APIDOC ## GET https://sync.example.com/api/v1/subscriptions/:id/deliveries ### Description Lists a webhook subscription's delivery attempt log, newest first. ### Method GET ### Endpoint https://sync.example.com/api/v1/subscriptions/:id/deliveries ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the webhook subscription. ### Response #### Success Response (200) - **deliveries** (array) - A list of delivery attempt objects. - **id** (string) - Unique identifier of the delivery attempt. - **subscriptionId** (string) - The ID of the subscription. - **sequenceFrom** (integer) - Start of the sequence range. - **sequenceTo** (integer) - End of the sequence range. - **attempt** (integer) - The attempt number. - **status** (string) - The status of the delivery (e.g., 'delivered', 'failed'). - **httpStatus** (integer|null) - The HTTP status code returned by the endpoint. - **error** (string|null) - Error message if the delivery failed. - **attemptedAt** (string) - Timestamp of the delivery attempt. #### Response Example { "deliveries": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "subscriptionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "sequenceFrom": 0, "sequenceTo": 0, "attempt": 0, "status": "delivered", "httpStatus": 0, "error": "string", "attemptedAt": "string" } ] } ``` -------------------------------- ### GET https://sync.example.com/api/v1/subscriptions/:id Source: https://rosetta-sync-api-docs.up.railway.app/api/fetches-one-webhook-subscription-by-id-never-includes-the-signing-secret Fetches one webhook subscription by id (never includes the signing secret). ```APIDOC ## GET https://sync.example.com/api/v1/subscriptions/:id ### Description Fetches one webhook subscription by id (never includes the signing secret). ### Method GET ### Endpoint https://sync.example.com/api/v1/subscriptions/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the subscription. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the subscription. - **name** (string) - The name of the subscription. - **endpointUrl** (string) - The destination URL for the webhook. - **filter** (object) - A webhook subscription filter. - **payloadMode** (string) - The payload mode (full or id-only). - **status** (string) - The status of the subscription (active, paused, or suspended). - **lastDeliveredSequence** (integer) - The last delivered sequence number. - **createdAt** (string) - The creation timestamp. - **updatedAt** (string) - The last update timestamp. #### Response Example { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "string", "endpointUrl": "string", "filter": { "resourceTypes": ["patient"], "operations": ["create"], "sourceSystems": ["string"], "orgSlugs": ["string"], "excludeSourceSystems": ["string"] }, "payloadMode": "full", "status": "active", "lastDeliveredSequence": 0, "createdAt": "2024-07-29T15:51:28.071Z", "updatedAt": "2024-07-29T15:51:28.071Z" } ``` -------------------------------- ### Retrieve Webhook Subscriptions Endpoint Source: https://rosetta-sync-api-docs.up.railway.app/api/lists-webhook-subscriptions-never-includes-the-signing-secret The GET request path for fetching all webhook subscriptions. ```http GET ## https://sync.example.com/api/v1/subscriptions ``` -------------------------------- ### Example Webhook Delivery Body Source: https://rosetta-sync-api-docs.up.railway.app/webhooks The JSON payload body for a signed webhook delivery with full payload mode. ```json { "deliveryId": "1b2c3d4e-5f60-4718-9a2b-3c4d5e6f7a8b", "subscriptionId": "8d9e4a9a-9c2b-4a9e-8c9d-4f6b0a2e6f11", "attempt": 1, "events": [ { "sequence": 1, "resourceType": "patient", "canonicalId": "f3024f2e-0583-4759-a9b8-c534e6763391", "operation": "create", "version": 1, "occurredAt": "2026-07-14T04:32:56.082Z", "orgSlug": "default", "record": { "identifiers": [{ "system": "urn:michels:pid", "value": "1234567" }], "familyName": "Mueller", "givenNames": ["Anna"], "birthDate": "1980-05-01", "gender": "female" } } ] } ``` -------------------------------- ### GET /api/v1/records/care-plan/{id} Source: https://rosetta-sync-api-docs.up.railway.app/data-types/care-plan Retrieves a specific care plan record by its canonical ID. ```APIDOC ## GET /api/v1/records/care-plan/{id} ### Description Retrieves the details of a specific care plan record using its unique canonical ID. ### Method GET ### Endpoint https://sync.example.com/api/v1/records/care-plan/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The canonical ID of the care plan record. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the record. - **resourceType** (string) - The type of resource, which is 'care-plan'. - **version** (integer) - The version of the record. - **payload** (object) - The care plan data including identifiers, patient reference, discipline, status, and activities. - **updatedAt** (string) - The timestamp when the record was last updated. - **orgSlug** (string) - The organization slug. - **identifiers** (array) - List of identifiers associated with the record. ### Response Example { "id": "3d6c9e1a-5f8b-4d2a-9c6e-1b4f7a0d3c8e", "resourceType": "care-plan", "version": 1, "payload": { "identifiers": [{ "system": "urn:michels:care-plan", "value": "CP-8001" }], "patientRef": { "sourceSystem": "michels", "resourceType": "patient", "sourceId": "pat-1" }, "discipline": "physiotherapy", "status": "active", "activities": [ { "description": "Daily grip-strength exercises", "kind": "care-plan-item", "location": "Ward 3B" }, { "description": "Barthel Index re-assessment", "kind": "planned-assessment", "scheduledStart": "2026-07-21" }, { "description": "Physiotherapy session", "kind": "schedule-entry", "scheduledStart": "2026-07-15 09:00", "scheduledEnd": "2026-07-15 09:30", "location": "Therapy room 2" } ] }, "updatedAt": "2026-07-14T11:00:00.000Z", "orgSlug": "default", "identifiers": [{ "system": "urn:michels:care-plan", "value": "CP-8001" }] } ``` -------------------------------- ### Delete Webhook Subscription with HttpClient Source: https://rosetta-sync-api-docs.up.railway.app/api/deletes-a-webhook-subscription-and-cascades-its-delivery-log Example implementation using C# HttpClient to perform the DELETE request. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Delete, "https://sync.example.com/api/v1/subscriptions/:id"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Delivery Attempt Response Schema Source: https://rosetta-sync-api-docs.up.railway.app/api/lists-a-webhook-subscriptions-delivery-attempt-log-newest-first Example JSON response structure for a successful delivery attempt log retrieval. ```json { "deliveries": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "subscriptionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "sequenceFrom": 0, "sequenceTo": 0, "attempt": 0, "status": "delivered", "httpStatus": 0, "error": "string", "attemptedAt": "string" } ] } ``` -------------------------------- ### Patient Payload Envelopes Source: https://rosetta-sync-api-docs.up.railway.app/data-types Examples of a patient resource payload delivered through different API mechanisms. ```json { "id": "f3024f2e-0583-4759-a9b8-c534e6763391", "resourceType": "patient", "version": 1, "payload": { "identifiers": [{ "system": "urn:michels:pid", "value": "1234567" }], "familyName": "Mueller", "givenNames": ["Anna"], "birthDate": "1980-05-01", "gender": "female" }, "updatedAt": "2026-07-14T04:32:56.082Z", "orgSlug": "default", "identifiers": [{ "system": "urn:michels:pid", "value": "1234567" }] } ``` ```json { "sequence": 1, "resourceType": "patient", "canonicalId": "f3024f2e-0583-4759-a9b8-c534e6763391", "operation": "create", "version": 1, "occurredAt": "2026-07-14T04:32:56.082Z", "orgSlug": "default", "record": { "identifiers": [{ "system": "urn:michels:pid", "value": "1234567" }], "familyName": "Mueller", "givenNames": ["Anna"], "birthDate": "1980-05-01", "gender": "female" } } ``` ```json { "deliveryId": "1b2c3d4e-5f60-4718-9a2b-3c4d5e6f7a8b", "subscriptionId": "8d9e4a9a-9c2b-4a9e-8c9d-4f6b0a2e6f11", "attempt": 1, "events": [ { "sequence": 1, "resourceType": "patient", "canonicalId": "f3024f2e-0583-4759-a9b8-c534e6763391", "operation": "create", "version": 1, "occurredAt": "2026-07-14T04:32:56.082Z", "orgSlug": "default", "record": { "identifiers": [{ "system": "urn:michels:pid", "value": "1234567" }], "familyName": "Mueller", "givenNames": ["Anna"], "birthDate": "1980-05-01", "gender": "female" } } ] } ``` -------------------------------- ### GET https://sync.example.com/api/v1/records/:resourceType/:canonicalId Source: https://rosetta-sync-api-docs.up.railway.app/api/fetches-one-canonical-record-by-resource-type-and-canonical-id Fetches one canonical record by resource type and canonical id. ```APIDOC ## GET https://sync.example.com/api/v1/records/:resourceType/:canonicalId ### Description Fetches one canonical record by resource type and canonical id. ### Method GET ### Endpoint https://sync.example.com/api/v1/records/:resourceType/:canonicalId ### Parameters #### Path Parameters - **resourceType** (string) - Required - The type of the resource (e.g., patient, encounter, condition, coverage, procedure, observation, assessment, care-plan). - **canonicalId** (string) - Required - The unique canonical identifier of the record. ### Response #### Success Response (200) - **id** (string) - The unique UUID of the record. - **resourceType** (string) - The type of the resource. - **version** (integer) - The version number of the record. - **payload** (object) - The core demographic or resource-specific data. - **identifiers** (object[]) - Array of system and value identifiers. - **updatedAt** (string) - The timestamp of the last update. #### Response Example { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "resourceType": "patient", "version": 0, "payload": { "identifiers": [ { "system": "string", "value": "string" } ], "familyName": "string", "givenNames": ["string"], "birthDate": "2024-07-29", "gender": "male", "deceased": true }, "updatedAt": "string", "identifiers": [ { "system": "string", "value": "string" } ] } ``` -------------------------------- ### GET Request Endpoint Source: https://rosetta-sync-api-docs.up.railway.app/api/fetches-one-canonical-record-by-resource-type-and-canonical-id The base URL and path structure for the canonical record retrieval endpoint. ```http GET ## https://sync.example.com/api/v1/records/:resourceType/:canonicalId ``` -------------------------------- ### Care Plan JSON Payload Source: https://rosetta-sync-api-docs.up.railway.app/data-types/care-plan Example of a complete care-plan object including identifiers, patient reference, and a list of activities. ```json { "identifiers": [{ "system": "urn:michels:care-plan", "value": "CP-8001" }], "patientRef": { "sourceSystem": "michels", "resourceType": "patient", "sourceId": "pat-1" }, "discipline": "physiotherapy", "status": "active", "activities": [ { "description": "Daily grip-strength exercises", "kind": "care-plan-item", "location": "Ward 3B" }, { "description": "Barthel Index re-assessment", "kind": "planned-assessment", "scheduledStart": "2026-07-21" }, { "description": "Physiotherapy session", "kind": "schedule-entry", "scheduledStart": "2026-07-15 09:00", "scheduledEnd": "2026-07-15 09:30", "location": "Therapy room 2" } ] } ``` -------------------------------- ### GET /api/v1/subscriptions/:id Source: https://rosetta-sync-api-docs.up.railway.app/webhooks Fetches details for a specific webhook subscription. ```APIDOC ## GET /api/v1/subscriptions/:id ### Description Retrieves details for a specific subscription by ID. ### Method GET ### Endpoint /api/v1/subscriptions/:id ### Parameters #### Path Parameters - **id** (string) - Required - The subscription ID ``` -------------------------------- ### Environment Variable Provisioning Source: https://rosetta-sync-api-docs.up.railway.app/authentication Store the provided token as an environment variable to avoid hardcoding it. ```bash export ROSETTA_SYNC_TOKEN="" ``` -------------------------------- ### POST https://sync.example.com/api/v1/subscriptions Source: https://rosetta-sync-api-docs.up.railway.app/api/registers-a-webhook-subscription-the-201-body-is-the-only-place-the-signing-secret-is-ever-returned Registers a new webhook subscription. The signing secret is returned only in the 201 response body. ```APIDOC ## POST https://sync.example.com/api/v1/subscriptions ### Description Registers a webhook subscription. The 201 body is the only place the signing secret is ever returned. ### Method POST ### Endpoint https://sync.example.com/api/v1/subscriptions ### Request Body - **name** (string) - Required - A non-empty name for the subscription. - **endpointUrl** (string) - Required - The URI for the webhook endpoint. - **filter** (object) - Optional - A webhook subscription filter. - **resourceTypes** (string[]) - Optional - Allowed values: patient, encounter, condition, coverage, procedure, observation, assessment, care-plan. - **operations** (string[]) - Optional - Allowed values: create, update. - **sourceSystems** (string[]) - Optional - A non-empty list of source systems. - **orgSlugs** (string[]) - Optional - A non-empty list of org slugs (max 64 chars, regex: ^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$). - **excludeSourceSystems** (string[]) - Optional - A non-empty list of source systems to exclude. - **payloadMode** (string) - Optional - Default: "full". Allowed values: full, id-only. ### Request Example { "name": "string", "endpointUrl": "string", "filter": { "resourceTypes": ["patient"], "operations": ["create"], "sourceSystems": ["string"], "orgSlugs": ["string"], "excludeSourceSystems": ["string"] }, "payloadMode": "full" } ``` -------------------------------- ### Provider-origin encounter payload Source: https://rosetta-sync-api-docs.up.railway.app/data-types/encounter Example of an outpatient visit reported by a FHIR provider. ```json { "identifiers": [{ "system": "urn:michels:encounter", "value": "ENC-2001" }], "patientRef": { "sourceSystem": "michels", "resourceType": "patient", "sourceId": "pat-1" }, "status": "finished", "classCode": "IMP", "periodStart": "2026-07-10T08:30:00.000Z", "periodEnd": "2026-07-12T11:00:00.000Z" } ``` -------------------------------- ### GET /api/v1/records/encounter/{id} Source: https://rosetta-sync-api-docs.up.railway.app/data-types/encounter Retrieves a specific encounter record by its canonical ID. ```APIDOC ## GET /api/v1/records/encounter/{id} ### Description Retrieves the details of a specific encounter record using its unique canonical ID. ### Method GET ### Endpoint https://sync.example.com/api/v1/records/encounter/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The canonical ID of the encounter record. ### Response #### Success Response (200) - **id** (string) - The canonical ID of the record. - **resourceType** (string) - The type of resource, which is 'encounter'. - **version** (integer) - The version number of the record. - **payload** (object) - The encounter data including identifiers, patient reference, status, and period. - **updatedAt** (string) - The timestamp when the record was last updated. - **orgSlug** (string) - The organization slug. - **identifiers** (array) - List of identifiers associated with the encounter. #### Response Example { "id": "6a1e4c8d-2b5f-4a9c-8d1e-4c8b2f5a9d1e", "resourceType": "encounter", "version": 2, "payload": { "identifiers": [ { "system": "urn:rosetta-app:therapy-case", "value": "pat-42:physiotherapy" } ], "patientRef": { "sourceSystem": "rosetta-app", "resourceType": "patient", "sourceId": "pat-42" }, "status": "finished", "periodStart": "2026-07-01T00:00:00.000Z", "periodEnd": "2026-07-10T00:00:00.000Z" }, "updatedAt": "2026-07-10T00:00:05.000Z", "orgSlug": "default", "identifiers": [ { "system": "urn:rosetta-app:therapy-case", "value": "pat-42:physiotherapy" } ] } ```