Skip to main content
POST
/
api
/
admin
/
userInstitutions
/
enroll
Enroll users into an institution
curl --request POST \
  --url https://pria.praxislxp.com/api/admin/userInstitutions/enroll \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "institution": "67826dfe5d387207aabd6fc1",
  "users": [
    "67826dfe5d387207aabd6fc1",
    "67826dfe5d387207aabd6fc2"
  ],
  "accountType": "user",
  "entitlements": [
    "institutions.list",
    "users.list",
    "users.edit"
  ]
}
'
{
  "success": true,
  "created": 3,
  "skipped": 1,
  "message": "Enrolled 3 user(s). Skipped 1 (already enrolled or invalid)."
}

Authorizations

x-access-token
string
header
required

JWT token passed in x-access-token header

Body

application/json
institution
string
required

Institution ID to enroll users into

Example:

"67826dfe5d387207aabd6fc1"

users
string[]
required

Array of user IDs to enroll

Example:
[
"67826dfe5d387207aabd6fc1",
"67826dfe5d387207aabd6fc2"
]
accountType
enum<string>
required

Role for the new memberships

Available options:
user,
admin
Example:

"user"

entitlements
string[]

Admin entitlements to grant (only relevant when accountType is admin)

Example:
[
"institutions.list",
"users.list",
"users.edit"
]

Response

Users enrolled successfully

success
boolean
Example:

true

created
integer

Number of users successfully enrolled

Example:

3

skipped
integer

Number of users skipped (already enrolled or invalid)

Example:

1

message
string

Human-readable result summary

Example:

"Enrolled 3 user(s). Skipped 1 (already enrolled or invalid)."