PAI Health logo

Developers

PAI Health API - Auth (2.4.3)

Download OpenAPI specification:Download

PAI Health services for authentication

Auth

CORS support

Enable CORS preflight requests

Responses

200

Default response for CORS method

options /api/v2/auth
https://na1.api-dev.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
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
https://na1.api-dev.paihealth.com/api/v2/auth

Request samples

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}
https://na1.api-dev.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
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}
https://na1.api-dev.paihealth.com/api/v2/auth/resetpassword/{resetPasswordToken}

Request samples

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

Response samples

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
https://na1.api-dev.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
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
https://na1.api-dev.paihealth.com/api/v2/auth/forgotpassword

Request samples

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

Response samples

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
https://na1.api-dev.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
firstName
required
string [ 1 .. 255 ] characters

First name of user.

lastName
required
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
https://na1.api-dev.paihealth.com/api/v2/auth/registration

Request samples

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-04-16T19:00:19Z",
  • "termsAccepted": true,
  • "isSubscribed": true
}

Response samples

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

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}
https://na1.api-dev.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}
https://na1.api-dev.paihealth.com/api/v2/auth/resendconfirmemail/{resendEmailToken}

Response samples

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}
https://na1.api-dev.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}
https://na1.api-dev.paihealth.com/api/v2/auth/confirmemail/{confirmEmailToken}

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",
  • "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
https://na1.api-dev.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
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
https://na1.api-dev.paihealth.com/api/v2/organizations/{organizationId}/clients/{clientId}/oauth2/tokens