PAI Health logo

Developers

PAI Health API - User

Download OpenAPI specification:Download

PAI Health User services

Authentication

jwtAdminAuthorizer

Security scheme type: API Key
Header parameter name: Authorization

jwtGlobalAuthorizer

Security scheme type: API Key
Header parameter name: Authorization

jwtSystemAdminAuthorizer

Security scheme type: API Key
Header parameter name: Authorization

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

North America Server

https://na1.api.paihealth.com/user/api/v2/myaccount

Asia Pacific Server

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

North America Server

https://na1.api.paihealth.com/user/api/v2/myaccount

Asia Pacific Server

https://apac1.api.paihealth.com/user/api/v2/myaccount

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "accountStatus": "Pending",
  • "emailConfirmed": true,
  • "createdAt": "2019-08-14T19:34:07Z",
  • "createdBy": "string",
  • "modifiedAt": "2019-08-14T19:34:07Z",
  • "modifiedBy": "string",
  • "href": "string",
  • "username": "string",
  • "email": "user@example.com",
  • "phoneNumber": "string",
  • "registrationSource": "string",
  • "registeredAt": "2019-08-14T19:34:07Z",
  • "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

North America Server

https://na1.api.paihealth.com/user/api/v2/myaccount

Asia Pacific Server

https://apac1.api.paihealth.com/user/api/v2/myaccount

Request samples

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

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "accountStatus": "Pending",
  • "emailConfirmed": true,
  • "createdAt": "2019-08-14T19:34:07Z",
  • "createdBy": "string",
  • "modifiedAt": "2019-08-14T19:34:07Z",
  • "modifiedBy": "string",
  • "href": "string",
  • "username": "string",
  • "email": "user@example.com",
  • "phoneNumber": "string",
  • "registrationSource": "string",
  • "registeredAt": "2019-08-14T19:34:07Z",
  • "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

North America Server

https://na1.api.paihealth.com/user/api/v2/myaccount

Asia Pacific Server

https://apac1.api.paihealth.com/user/api/v2/myaccount

Request samples

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

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "accountStatus": "Pending",
  • "emailConfirmed": true,
  • "createdAt": "2019-08-14T19:34:07Z",
  • "createdBy": "string",
  • "modifiedAt": "2019-08-14T19:34:07Z",
  • "modifiedBy": "string",
  • "href": "string",
  • "username": "string",
  • "email": "user@example.com",
  • "phoneNumber": "string",
  • "registrationSource": "string",
  • "registeredAt": "2019-08-14T19:34:07Z",
  • "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

North America Server

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

Asia Pacific Server

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

North America Server

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

Asia Pacific Server

https://apac1.api.paihealth.com/user/api/v2/myaccount/email

Request samples

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

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 /user/api/v2/myaccount/oauth2/providers/grants

North America Server

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

Asia Pacific Server

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

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

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

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

North America Server

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

Asia Pacific Server

https://apac1.api.paihealth.com/user/api/v2/myaccount/oauth2/providers/grants

Response samples

Content type
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

The OAuth2 Grant model

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 objects (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

North America Server

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

Asia Pacific Server

https://apac1.api.paihealth.com/user/api/v2/myaccount/oauth2/providers/grants

Request samples

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

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {