PAI Health logo

Developers

PAI Health API - User (2.4.3)

Download OpenAPI specification:Download

PAI Health services for individual Users

Authentication

jwtUserAuthorizer

Security scheme type: API Key
header parameter name: Authorization

My Account

CORS support

Enable CORS preflight requests

Responses

200

Default response for CORS method

options /user/api/v2/myaccount
https://na1.api-dev.paihealth.com/user/api/v2/myaccount

Get the current user's account

Get the currently logged in user's account.

Authorizations:

Responses

200

Resource returned

304

Not modified

400

Missing or invalid parameters

401

Authorization token is missing or invalid

404

Resource not found

500

An unexpected error occurred

get /user/api/v2/myaccount
https://na1.api-dev.paihealth.com/user/api/v2/myaccount

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "accountStatus": "Pending",
  • "emailConfirmed": true,
  • "createdAt": "2019-04-16T19:00:19Z",
  • "createdBy": "string",
  • "modifiedAt": "2019-04-16T19:00:19Z",
  • "modifiedBy": "string",
  • "href": "string",
  • "username": "string",
  • "email": "user@example.com",
  • "phoneNumber": "string",
  • "registrationSource": "string",
  • "registeredAt": "2019-04-16T19:00:19Z",
  • "termsAccepted": true,
  • "isSubscribed": true,
  • "role": "Member",
  • "accountType": "Service",
  • "provisioningStatus": "Started",
  • "userId": "string"
}

Update the current user's account

Update the currently logged in user's account.

Authorizations:
header Parameters
X-No-Return-Resource
string

If set to any value, resource(s) will not be returned in response

Request Body schema: application/json
id
string <uuid>

Universally unique identifier for the account.

accountStatus
string
Enum:"Pending" "Active" "Locked" "Disabled"

Current Status of this account.

emailConfirmed
boolean

Whether the account email has been confirmed.

createdAt
string <date-time>

Resource creation timestamp.

createdBy
string <uuid>

Resource created by account id.

modifiedAt
string <date-time>

Resource last modification timestamp.

modifiedBy
string <uuid>

Resource last modified by account id.

href
string <url>

Fully qualified href representing this resource location.

username
required
string [ 5 .. 100 ] characters ^[0-9]*[a-z][a-z0-9_@.-]+$

Username of the account. Supports lower-case alphanumeric characters and the [@, . , - , _] symbols.

email
required
string <email>

Contact email for the account.

phoneNumber
string <phone> [ 1 .. 25 ] characters

Phone number for the account.

registrationSource
required
string <= 100 characters

Registration source for the account.

registeredAt
required
string <date-time>

Timestamp of the account registration.

termsAccepted
required
boolean

Whether the terms and conditions for the account have been accepted.

isSubscribed
boolean

Whether the account is subscribed for news and marketing updates.

role
string
Default: "Member"
Enum:"Member" "Developer" "Admin" "Owner" "SystemAdmin"

Role assigned to this account.

accountType
string
Default: "Service"
Enum:"Regular" "Service"

Type of account.

provisioningStatus
string
Default: "Started"
Enum:"Started" "Completed"

Provisioning status of the account.

userId
string <uuid>

The user id tied to this account for 'Regular' account type.

Responses

200

Resource updated

400

Missing or invalid parameters

401

Authorization token is missing or invalid

404

Resource not found

500

An unexpected error occurred

put /user/api/v2/myaccount
https://na1.api-dev.paihealth.com/user/api/v2/myaccount

Request samples

application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "accountStatus": "Pending",
  • "emailConfirmed": true,
  • "createdAt": "2019-04-16T19:00:20Z",
  • "createdBy": "string",
  • "modifiedAt": "2019-04-16T19:00:20Z",
  • "modifiedBy": "string",
  • "href": "string",
  • "username": "string",
  • "email": "user@example.com",
  • "phoneNumber": "string",
  • "registrationSource": "string",
  • "registeredAt": "2019-04-16T19:00:20Z",
  • "termsAccepted": true,
  • "isSubscribed": true,
  • "role": "Member",
  • "accountType": "Service",
  • "provisioningStatus": "Started",
  • "userId": "string"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "accountStatus": "Pending",
  • "emailConfirmed": true,
  • "createdAt": "2019-04-16T19:00:20Z",
  • "createdBy": "string",
  • "modifiedAt": "2019-04-16T19:00:20Z",
  • "modifiedBy": "string",
  • "href": "string",
  • "username": "string",
  • "email": "user@example.com",
  • "phoneNumber": "string",
  • "registrationSource": "string",
  • "registeredAt": "2019-04-16T19:00:20Z",
  • "termsAccepted": true,
  • "isSubscribed": true,
  • "role": "Member",
  • "accountType": "Service",
  • "provisioningStatus": "Started",
  • "userId": "string"
}

