PAI Health logo


PAI Health API (2.6.5)

Getting Started

PAI is the first scientifically validated score that prescribes personal activity levels for optimal health. Our proprietary technology provides a cardiorespiratory fitness score based on a user's personal profile and heart rate data, which is an accurate assessment and predictor of long term health.

With the PAI Health API, you can integrate PAI into your organization’s health system, wearable or application.

To request access, please fill out our developer registration form.


Data in the PAI Health API is partitioned by organization. PAI Health users can be found under the PAI Health organization id 2188a980-70a2-4b24-b145-8139cb7f9106.

If you require your own organization for your integration you will need to request one as part of the registration process. Once your organization has been provisioned, you will be given an organization id to use.

The organization id is required to access any data in the Admin API and User APIs, and your account must belong to the same organization in order to be granted authorization.


Most requests to the PAI Health API will require authentication.

The PAI Health API supports Bearer authentication using an industry standard Json Web Token (JWT) access token, which can be retrieved for a given account using the Open API.

Once your have retrieved an access token for an account you need to pass in the token using an Authorization header: Authorization : Bearer {accessToken}


Within a given organization, these are the resource types you can interact with using the Admin and User APIs.

Resource Description
Account A record representing an individual or system that has API access to data within the organization
User An actual person who tracks their health data in the system
Group A groups of users
Group Member A user who currently belongs to a group
Group Membership A record of which groups a user belongs to
Group Event A group member event (Joined, Removed, etc.)
Profile The current user’s personal information
Heartrate Summary Heartrate record of a user for a particular day including heart rate measurements (bpm)
Biometric Biometric data (ie. max heart rate, resting heart rate, weight, height) associated with a user for a particular day
PAI Summary Summary of PAI information (current PAI score, daily PAI earned, intensity zones, etc.) for a user for a particular day
PAI Calculation A PAI calculation that triggers automatically as new heart rate data comes in for a user (given valid biometrics)
VO2 Max Assessment An assessment that generates a VO2 max summary based off of self-reported activity and biometrics
VO2 Max Summary Summary of VO2 max information (VO2 max score, calibration status, etc.) for a user for a particular day
VO2 Max Calculation A VO2 max calculation that triggers automatically as new PAI summary information comes in for a user (given valid biometrics)
Webhook An external subscription to various events within the PAI Health API

Global API

Used by all accounts to determine where an account's data is stored within the PAI Health API available regions.

  • Authenticate an account
  • Reset a password
  • Register an account

View the detailed Global API Documentation here.

Open API

Used by all accounts to authenicate with the PAI Health API.

  • Authenticate an account
  • Reset a password
  • Register an account
  • Resend a confirmation email
  • Confirm an account email

View the detailed Open API Documentation here.

Admin API

Used by organization Administrators to manage accounts and view user data across the organization.

  • Administrate accounts and users
  • Administrate groups and group members
  • Access user heartrates and biometrics
  • Access user PAI summaries
  • Access user vo2 max summaries

View the detailed Admin API Documentation here.

User API

Used by end-users to manage and view their personal data.

  • Change personal account information
  • Access personal biometrics and heartrates
  • Access personal PAI summaries
  • Access personal vo2 max summaries

View the detailed User API Documentation here.

Program API

Used by program administrators to manage and view their members' PAI data.

  • Invite users to join your program
  • Manage your program members
  • Export your program members' PAI data

View the detailed Program API Documentation here.


Naming Conventions

Common Fields

Request Headers

Allow HTTP method override

The POST method supports the custom header X-HTTP-Method-Override which will override the http method being used. This is useful for legacy browser support that doesnt support the full set of Http verbs.


The Content-Type header is used to determine the format for the representation of the resource. Only application/json is supported currently.


Accept-Language header is used to determine any localization for the resource.


X-No-Return-Resource header can be used to exclude the resource from being returned in the response body. By default the resource is returned in the body for POST, PUT, and PATCH operations, but you may want to override this behaviour for performance reasons if you don't need the returned resource.

Response Headers


The Location header is always returned in the response of any POST request that creates a new resource with the fully-qualified URL of the resource.

The common 'href' field also contain this same URL.

The Link header is used to support HATEOS for navigation and discoverability through the API.

A Link header is returned for a resource if there are related resources (child resources, collection links etc) the client may be interested in (see more on collection headers below).

Links are fully qualified and require no parsing on the consumer side. Following the Link header RFC standard, multiple links are separated by commas.


<>; rel="resource"

Partial Responses (Field Selection)

The PAI Health API supports the return of partial resources via field selection to optimize payloads for clients. This allows clients to select which fields they are interested in and optimize their payload accordingly. Currently this is only supported on GET requests.

GET /api/v2/admin/organizations/2188a980-70a2-4b24-b145-8139cb7f9106/users?fields=firstName,lastName

This example would only contain the firstName and lastName fields for all user resources returned. Fields are validated against the resource model to ensure they all exist on the resource. If not, a 400 Bad Request error will be returned.


