PAI Health logo

Developers

PAI Health API - Auth

Download OpenAPI specification:Download

PAI Health Auth services

Auth

CORS support

Enable CORS preflight requests

Responses

200

Default response for CORS method

options /api/v2/auth

North America Server

https://na1.api.paihealth.com/api/v2/auth

Asia Pacific Server

https://apac1.api.paihealth.com/api/v2/auth

Authenticate an account

Creates an authenticated session 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 credentials.

username
required
string <username> [ 5 .. 100 ] characters

The username tied to the account

password
required
string [ 8 .. 100 ] characters

The password for the account.

organizationId
string

The id for the organization

Responses

201

Resource created

400

Bad request due to missing or invalid parameters

500

Server error

post /api/v2/auth

North America Server

https://na1.api.paihealth.com/api/v2/auth

Asia Pacific Server

https://apac1.api.paihealth.com/api/v2/auth

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "username": "string",
  • "password": "stringst",
  • "organizationId": "string"
}

CORS support

Enable CORS preflight requests

path Parameters
resetPasswordToken
required
string <uuid>

Token for resetting password

Responses

200

Default response for CORS method

options /api/v2/auth/resetpassword/{resetPasswordToken}

North America Server

https://na1.api.paihealth.com/api/v2/auth/resetpassword/{resetPasswordToken}

Asia Pacific Server

https://apac1.api.paihealth.com/api/v2/auth/resetpassword/{resetPasswordToken}

Reset password for an account

Resets the password for the given account.

path Parameters
resetPasswordToken
required
string <uuid>

Token for resetting password

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.

password
required
string [ 8 .. 100 ] characters

The password for the account.

accountId
required
string <uuid>

The account id

organizationId
required
string

The id for the organization

Responses

204

Password updated

400

Bad request due to missing or invalid parameters

403

Invalid Reset Password Token

500

Server error

post /api/v2/auth/resetpassword/{resetPasswordToken}

North America Server

https://na1.api.paihealth.com/api/v2/auth/resetpassword/{resetPasswordToken}

Asia Pacific Server

https://apac1.api.paihealth.com/api/v2/auth/resetpassword/{resetPasswordToken}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "password": "stringst",
  • "accountId": "string",
  • "organizationId": "string"
}

Response samples

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

CORS support

Enable CORS preflight requests

Responses

200

Default response for CORS method

options /api/v2/auth/forgotpassword

North America Server

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

Asia Pacific Server

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

Request password reset for an account

Sends a password reset email 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.

email
required
string <email>

The email tied to the account

organizationId
required
string

The id for the organization

Responses

201

Reset Password Requested

500

Server error

post /api/v2/auth/forgotpassword

North America Server

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

Asia Pacific Server

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

Request samples

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

Response samples

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

CORS support

Enable CORS preflight requests

Responses

200

Default response for CORS method

options /api/v2/auth/registration

North America Server

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

Asia Pacific Server

https://apac1.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.

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.

Responses

201

Account Created

400

Bad request due to missing or invalid parameters

500

Server error

post /api/v2/auth/registration

North America Server

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

Asia Pacific Server

https://apac1.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",
  • "registrationSource": "string",
  • "registeredAt": "2019-08-14T19:30:49Z",
  • "termsAccepted": true,
  • "isSubscribed": true
}

Response samples

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

CORS support

Enable CORS preflight requests

path Parameters
resendEmailToken
required
string

Encoded object containing resend email token

Responses

200

Default response for CORS method

options /api/v2/auth/resendconfirmemail/{resendEmailToken}

North America Server

https://na1.api.paihealth.com/api/v2/auth/resendconfirmemail/{resendEmailToken}

Asia Pacific Server

https://apac1.api.paihealth.com/api/v2/auth/resendconfirmemail/{resendEmailToken}

Resend confirmation Email

Resend confirmation email

path Parameters
resendEmailToken
required
string

Encoded object containing resend email token

Responses

204

Email sent

400

Bad request due to missing or invalid parameters

403

Invalid confirm email Token

500

Server error

post /api/v2/auth/resendconfirmemail/{resendEmailToken}

North America Server

https://na1.api.paihealth.com/api/v2/auth/resendconfirmemail/{resendEmailToken}

Asia Pacific Server

https://apac1.api.paihealth.com/api/v2/auth/resendconfirmemail/{resendEmailToken}

Response samples

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

CORS support

Enable CORS preflight requests

path Parameters
confirmEmailToken
required
string

Encoded object containing email confirmation token

Responses

200

Default response for CORS method

options /api/v2/auth/confirmemail/{confirmEmailToken}

North America Server

https://na1.api.paihealth.com/api/v2/auth/confirmemail/{confirmEmailToken}

Asia Pacific Server

https://apac1.api.paihealth.com/api/v2/auth/confirmemail/{confirmEmailToken}

Confirm email for an account

Confirms an email address for a given account.

path Parameters
confirmEmailToken
required
string

Encoded object containing email confirmation token

Responses

200

Email confirmed

400

Bad request due to missing or invalid parameters

403

Invalid Email Confirmation Token

500

Server error

post /api/v2/auth/confirmemail/{confirmEmailToken}

North America Server

https://na1.api.paihealth.com/api/v2/auth/confirmemail/{confirmEmailToken}

Asia Pacific Server

https://apac1.api.paihealth.com/api/v2/auth/confirmemail/{confirmEmailToken}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "accountStatus": "Pending",
  • "emailConfirmed": true,
  • "createdAt": "2019-08-14T19:30:49Z",
  • "createdBy": "string",
  • "modifiedAt": "2019-08-14T19:30:49Z",
  • "modifiedBy": "string",
  • "href": "string",
  • "username": "string",
  • "email": "user@example.com",
  • "phoneNumber": "string",
  • "registrationSource": "string",
  • "registeredAt": "2019-08-14T19:30:49Z",
  • "termsAccepted": true,
  • "isSubscribed": true,
  • "role": "Member",
  • "accountType": "Service",
  • "userId": "string"
}

OAuth2

CORS support

Enable CORS preflight requests

path Parameters
organizationId
required
string <uuid>

Organization Id this resource belongs to.

clientId
required
string <uuid>

OAuth2 Client Id as provided to you by PAI Health.

Responses

200

Default response for CORS method

options /api/v2/organizations/{organizationId}/clients/{clientId}/oauth2/tokens

North America Server

https://na1.api.paihealth.com/api/v2/organizations/{organizationId}/clients/{clientId}/oauth2/tokens

Asia Pacific Server

https://apac1.api.paihealth.com/api/v2/organizations/{organizationId}/clients/{clientId}/oauth2/tokens

OAuth2 Token endpoint

OAuth2-compliant endpoint for retrieving API Access Tokens

path Parameters
organizationId
required
string <uuid>

Organization Id this resource belongs to.

clientId
required
string <uuid>

OAuth2 Client Id as provided to you by PAI Health.

header Parameters
X-No-Return-Resource
string

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

User-Agent
string

If provided, this value will be used to differentiate Grant requests.

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

The access token request body as defined by the OAuth2 specification.

grant_type
required
string

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

username
string

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

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

Access Token successfully created

400

Access Token request insuccessful

500

An unexpected error occurred

post /api/v2/organizations/{organizationId}/clients/{clientId}/oauth2/tokens

North America Server

https://na1.api.paihealth.com/api/v2/organizations/{organizationId}/clients/{clientId}/oauth2/tokens

Asia Pacific Server

https://apac1.api.paihealth.com/api/v2/organizations/{organizationId}/clients/{clientId}/oauth2/tokens