Patch the current user's account

Patch the current user's account, with RFC 6902 patch syntax. Patchable fields are: phoneNumber, isSubscribed, provisioningStatus.

Authorizations:
header Parameters
X-No-Return-Resource
string

If set to any value, resource(s) will not be returned in response

Request Body schema: application/json
Array
op
required
string
Enum:"add" "remove" "replace" "move" "copy" "test"

RFC 6902 JSON Operation name

path
required
string

RFC 6901 JSON Pointer

value
any

Required for operations add, replace and test, to specify a value.

from
string

RFC 6901 JSON Pointer, required for move and copy operations, to specify a source field.

Responses

200

Resource updated

400

Missing or invalid parameters

401

Authorization token is missing or invalid

403

Insufficient privileges to perform this action

404

Resource not found

422

Entity can not be processed

500

An unexpected error occurred

patch /user/api/v2/myaccount
https://na1.api-dev.paihealth.com/user/api/v2/myaccount

Request samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "accountStatus": "Pending",
  • "emailConfirmed": true,
  • "createdAt": "2019-04-16T19:00:20Z",
  • "createdBy": "string",
  • "modifiedAt": "2019-04-16T19:00:20Z",
  • "modifiedBy": "string",
  • "href": "string",
  • "username": "string",
  • "email": "user@example.com",
  • "phoneNumber": "string",
  • "registrationSource": "string",
  • "registeredAt": "2019-04-16T19:00:20Z",
  • "termsAccepted": true,
  • "isSubscribed": true,
  • "role": "Member",
  • "accountType": "Service",
  • "provisioningStatus": "Started",
  • "userId": "string"
}

CORS support

Enable CORS preflight requests

Responses

200

Default response for CORS method

options /user/api/v2/myaccount/email
https://na1.api-dev.paihealth.com/user/api/v2/myaccount/email

Change email address

Change email address for a given account

Authorizations:
header Parameters
X-No-Return-Resource
string

If set to any value, resource(s) will not be returned in response

Request Body schema: application/json
email
required
string <email>

The new email address for the account

Responses

204

Email changed

400

Bad request due to missing or invalid parameters

401

Missing authorization token

403

Authorization token invalid

404

Account not found

500

Server error

post /user/api/v2/myaccount/email
https://na1.api-dev.paihealth.com/user/api/v2/myaccount/email

Request samples