Collection endpoints return a simple array of resources.

[{resource1}, {resource2}, .. ]

Collections support filtering, sorting, and paging.



Simple filtering is supported to reduce the result set using simple equality statements.

GET /api/v2/admin/organizations/2188a980-70a2-4b24-b145-8139cb7f9106/users?firstName=Joe

GET /api/v2/admin/organizations/2188a980-70a2-4b24-b145-8139cb7f9106/users?firstName=Joe&country=CA

Simple filtering only supports =. Multiple simple filters can be combined as separate query params using the &. Unknown filter params will be ignored.


Complex filtering is supported to reduce the result set using a broader set of conditions.

GET /api/v2/admin/organizations/2188a980-70a2-4b24-b145-8139cb7f910/pai/summaries?q=(paiScore>=100 AND paiScore<=160) OR userId IN ["id123", "id456"]

GET /api/v2/admin/organizations/2188a980-70a2-4b24-b145-8139cb7f910/accounts?q=accountType=Regular AND (accountStatus LIKE _ct%)

Supported tokens are currently =,<,>,<=,>=,!=, IN, NOT IN, LIKE and each condition should be separated by a logical condition AND or OR.


  • Spaces are required between IN, NOT IN, AND, OR, LIKE, ILIKE keywords
  • The LIKE and ILIKE keywords can only be used for string fields, and it supports two wildcards %(0 or 1+ chars) and _(a single char)
  • Queries should be URL encoded to avoid any parsing errors
  • Quotes are not strictly required for string values unless you need to use ", (, ) within the value
  • Nested conditions are supported up to 4 levels deep within parentheses ( )
  • Extra spaces between terms is ignored if not with double-quotes "

The following will result in a 400 Bad Request:

  • Any of the resource fields in the filter do not exist as filterable query params on the resource
  • Invalid query format is provided (i.e. q=nonsense)
  • Max query length is exceeded (currently 5000 characters)
  • Nested condition depth over 4 levels


Sorting is specified with the sort parameter and supports ascending and descending sorting over multiple fields.

GET /api/v2/organizations/2188a980-70a2-4b24-b145-8139cb7f910/users?sort=-lastName,firstName

Use - to denote descending order, and separate multiple fields with commas. Sort priority is left to right.
Validation ensures all of the resource fields in the sort exist as filterable query params on the resource. If not, a 400 Bad Request error is returned.


Paging is specified with the offset and limit parameters to allow the client to select the set of data they want to use.

Total count for the request is returned as a custom header, along with the limit and offset information.

X-Pagination-Count: 53
X-Pagination-Offset: 5
X-Pagination-Limit: 20

The links header includes pagination information for next, prev, first, and last (at a minimum):


<>; rel="first",
<>; rel="prev",
<>; rel="next",
<>; rel="last",

Paging also takes into account any filters and sorting that has been specified - this applies to the links generated for navigation, counts, etc.

Caching & Compression

Deflate and Gzip are supported by default for anything over 1kb in size unless the X-No-Compression header is sent in the request.

In addition, we support client caching using the 304 (Not Modified) response using the following options below.


Responses include a header ETag containing a hash or checksum of the representation. This value changes whenever the output representation changes.

If an inbound HTTP request contains a If-None-Match header with a matching ETag value for a given resource, the API will return a 304 Not Modified status code and no content instead of the output representation of the resource.


The response header Last-Modified contains a timestamp in RFC 1123 (e.g. Mon, 15 Jun 2009 20:45:30 GMT) format using the modifiedOn field as the value.

If an inbound request contains If-Modified-Since header with a value greater than than the modifiedOn field then the API will return a 304 Not Modified status code and no content instead of the output representation of the resource.

Throttling & Rate-Limits

Rate-limiting on the API is controlled at the organization level.

If the number of requests exceeds the rate limit for the API, a 429 (Too Many Requests) status code will be returned.


Standard Error Payload

Any errors returned by the PAI Health API will return 4xx or 5xx status codes, and use the following standard error payload in the response body:

  "errors": [
      "message": "Sorry, we cannot save your workout at this time",
      "code": "INVALID_HEARTRATE"
      "errors": [

Common Status and Error Codes

Status Code Standard Error Code Description
400 BAD_REQUEST Invalid request. Malformed or invalid parameters. Error message should be explained in the error payload.
401 UNAUTHORIZED The request requires a user authentication. Used when no authentication is supplied.
403 FORBIDDEN Access is not allowed to perform that action on that resource. Used when user is authenticated but does not have the correct permissions (authorization).
404 NOT_FOUND No resource exists at this URI
405 METHOD_NOT_ALLOWED VERB is not supported on this resource
415 UNSUPPORTED_MEDIA_TYPE If request contains Content-Type that is not supported in the API
500 INTERNAL_SERVER_ERROR An unexpected error. Should not normally be returned, but any uncaught exceptions at the application layer should get caught by a global error handler and return a 500. Should be logged and a generic error payload returned to the client.