PAI Health logo

Developers

PAI Health API - Global

Download OpenAPI specification:Download

PAI Health Global services

Auth

CORS support

Enable CORS preflight requests

Responses

200

Default response for CORS method

options /api/v2/auth/oauth
https://api.paihealth.com/api/v2/auth/oauth

OAuth2 token endpoint

Creates new access/refresh token pair using various OAuth2 Grant types.

header Parameters
User-Agent
string

If provided, this value is stored with the Grant record to help differentiate it from Grants for other devices.

Request Body schema: application/x-www-form-urlencoded

The account credentials.

organization_id
required
string <uuid>

The organization the account belongs to.

client_id
required
string <uuid>

The authentication client id to authenticate against.

grant_type
required
string

The type of OAuth Grant being used to request Access/Refresh Tokens. Currently supported: "password" & "refresh_token"

username
required
string

The Resource Owner's PAI Health username.

password
string

The Resource Owner's PAI Health password. Required for Resource Owner Password Credentials Grant ("password").

refresh_token
string

An unused refresh token, as returned by a previous token request. Required for Refresh Token Grant ("refresh_token").

scope
string

Optional. Not supported at this time.

Responses

200

New tokens successfully created

400

Bad request due to missing or invalid parameters

401

Authentication credentials/token are missing or invalid

500

Server error

post /api/v2/auth/oauth
https://api.paihealth.com/api/v2/auth/oauth

CORS support

Enable CORS preflight requests

Responses

200

Default response for CORS method

options /api/v2/auth/registration
https://api.paihealth.com/api/v2/auth/registration

Register for an account

Register for an account.

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

The account credential.

firstName
string [ 1 .. 255 ] characters

First name of user.

lastName
string [ 1 .. 255 ] characters

Last name of user.

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.

password
required
string [ 8 .. 100 ] characters

Password for the account.

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

Phone number for the account.

country
string <ISO 3166-1 alpha-2>
Enum: "AD" "AE" "AF" "AG" "AI" "AL" "AM" "AO" "AQ" "AR" "AS" "AT" "AU" "AW" "AX" "AZ" "BA" "BB" "BD" "BE" "BF" "BG" "BH" "BI" "BJ" "BL" "BM" "BN" "BO" "BQ" "BR" "BS" "BT" "BV" "BW" "BY" "BZ" "CA" "CC" "CD" "CF" "CG" "CH" "CI" "CK" "CL" "CM" "CN" "CO" "CR" "CU" "CV" "CW" "CX" "CY" "CZ" "DE" "DJ" "DK" "DM" "DO" "DZ" "EC" "EE" "EG" "EH" "ER" "ES" "ET" "FI" "FJ" "FK" "FM" "FO" "FR" "GA" "GB" "GD" "GE" "GF" "GG" "GH" "GI" "GL" "GM" "GN" "GP" "GQ" "GR" "GS" "GT" "GU" "GW" "GY" "HK" "HM" "HN" "HR" "HT" "HU" "ID" "IE" "IL" "IM" "IN" "IO" "IQ" "IR" "IS" "IT" "JE" "JM" "JO" "JP" "KE" "KG" "KH" "KI" "KM" "KN" "KP" "KR" "KW" "KY" "KZ" "LA" "LB" "LC" "LI" "LK" "LR" "LS" "LT" "LU" "LV" "LY" "MA" "MC" "MD" "ME" "MF" "MG" "MH" "MK" "ML" "MM" "MN" "MO" "MP" "MQ" "MR" "MS" "MT" "MU" "MV" "MW" "MX" "MY" "MZ" "NA" "NC" "NE" "NF" "NG" "NI" "NL" "NO" "NP" "NR" "NU" "NZ" "OM" "PA" "PE" "PF" "PG" "PH" "PK" "PL" "PM" "PN" "PR" "PS" "PT" "PW" "PY" "QA" "RE" "RO" "RS" "RU" "RW" "SA" "SB" "SC" "SD" "SE" "SG" "SH" "SI" "SJ" "SK" "SL" "SM" "SN" "SO" "SR" "SS" "ST" "SV" "SX" "SY" "SZ" "TC" "TD" "TF" "TG" "TH" "TJ" "TK" "TL" "TM" "TN" "TO" "TR" "TT" "TV" "TW" "TZ" "UA" "UG" "UM" "US" "UY" "UZ" "VA" "VC" "VE" "VG" "VI" "VN" "VU" "WF" "WS" "XK" "YE" "YT" "ZA" "ZM" "ZW"

