Skip to content
Developer Documentation

Introduction to the xCures® API

The xCures API exposes the Clinical Clarity Engine through a REST interface. This page covers credential setup, authentication, the available endpoints, and a set of de-identified demo patients for testing. Patient-matching best practices are at the bottom.

Credentials are the foundation for every API call. This guide opens with credential management before authentication and endpoint usage.

Important URLs

NameURLDescription
OAuth URLhttps://partner.xcures.com/oauth/tokenUse this URL to obtain your bearer token during the authentication process.
API Base URLhttps://partner.xcures.comThis is the base URL that you will use for all API requests once you have authenticated.

API Credential Management

1Create New API Keys

Once you receive your xCures patient registry portal credentials from your Customer Success Manager, open the dropdown in the top-right of your screen and select Administration.

From here, click the API Keys tab and then click + Add:

First, set a name for your set of credentials in the API Key Name field:

Next, select which Projects these API credentials will have access to:

Then, select the permissions for this set of credentials. Once assigned, click Save:

You will now be presented with your client_id and client_secret:

2Deactivate API Credentials

If the need to deactivate active API credentials arises, you can easily deactivate by toggling the ACTIVE button:

You'll then be presented with a confirmation modal:

3Rotate API Credentials

Rotating API credentials is a standard security practice. It reduces the risk of unauthorized access by limiting how long any single key or token remains valid. Generating new credentials on a schedule and retiring old ones limits the impact of accidental exposure, leaked secrets, or compromised environments. Planned, well-documented rotation procedures keep the service continuous through every change.

To rotate existing API credentials, click the name of the credentials:

At the bottom of the page, you will now see the option to Rotate your key:

Once your credentials have been rotated, you will be presented with the new credentials:

Authentication

The xCures API requires a Bearer Token in the Authorization header for authentication. Most xCures endpoints also require a ProjectId header to set the context of the request. The ProjectId must match a project the API client has permission to access.

VariableDescription
client_idYour unique Client ID.
client_secretThe private key used to generate the Bearer Token. This value is extremely sensitive; do not share it outside your organization.
ProjectIdA unique identifier (UUID) used to specify which project you are targeting with a given request.

Where to Find Your Project IDs

Call the List Projects endpoint to retrieve every project your credentials can access. No ProjectId header is required for this call.

Example request

curl --request GET \
    --url https://partner.xcures.com/api/v1/patient-registry/project \
    --header 'authorization: Bearer {your_access_token}'

Example response

[
  {
    "id": "e6b01018-a333-4732-917e-fe38e91b0fdf",
    "name": "My Project",
    "created": "2025-05-26T23:30:40.912Z",
    "updated": "2025-05-26T23:30:40.912Z"
  }
]

Copy the id value for the project you want to work with. The majority of xCures API endpoints require a ProjectId header in every request.

Obtaining a Bearer Token

To get a token, exchange your client_id and client_secret against the xCures OAuth endpoint using the client credentials grant.

Example cURL command

curl --request POST \
    --url https://partner.xcures.com/oauth/token \
    --header 'content-type: application/json' \
    --data '{
      "client_id": "{your_client_id}",
      "client_secret": "{your_client_secret}",
      "grant_type": "client_credentials"
    }'

Bearer token response

{
  "access_token": "{your_access_token}",
  "token_type": "Bearer"
}

Using the Bearer Token with the xCures API

Include the bearer token in the Authorization header of every request to the xCures API.

Example of an authorized request

curl --request GET \
    --url https://partner.xcures.com/api/v1/patient-registry/subject \
    --header 'ProjectId: {your_project_id}' \
    --header 'authorization: Bearer {your_access_token}'

Postman Collection

The xCures Postman collection lets you call the API directly without writing any code. Download it below, then add your client_id, client_secret, and ProjectId to the collection's Variables tab. Run the included Get Bearer Token request once. Authentication is handled automatically for every call after that.

Postman Collection75+ requests

Every xCures API endpoint as a pre-configured request. Add your credentials to the collection's Variables tab once and every request is authenticated automatically.

Download collection

Available Endpoints

Authentication done, here are the xCures API endpoints. The endpoint table and demo patients below cover the common workflows and let you test API behavior safely.

EndpointDescription
ApplicationAccount creation (e.g., identity proofing, eConsent) required for a patient to progress on the xCures Platform. This is a required step in the Individual Access Services (IAS) workflow use case.
SubjectAn individual patient created on the xCures Platform. Use this endpoint for creating, reading, or deleting a patient.

Required: ID (UUID you generate), First Name, Last Name, DOB.

