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).

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