Sway — External API Overview
Table of Contents
Developer Overview · Integration Overview
The API covers Sway's core functionality — creating profiles, generating assessment codes, deep-linking into a test, and retrieving results and PDFs — for integrating Sway with your own application or EMR.
Quick Reference
| Item | Details |
|---|---|
| Base URL | https://api.swaymedical.com |
| Interactive Docs | Swagger / OpenAPI (browse without a key) |
| Auth | X-ApiKey header · JSON in / out |
| Transport | POST /api/{Controller}/{Action} |
1. What You Can Do Today
A focused set of endpoints, with more planned.
- Create & manage profiles: Create, update and look up patient/athlete profiles in your organization.
- Generate assessment codes: Mint screening / baseline codes that assign a specific protocol and test.
- Deep link into a test: Open the Sway app directly into an assigned test via a universal link (iOS & Android).
- Download clinical PDFs: Pull the Clinical Report PDF for a profile's latest test as a file download.
- Get raw results: Retrieve structured numeric scores, percentiles and full test history as JSON.
- Read protocols & measures: List the protocols and measures (test types) configured for your organization.
2. Endpoints at a Glance
All endpoints are POST with a JSON body (one GET exception). IDs accept a ProfileId (int) or UniqueId (GUID).
Profiles
| Method | Endpoint | Description |
|---|---|---|
| POST | GetAllProfiles | Every profile in your org — includes lastTestDate for sync. |
| POST | GetProfilesPaged | Paged, searchable, sortable list with total row count. |
| POST | GetProfile | Basic metadata for one profile. |
| POST | CreateProfile | firstName, lastName, sex (M/F), birthDate, height (in), weight (lb). |
| POST | UpdateProfile | Update an existing profile. |
Profile Detail & Results
| Method | Endpoint | Description |
|---|---|---|
| POST | GetProfileDetail | One profile + full test history + baseline averages. |
| POST | GetProfileDetailPaged | Paged detailed profiles (max 10 per page). |
| POST | GetProfileTestById | A single test by its TestId. |
| POST | GetProfileLatestTestPdf | Clinical Report PDF for the latest test (raw application/pdf). |
Codes & Assessments
| Method | Endpoint | Description |
|---|---|---|
| POST | CreateCode | Mint a test code/session — ProfileId, OrganizationProtocolId, BaselineSessionTypeId (the code type — see below), StartsOn/EndsOn. The returned code powers deep links. |
Protocols, Measures & Utility
| Method | Endpoint | Description |
|---|---|---|
| POST | GetOrganizationProtocols | Protocols configured for your org. |
| POST | GetOrganizationMeasures | Measures (test types) plus protocols. |
| POST | GetOrganizationId | Validate your key & return your OrganizationId. |
| GET | HealthCheck | Liveness check — no key required. |
Choosing a Code Type on CreateCode
BaselineSessionTypeId is effectively the code type — despite the name it does not control baselines (that's the separate isNonBaseline flag). It sets the test format and how the profile is handled:
- Single Test → a Screening in the Sway app: one of each test type in the protocol.
- Session → a full Assessment: three of each test type, plus practice.
- New… → prompts the user to enter their info (creates the profile).
- Existing… → tied to the ProfileId you pass; goes straight into testing.
| BaselineSessionTypeId | In the Sway App | Profile Handling |
|---|---|---|
| 3 – ExistingProfileSingleTest | Screening — 1 of each test | Existing profile → straight into testing |
| 5 – NewProfileSingleTest | Screening — 1 of each test | New → prompts the user for their info |
| 9 – ExistingProfileSession | Assessment — 3 of each + practice | Existing profile → straight into testing |
| 11 – NewProfileSession | Assessment — 3 of each + practice | New → prompts the user for their info |
| 8 – GroupSession | Assessment (group) | — |
| 12 – GroupSingleTest | Screening (group) | — |
3. Common Integration Patterns
Two low-lift patterns teams commonly start with.
Pull-Based · EMR Sync: Nightly Results into Your EMR
- Setup: Paste your Sway API key into your EMR.
- Match: Call GetAllProfiles and match Sway profiles to patient records, saving the Sway ID. (Single profiles can also be copy/pasted for one-off fixes.)
- Sync: Each night, use lastTestDate to find patients tested in the last 24h, then pull the latest GetProfileLatestTestPdf (or raw results via GetProfileDetail).
Deep Link · In-App Testing: Send a Patient Straight into a Test
- Your server: Call CreateProfile with the details you already have — height, weight, DOB, etc.
- Your server: Call CreateCode with the ProfileId, protocol and test details (create as many as you like per profile).
- Your app: Show a "Take Sway Test" button to the universal deep link with your code and a return URL:
https://portal.swaymedical.com/gotoapp/takebaseline?baselineCode={code}&callbackUrl={callbackUrl}
- Your app: On return, call GetProfileDetail or GetProfileLatestTestPdf to retrieve the results.
4. Getting Started
From zero to your first authenticated call.
- We enable API access for your organization.
- Generate your key. In portal.swaymedical.com → Organization (left menu) → API Key tab. An admin account is required.
- Authenticate every request with your key — either the X-ApiKey header or an apiKey field in the JSON body.
- Explore & try it out. Browse endpoints and schemas at api.swaymedical.com — no key needed to read. With a key you can run requests right from the page.
- Generate a typed client. The OpenAPI definition is NSwag-friendly — generate a C# (or any-language) client from /swagger/v1/swagger.json.
Authentication
# Option A — header
X-ApiKey: your-org-api-key
# Option B — request body
{
"apiKey": "your-org-api-key",
...
}
Send the key one way or the other. Each key is scoped to a single organization, so every call is automatically tenant-isolated.
Additional Information
Additional API options are available for custom integrations — discuss with your sales rep.
Contact your Sway Medical representative to enable API access for your organization.
Sway Medical · External API · Last updated June 2026
Want this in a PDF? Download below!