application/json
Copy
Expand all Collapse all
{
  • "email": "user@example.com"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

CORS support

Enable CORS preflight requests.

Responses

200

Default response for CORS method.

options /user/api/v2/myaccount/oauth2/providers/grants
https://na1.api-dev.paihealth.com/user/api/v2/myaccount/oauth2/providers/grants

Get a list of OAuth2 provider grants

Returns a list of OAuth2 provider grants for an account according to filters and sort order.

Authorizations:
query Parameters
limit
integer [ 1 .. 1000 ]
Default: 20

The number of items to limit the query to. Defaults to 20, maximum is 1000.

offset
integer >= 0
Default: 0

The number of items to skip when querying. Defaults to 0.

fields
Array of string

Selected fields to be returned. By default all fields will be returned.

  • /resourceUrl?fields=field1,field2
sort
Array of string

Fields to sort results by. The field name can optionally be prepended with '-' sign to indicate descending ordering. The default is ascending and sort order is applied from left to right.

q
string <= 1000 characters

Advanced filter query, supports more operators [>, >=, !-, <. <=, IN, NOT IN, LIKE] than simple filters.

  • /resourceUrl?q=field1 >= 2017-09-27T22:39:28Z AND (field2=someValue OR field3 IN [1,2,3])

Multiple filters are delimited with the "AND" or "OR" keywords and may be nested with ().

providerId
string <uuid>

Filter by providerId.

grantStatus
string
Enum:"Issued" "Consumed" "Rejected"

Filter by grantStatus.

createdBy
string <uuid>

Filter by createdBy.

createdAt
string <date-time>

Filter by createdAt.

modifiedBy
string <uuid>

Filter by modifiedBy.

modifiedAt
string <date-time>

Filter by modifiedAt.

Responses

200

Resources returned

304

Not modified

400

Missing or invalid parameters

401

Authorization token is missing or invalid

403

Insufficient privileges to perform this action

404

Resource not found

500

An unexpected error occurred

get /user/api/v2/myaccount/oauth2/providers/grants
https://na1.api-dev.paihealth.com/user/api/v2/myaccount/oauth2/providers/grants

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Post new OAuth2 provider grants

Creates new OAuth2 provider grants for an account.

Authorizations:
header Parameters
X-No-Return-Resource
string

If set to any value, resource(s) will not be returned in response

Request Body schema: application/json
Array
providerId
required
string <uuid>

The OAuth2 provider id

issuedAt
required
string <date-time>

The date and time when the Grant was issued

authorizationCode
required
string

The OAuth2 Authorization Code for this Grant

grantStatus
required
string
Enum:"Issued" "Consumed" "Rejected"

Issued means it has not been used to retrieve an token pair, Consumed means it has, and Rejected means the Resource Server considers it invalid

tokens
Array of object (OAuth2ProviderTokenModel)

Responses

200

Multiple resources created

201

Single resource created

400

Bad request due to missing or invalid parameters

401

Authorization Token is missing or invalid

403

Insufficient privileges to perform this action

404

Resource not found

500

Server error

post /user/api/v2/myaccount/oauth2/providers/grants
https://na1.api-dev.paihealth.com/user/api/v2/myaccount/oauth2/providers/grants

Request samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

CORS support

Enable CORS preflight requests.

path Parameters
oAuth2providerId
required
string <uuid>

The unique ID of the OAuth2 provider

Responses

200

Default response for CORS method.

options /user/api/v2/myaccount/oauth2/providers/{oAuth2providerId}/grant
https://na1.api-dev.paihealth.com/user/api/v2/myaccount/oauth2/providers/{oAuth2providerId}/grant

Get OAuth2 provider grant by providerId

Returns OAuth2 provider grant by providerId for an account.

Authorizations:
path Parameters
oAuth2providerId
required
string <uuid>

The unique ID of the OAuth2 provider

Responses

200

Resource returned

304

Not modified

400

Missing or invalid parameters

401

Authorization Token is missing or invalid

403

Insufficient privileges to perform this action

404

Resource not found

500

An unexpected error occurred

get /user/api/v2/myaccount/oauth2/providers/{oAuth2providerId}/grant
https://na1.api-dev.paihealth.com/user/api/v2/myaccount/oauth2/providers/{oAuth2providerId}/grant

Response samples

application/json
Copy
Expand all Collapse all
{
  • "createdAt": "2019-04-16T19:00:20Z",
  • "createdBy": "string",
  • "modifiedAt": "2019-04-16T19:00:20Z",
  • "modifiedBy": "string",
  • "href": "string",
  • "providerId": "string",
  • "issuedAt": "2019-04-16T19:00:20Z",
  • "authorizationCode": "string",
  • "grantStatus": "Issued",
  • "tokens":
    [
    ]
}

Patch OAuth2 provider grant by providerId

Patches OAuth2 provider grant by providerId for an account, with RFC 6902 patch syntax. Patchable field is: grantStatus.

Authorizations:
path Parameters
oAuth2providerId
required
string <uuid>

The unique ID of the OAuth2 provider

header Parameters
X-No-Return-Resource
string

If set to any value, resource(s) will not be returned in response

Request Body schema: application/json
Array
op
required
string
Enum:"add" "remove" "replace" "move" "copy" "test"

RFC 6902 JSON Operation name

path
required
string

RFC 6901 JSON Pointer

value
any

Required for operations add, replace and test, to specify a value.

from
string

RFC 6901 JSON Pointer, required for move and copy operations, to specify a source field.

Responses

200

Resource updated

400

Missing or invalid parameters

401

Authorization Token is missing or invalid

403

Insufficient privileges to perform this action

404

Resource not found

422

Entity can not be processed

500

An unexpected error occurred

patch /user/api/v2/myaccount/oauth2/providers/{oAuth2providerId}/grant
https://na1.api-dev.paihealth.com/user/api/v2/myaccount/oauth2/providers/{oAuth2providerId}/grant

Request samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Response samples

application/json
Copy
Expand all Collapse all
{
  • "createdAt": "2019-04-16T19:00:20Z",
  • "createdBy": "string",
  • "modifiedAt": "2019-04-16T19:00:20Z",
  • "modifiedBy": "string",
  • "href": "string",
  • "providerId": "string",
  • "issuedAt": "2019-04-16T19:00:20Z",
  • "authorizationCode": "string",
  • "grantStatus": "Issued",
  • "tokens":
    [
    ]
}

Delete OAuth2 provider grant by providerId

Deletes OAuth2 provider grant by providerId, along with any associated tokens for an account.

Authorizations:
path Parameters
oAuth2providerId
required
string <uuid>

The unique ID of the OAuth2 provider

Responses

204

Deleted

400

Bad request due to missing or invalid parameters

401

Authorization Token is missing or invalid

403

Insufficient privileges to perform this action

404

Resource not found

500

Server error

delete /user/api/v2/myaccount/oauth2/providers/{oAuth2providerId}/grant
https://na1.api-dev.paihealth.com/user/api/v2/myaccount/oauth2/providers/{oAuth2providerId}/grant

Response samples

application/json
Copy
Expand all Collapse all
{
  • "errors":
    [
    ]
}

My Biometrics

CORS support

Enable CORS preflight requests

Responses

200

Default response for CORS method

options /user/api/v2/mybiometrics
https://na1.api-dev.paihealth.com/user/api/v2/mybiometrics

Get all biometrics

Returns a paged list of biometrics according to filters and sort order.

Authorizations:
query Parameters
limit
integer [ 1 .. 1000 ]
Default: 20

The number of items to limit the query to. Defaults to 20, maximum is 1000.

offset
integer >= 0
Default: 0

The number of items to skip when querying. Defaults to 0.

fields
Array of string

Selected fields to be returned. By default all fields will be returned.

  • /resourceUrl?fields=field1,field2
sort
Array of string

Fields to sort results by. The field name can optionally be prepended with '-' sign to indicate descending ordering. The default is ascending and sort order is applied from left to right.

q
string <= 1000 characters

Advanced filter query, supports more operators [>, >=, !-, <. <=, IN, NOT IN, LIKE] than simple filters.

  • /resourceUrl?q=field1 >= 2017-09-27T22:39:28Z AND (field2=someValue OR field3 IN [1,2,3])

Multiple filters are delimited with the "AND" or "OR" keywords and may be nested with ().

calendarDay
string <date>

Filter by calendarDay

biometricType
string
Enum:"MaxHR" "SleepRHR" "AwakeRHR" "Height" "Weight" "BirthDate" "Sex"

Filter by biometricType.

createdBy
string <uuid>

Filter by createdBy.

createdAt
string <date-time>

Filter by createdAt.

modifiedBy
string <uuid>

Filter by modifiedBy.

modifiedAt
string <date-time>

Filter by modifiedAt.

Responses

200

Resources returned

304

Not modified

400

Missing or invalid parameters

401

Authorization token is missing or invalid

403

Insufficient privileges to perform this action

500

An unexpected error occurred

get /user/api/v2/mybiometrics
https://na1.api-dev.paihealth.com/user/api/v2/mybiometrics

Create new or update existing biometrics

Create new biometrics or update existing biometrics with matching userId, calendarDay and biometricType

Authorizations:
header Parameters
X-No-Return-Resource
string

If set to any value, resource(s) will not be returned in response

Request Body schema: application/json
Array
userId
required
string <uuid>

ID of the user for this biometric

calendarDay
required
string <date>

Date for this biometric recording

value
required
string

Value of this biometric

biometricType
required
string
Enum:"MaxHR" "SleepRHR" "AwakeRHR" "Height" "Weight" "BirthDate" "Sex"

The type of biometric:

  • Maximum Heart Rate (bpm)
  • Sleep Resting Heart Rate (bpm)
  • Awake Resting Heart Rate (bpm)
  • Height (cm)
  • Weight (kg)
  • BirthDate (date)
  • Sex ("M" or "F")
source
string

Source of this biometric

Responses

201

Resource created/updated

400

Missing or invalid parameters

401

Authorization token is missing or invalid

403

Insufficient privileges to perform this action

500

An unexpected error occurred

post /user/api/v2/mybiometrics
https://na1.api-dev.paihealth.com/user/api/v2/mybiometrics

Request samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

CORS support

Enable CORS preflight requests

Responses

200

Default response for CORS method

options /user/api/v2/mybiometrics/latest
https://na1.api-dev.paihealth.com/user/api/v2/mybiometrics/latest

Get latest biometric of each type for all users

Returns a paged list of latest biometrics according to filters and sort order.

Authorizations:
query Parameters
limit
integer [ 1 .. 1000 ]
Default: 20

The number of items to limit the query to. Defaults to 20, maximum is 1000.

offset
integer >= 0
Default: 0

The number of items to skip when querying. Defaults to 0.

fields
Array of string

Selected fields to be returned. By default all fields will be returned.

  • /resourceUrl?fields=field1,field2
sort
Array of string

Fields to sort results by. The field name can optionally be prepended with '-' sign to indicate descending ordering. The default is ascending and sort order is applied from left to right.

q
string <= 1000 characters

Advanced filter query, supports more operators [>, >=, !-, <. <=, IN, NOT IN, LIKE] than simple filters.

  • /resourceUrl?q=field1 >= 2017-09-27T22:39:28Z AND (field2=someValue OR field3 IN [1,2,3])

Multiple filters are delimited with the "AND" or "OR" keywords and may be nested with ().

biometricType
string
Enum:"MaxHR" "SleepRHR" "AwakeRHR" "Height" "Weight" "BirthDate" "Sex"

Filter by biometricType.

createdBy
string <uuid>

Filter by createdBy.

createdAt
string <date-time>

Filter by createdAt.

modifiedBy
string <uuid>

Filter by modifiedBy.

modifiedAt
string <date-time>

Filter by modifiedAt.

Responses

200

Resources returned

400

Missing or invalid parameters

401

Authorization token is missing or invalid

403

Insufficient privileges to perform this action

500

An unexpected error occurred

get /user/api/v2/mybiometrics/latest
https://na1.api-dev.paihealth.com/user/api/v2/mybiometrics/latest

CORS support

Enable CORS preflight requests

path Parameters
id
required
string <uuid>

Id of this resource.

Responses

200

Default response for CORS method

options /user/api/v2/mybiometrics/{id}
https://na1.api-dev.paihealth.com/user/api/v2/mybiometrics/{id}

Get the biometric specified by the id

Returns a single biometric object

Authorizations:
path Parameters
id
required
string <uuid>

Id of this resource.

Responses

200

Resources returned

304

Not modified

400

Missing or invalid parameters

401

Authorization token is missing or invalid

403

Insufficient privileges to perform this action

404

Resource not found

500

An unexpected error occurred

get /user/api/v2/mybiometrics/{id}
https://na1.api-dev.paihealth.com/user/api/v2/mybiometrics/{id}

Patch the biometric specified by the id

Patch a single biometric value for a particular calendar day and biometric type

Authorizations:
path Parameters
id
required
string <uuid>

Id of this resource.

header Parameters
X-No-Return-Resource
string

If set to any value, resource(s) will not be returned in response

Request Body schema: application/json
Array
op
required
string
Enum:"add" "remove" "replace" "move" "copy" "test"

RFC 6902 JSON Operation name

path
required
string

RFC 6901 JSON Pointer

value
any

Required for operations add, replace and test, to specify a value.

from
string

RFC 6901 JSON Pointer, required for move and copy operations, to specify a source field.

Responses

200

Resource updated

400

Missing or invalid parameters

401

Authorization token is missing or invalid

403

Insufficient privileges to perform this action

404

Resource not found

422

Entity can not be processed