PAI Health logo

Developers

PAI Health API - Admin (2.4.3)

Download OpenAPI specification:Download

PAI Health services for Administrators

Authentication

jwtAdminAuthorizer

Security scheme type: API Key
header parameter name: Authorization

Accounts

CORS support

Enable CORS preflight requests

path Parameters
organizationId
required
string <uuid>

Organization Id this resource belongs to.

Responses

200

Default response for CORS method

options /admin/api/v2/organizations/{organizationId}/accounts
https://na1.api.paihealth.com/admin/api/v2/organizations/{organizationId}/accounts

Get list of accounts

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

Authorizations:
path Parameters
organizationId
required
string <uuid>

Organization Id this resource belongs to.

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] 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 ().

id
string <uuid>

Filter by resource id.

username
string

Filter by username.

email
string <email>

Filter by email.

emailConfirmed
boolean

Filter by emailConfirmed.

phoneNumber
string <phone>

Filter by phoneNumber.

registrationSource
string

Filter by registrationSource.

registeredAt
string <date-time>

Filter by registeredAt.

termsAccepted
boolean

Filter by termsAccepted.

isSubscribed
boolean

Filter by isSubscribed.

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

Filter by role.

accountType
string
Enum:"Regular" "Service"

Filter by accountType.

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

Filter by accountStatus.

provisioningStatus
string
Enum:"Started" "Completed"

Filter by provisioningStatus.

userId
string

Filter by userId.

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

200 response

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 /admin/api/v2/organizations/{organizationId}/accounts
https://na1.api.paihealth.com/admin/api/v2/organizations/{organizationId}/accounts

Response samples

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

Create a new account

Creates a new account.

Authorizations:
path Parameters
organizationId
required
string <uuid>

Organization Id this resource belongs to.

Request Body schema: application/json
firstName
string

First name of the account user for 'Regular' account type.

lastName
string

Last name of the account user for 'Regular' account type.

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

201

Resource created

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 /admin/api/v2/organizations/{organizationId}/accounts
https://na1.api.paihealth.com/admin/api/v2/organizations/{organizationId}/accounts

Request samples

application/json
Copy
Expand all Collapse all
{
  • "firstName": "string",
  • "lastName": "string",
  • "username": "string",
  • "email": "user@example.com",
  • "phoneNumber": "string",
  • "registrationSource": "string",
  • "registeredAt": "2019-02-05T19:48:29Z",
  • "termsAccepted": true,
  • "isSubscribed": true,
  • "role": "Member",
  • "accountType": "Service",
  • "provisioningStatus": "Started",
  • "userId": "string"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "firstName": "string",
  • "lastName": "string",
  • "username": "string",
  • "email": "user@example.com",
  • "phoneNumber": "string",
  • "registrationSource": "string",
  • "registeredAt": "2019-02-05T19:48:29Z",
  • "termsAccepted": true,
  • "isSubscribed": true,
  • "role": "Member",
  • "accountType": "Service",
  • "provisioningStatus": "Started",
  • "userId": "string"
}

CORS support

Enable CORS preflight requests

path Parameters
organizationId
required
string <uuid>

Organization Id this resource belongs to.

id
required
string

The account id

Responses

200

Default response for CORS method

options /admin/api/v2/organizations/{organizationId}/accounts/{id}
https://na1.api.paihealth.com/admin/api/v2/organizations/{organizationId}/accounts/{id}

Get an account by id

Returns an account based on id.

Authorizations:
path Parameters
organizationId
required
string <uuid>

Organization Id this resource belongs to.

id
required
string

The account id

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 /admin/api/v2/organizations/{organizationId}/accounts/{id}
https://na1.api.paihealth.com/admin/api/v2/organizations/{organizationId}/accounts/{id}

Response samples

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

Update an account by id

Updates a given account.

Authorizations:
path Parameters
organizationId
required
string <uuid>

Organization Id this resource belongs to.

id
required
string

The account id

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.

password
string [ 8 .. 100 ] characters

Password for the account.

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

500

An unexpected error occurred