The country of user's location.

registrationSource
required
string <= 100 characters

Registration source for the account.

registeredAt
required
string <date-time>

Timestamp of the account registration.

region
string [ 3 .. 5 ] characters

The region this account will be registered in

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.

organizationId
string

The id for the organization

Responses

201

Account Created

400

Bad request due to missing or invalid parameters

500

Server error

post /api/v2/auth/registration
https://api.paihealth.com/api/v2/auth/registration

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "firstName": "string",
  • "lastName": "string",
  • "username": "string",
  • "email": "user@example.com",
  • "password": "stringst",
  • "phoneNumber": "string",
  • "country": "AD",
  • "registrationSource": "string",
  • "registeredAt": "2020-08-24T22:15:06Z",
  • "region": "strin",
  • "termsAccepted": true,
  • "isSubscribed": true,
  • "organizationId": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token": "string",
  • "session":
    {
    }
}

CORS support

Enable CORS preflight requests

Responses

200

Default response for CORS method

options /api/v2/auth/forgotpassword
https://api.paihealth.com/api/v2/auth/forgotpassword

Request password reset for an account

Sends a password reset email for an account.

Request Body schema: application/json

The forgot password required information.

email
required
string <email>

The email tied to the account

organizationId
required
string

The id for the organization

source
string
Enum: "Portal" "Dashboard"

Responses

201

Reset Password Requested

400

Bad request due to missing or invalid parameters

500

Server error

post /api/v2/auth/forgotpassword
https://api.paihealth.com/api/v2/auth/forgotpassword

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "email": "user@example.com",
  • "organizationId": "string",
  • "source": "Portal"
}

Response samples

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

Programs

CORS support

Enable CORS preflight requests

path Parameters
organizationId
required
string <uuid>

Organization Id this resource belongs to.

programId
required
string <uuid>

The id of this resource.

Responses

200

Default response for CORS method

options /api/v2/organizations/{organizationId}/programs/{programId}/accounts
https://api.paihealth.com/api/v2/organizations/{organizationId}/programs/{programId}/accounts

Provision a program member

Provisions a program member, creating an account and user if not existing, sends a welcome email

path Parameters
organizationId
required
string <uuid>

Organization Id this resource belongs to.

programId
required
string <uuid>

The id of this resource.

Request Body schema: application/json

The program account to be provisioned.

email
required
string <email> (ProgramMemberEmail) [ 5 .. 100 ] characters
firstName
required
string (ProgramMemberFirstName) <= 255 characters

The program members first name

lastName
required
string (ProgramMemberLastName) <= 255 characters

The program members last name

externalId
string (ProgramMemberExternalId)

Identifier to associate program member with an external record

role
required
string (ProgramMemberRoleModel)
Enum: "Owner" "Administrator" "Moderator" "Participant"

The role of the program member

registrationSource
required
string <= 100 characters

Registration source for the account.

registeredAt
required
string <date-time>

Timestamp of the account registration.

targetRegion
string [ 3 .. 5 ] characters

The region this program account will be registered in. If an account with the given email already exists, the targetRegion must match the region of the existing account.

Responses

201

Program member successfully provisioned

400

Bad request due to missing or invalid parameters

401

Authorization token is missing or invalid

403

The authenticated user is not permitted to perform this action

404

The request references a non-existent object identifier

500

Server error

post /api/v2/organizations/{organizationId}/programs/{programId}/accounts
https://api.paihealth.com/api/v2/organizations/{organizationId}/programs/{programId}/accounts

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "email": "user@example.com",
  • "firstName": "string",
  • "lastName": "string",
  • "externalId": "string",
  • "role": "Owner",
  • "registrationSource": "string",
  • "registeredAt": "2020-08-24T22:15:07Z",
  • "targetRegion": "strin"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "programMember":
    {
    },
  • "account":
    {
    }
}