Available: Allergy Intolerances, Basics, Care Plans, Coverages, Conditions, Diagnostic Reports, Encounters, Medication Statements, Patients, Procedures, Observations, Specimens.
QueryA specified, approved request for patient records across the network (e.g., via Carequality/TEFCA) with an associated status (e.g., "completed").
SummaryA summary of a patient's overall records and conditions, generated by the xCures platform.
Reciprocity TemplatesReciprocity or "Responder" workflows for sharing clinical documentation with other organizations/providers via health data exchange networks (e.g., Carequality, TEFCA).

Standard Treatment Workflow

The diagram below shows the standard Treatment workflow end to end, from the first API call through an evaluated checklist. Each box maps to one of the endpoints listed above. When you create a subject, xCures automatically dispatches an EHR query; allow roughly 30 minutes for results to populate before you poll query status.

NOTESWith the exception of Get Token,all API calls require a ProjectId value in the headerWAITWait ~30 minutes for queryresults to populatePOSTGetTokenPOSTCreateSubjectsGETGet QueryStatusGETSearchDocumentsGETGet ClinicalConceptsStatusGETGetChecklistsPOSTEvaluateChecklistPOSTCreateQuery (requery)ONLY IF QUERY = ERROR · THEN RE-POLLQuerySuccessful?ClinicalConceptsLoaded?YESTRUENOFALSECreates Patient(s)in the xCures platformAuto-fires an EHR queryqueries.search to getthe auto-fired query;poll until terminalThe totalCount value tellsyou how many documentshave been retrievedIf the totalCount is 0,confirm patient demographicsand requeryVerifies that the patientis finished processingReturns all checklistsby id in your tenantEvaluates patient's dataagainst the Checklist;returns true/false percriterion⤢ Expand

Bring Your Own Data (BYOD) Workflow

BYOD projects upload patient records directly to xCures instead of querying health information networks. xCures ingests the documents, normalizes them, and converts them to FHIR R4 and Clinical Concepts so that you can run Checklists on your patient population. Those endpoints behave exactly as they do in the Treatment workflow above. Set options.initiateEhrQuery to false when you create the subject so no EHR query fires. Because BYOD projects do not query QHIN-connected networks, the Reciprocity requirement does not apply.

Bring Your Own Data (BYOD)POSTCreateSubject V2POSTCreateDocumentGETGet ClinicalConceptsStatusGETSearchDocumentsGETGet SubjectSummaryGETGetChecklistsPOSTEvaluateChecklistCreates Patient in thexCures platform. SetinitiateEhrQuery tofalse on this call orit will failUploaddocumentVerifies that thepatient is finishedprocessing in thexCures platformReturns array of alldocuments locatedfor a patientFetches the summaryfor a given subject.Returns array of allchecklists availableby id in your tenantEvaluates the patient'sclinical data againstthe Checklist and returnstrue/false responsesto each of theclinical criteria⤢ Expand

Retrieval Only Workflow

Retrieval Only projects query health information networks and return raw documents to your system. xCures does not extract, normalize, or run Clinical Concepts processing on retrieved records, that work happens in your own pipeline. Polling and signed document URLs behave the same as the Treatment workflow above. Retrieval Only customers are also required to contribute documentation back to the network.

Record Retrieval Only ( No Extraction/Processing)Obtain BearerTokenPOSTCreateSubjectsGETSearchQueryGETSearchDocumentsGETGetDocumentRequery?Creates Patient in thexCures platform andqueries the networkVerify querystatusPOSTCreateQueryReturns array of alldocuments locatedfor a patientReturns the signedS3 URL for thedocument requestedRequeries the network forthe patient in case oferrors or need fornew recordsNOYES⤢ Expand

Existing Patient / Requery Workflow

Use this flow when a patient already exists in xCures and needs a fresh query, for example a roster onboarded weeks ago, or a patient whose previous query errored or returned thin data. Locate the subject, inspect their existing queries, then dispatch a new one and poll it the same way as a new patient. Skipping a requery when a prior query completed within the last 30 days is a reasonable starting point; tune the window to your own workflow.

NOTESWith the exception of Get Token,all API calls require a ProjectId value in the headerPOSTGetTokenGETSearchSubjectsGETSearchQueriesGETGet QueryStatusGETSearchDocumentsGETGet ClinicalConceptsStatusGETGetChecklistsPOSTEvaluateChecklistGETGetDocumentQuerySuccessful?ClinicalConceptsLoaded?POSTCreateQueryRequeries the network forthe patient in case of errorsYESNOTRUEFALSELists all patients in thetenant with their subjectIds.Use createdStart andcreatedEnd to filter resultsUse the subjectIds to look upeach patient's query idUse the query idfrom the previous stepUse subjectIds to searcheach patient. totalCounttells you how many docswere retrieved. If 0, recheckdemographics and requeryVerifies that the patient isfinished processing in thexCures platformReturns array of allchecklists availableby id in your tenantEvaluates patient's clinicaldata against the Checklist;returns true/false percriterion with cited docsUse this endpoint todownload any of thedocumentIds returnedby the previous call⤢ Expand

Bulk Patient Onboarding

To onboard many patients at once, batch subject creation in groups of up to 10 per request, then dispatch one query per successfully created subject. Each result in the batch response reports success or failure independently, so a few bad rows never block the rest of the group.

Reciprocity Workflow

As a QHIN network participant, Standard Treatment Workflow and Retrieval Only projects are obligated to share clinical documentation back to the health information network for any patient whose records they retrieved. BYOD projects never query the network, so this requirement does not apply to them. The diagram below shows the full publish sequence: list a template, create the document record, upload the file bytes to the signed S3 URL, then publish.

Reciprocity FlowGETList ReciprocityTemplatesPOSTCreateDocumentPUTSigned S3URLPublish/Unpublish?DELETEPublishDocumentPUTPublishDocumentUNPUBLISHPUBLISHGet a list of allreciprocity documenttemplates availableunder this projectand select theappropriate templatefor this documentAlways SetdocumentDateUpload the fileusing the signedS3 URL from theprevious callUnpublish a documentfrom reciprocity inthe EHR network.Include thetemplateId of theReciprocity templateyou want appliedto the doc⤢ Expand

AI Agent Skills

AI coding agents that integrate with the xCures API can fetch step-by-step instructions instead of guessing from this reference. xCures publishes these as machine-readable guides called Agent Skills.

Each skill covers one workflow: the endpoints to call, in order, and the fields each request requires. An agent using them never attempts a call your credentials cannot make.

  • Standard Treatment Workflow: register a new patient and retrieve their existing records from connected health information networks. SKILL.md
  • Bring Your Own Data (BYOD) Ingestion: upload records you already hold so xCures normalizes them into FHIR and Clinical Concepts. SKILL.md
  • Retrieval Only: retrieve raw documents from health information networks with no xCures processing. SKILL.md
  • Existing Patient / Requery: check whether a registered patient needs a fresh query, and dispatch one if so. SKILL.md
  • Bulk Patient Onboarding: register and query a large roster of patients at once, safely and with per-patient failure isolation. SKILL.md
  • Reciprocity: publish a clinical document back to a health information network to satisfy a project's network participation obligation. SKILL.md

De-Identified Demo Patients for Testing

The xCures API ships with a small set of test patients for hands-on exploration. These are fully de-identified patients and cover a broad spectrum of use cases and conditions.

Subject NameDOBSex Assigned at BirthCondition
Marissa Jones06/29/1971FemaleMetastatic Breast Cancer
Justin Williams05/28/1968MaleSystemic Mastocytosis
Helen Milliken11/16/2000FemaleAutoimmune Encephalitis

Best Practices for Patient Matching

Accurate and complete patient creation lays the groundwork for reliable data matching across the network. Using CSV uploads or API-based creation supports scalable and consistent record management while reducing duplication and errors.

Patient matching improves as you provide more demographic detail. Core identifiers such as full name, birth date, gender, and complete address information create the strongest matching signal. Prior addresses, alternate names, and external identifiers offer additional anchors that help unify records from past encounters or different health systems.

Required Demographic and Identifier Data

When creating a new Subject (patient) in the xCures system, use the Subject endpoint. Supplying as many of these fields as possible strengthens match confidence and improves the ability to locate a patient's longitudinal record across participating EHRs and national exchange networks.

Data ElementRequired / Optional
ID (bring your own UUID)Required
First NameRequired
Last NameRequired
Date of Birth (DOB)Optional — Strongly Recommended
Date of DeathOptional — Strongly Recommended
Sex Assigned at BirthOptional — Strongly Recommended
Address Line 1Optional — Strongly Recommended
Address Line 2Optional, Recommended When Available
CityOptional — Strongly Recommended
StateOptional — Strongly Recommended
Postal (ZIP) CodeOptional — Strongly Recommended
Additional NamesOptional — Strongly Recommended
Additional AddressesOptional, Recommended When Available
EmailOptional
Phone NumberOptional

API Error Handling

xCures uses standard HTTP response codes to indicate the success or failure of an API request. Codes in the 2xx range indicate success. Codes in the 4xx range indicate a problem with the request. Codes in the 5xx range indicate a problem on the xCures side.

200 / 201OK

The request succeeded and the server returned the requested resource.

400Bad Request

The request is not acceptable, likely due to a missing required parameter.

401Unauthorized

Invalid API key or ProjectId. Verify your Bearer token and ProjectId are correct.

403Forbidden

You're authenticated, but you don't have permission to access this resource. Check with your Customer Success Manager.

429Too Many Requests

Too many requests are hitting the API in a short duration.

500Internal Server Error

An error occurred on the xCures side. Reach out to xCures Support if the issue persists.

Next Steps

What's next

API Reference

With credentials in place and the endpoints understood, the API Reference is the starting point for development.

Explore the API Reference