put /admin/api/v2/organizations/{organizationId}/accounts/{id}
https://na1.api.paihealth.com/admin/api/v2/organizations/{organizationId}/accounts/{id}

Request samples

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

Response samples

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

Patch account by id

Patch account by id, with RFC 6902 patch syntax. Patchable fields are: phoneNumber, isSubscribed, role.

Authorizations:
path Parameters
organizationId
required
string <uuid>

Organization Id this resource belongs to.

id
required
string

The account id

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 /admin/api/v2/organizations/{organizationId}/accounts/{id}
https://na1.api.paihealth.com/admin/api/v2/organizations/{organizationId}/accounts/{id}

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-02-05T19:48:30Z",
  • "createdBy": "string",
  • "modifiedAt": "2019-02-05T19:48:30Z",
  • "modifiedBy": "string",
  • "href": "string",
  • "username": "string",
  • "email": "user@example.com",
  • "phoneNumber": "string",
  • "registrationSource": "string",
  • "registeredAt": "2019-02-05T19:48:30Z",
  • "termsAccepted": true,
  • "isSubscribed": true,
  • "role": "Member",
  • "accountType": "Service",
  • "provisioningStatus": "Started",
  • "userId": "string"
}

Delete an account

Deletes a given account by id.

Authorizations:
path Parameters
organizationId
required
string <uuid>

Organization Id this resource belongs to.

id
required
string

The account id

Responses

204

Resource 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

Account not found

500

An unexpected error occurred

delete /admin/api/v2/organizations/{organizationId}/accounts/{id}
https://na1.api.paihealth.com/admin/api/v2/organizations/{organizationId}/accounts/{id}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "accountStatus": "Pending",
  • "emailConfirmed": true,
  • "createdAt": "2019-02-05T19:48:30Z",
  • "createdBy": "string",
  • "modifiedAt": "2019-02-05T19:48:30Z",
  • "modifiedBy": "string",
  • "href": "string",
  • "username": "string",
  • "email": "user@example.com",
  • "phoneNumber": "string",
  • "registrationSource": "string",
  • "registeredAt": "2019-02-05T19:48:30Z",
  • "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 /admin/api/v2/organizations/{organizationId}/accounts/{id}/oauth2/grants
https://na1.api.paihealth.com/admin/api/v2/organizations/{organizationId}/accounts/{id}/oauth2/grants

Retrieves OAuth2 Grants for an account

Retrieves all OAuth2 Grants for this account.

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] 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

Account not found

500

An unexpected error occurred

get /admin/api/v2/organizations/{organizationId}/accounts/{id}/oauth2/grants
https://na1.api.paihealth.com/admin/api/v2/organizations/{organizationId}/accounts/{id}/oauth2/grants

Response samples

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

Creates Grant for an account

Creates an OAuth2 Grant linking a provider with an account.

Authorizations:
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 (OAuth2TokenModel)

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

Account not found

500

Server error

post /admin/api/v2/organizations/{organizationId}/accounts/{id}/oauth2/grants
https://na1.api.paihealth.com/admin/api/v2/organizations/{organizationId}/accounts/{id}/oauth2/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 /admin/api/v2/organizations/{organizationId}/accounts/{id}/oauth2/grants/{oAuth2providerId}
https://na1.api.paihealth.com/admin/api/v2/organizations/{organizationId}/accounts/{id}/oauth2/grants/{oAuth2providerId}

Get an OAuth2 Grant by providerId

Returns an OAuth2 Grant by its providerId

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 /admin/api/v2/organizations/{organizationId}/accounts/{id}/oauth2/grants/{oAuth2providerId}
https://na1.api.paihealth.com/admin/api/v2/organizations/{organizationId}/accounts/{id}/oauth2/grants/{oAuth2providerId}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "createdAt": "2019-02-05T19:48:30Z",
  • "createdBy": "string",
  • "modifiedAt": "2019-02-05T19:48:30Z",
  • "modifiedBy": "string",
  • "href": "string",
  • "providerId": "string",
  • "issuedAt": "2019-02-05T19:48:30Z",
  • "authorizationCode": "string",
  • "grantStatus": "Issued",
  • "tokens":
    [
    ]
}