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"
]
}
'import requests
url = "https://pria.praxislxp.com/api/admin/userInstitutions/enroll"
payload = {
"institution": "67826dfe5d387207aabd6fc1",
"users": ["67826dfe5d387207aabd6fc1", "67826dfe5d387207aabd6fc2"],
"accountType": "user",
"entitlements": ["institutions.list", "users.list", "users.edit"]
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
institution: '67826dfe5d387207aabd6fc1',
users: ['67826dfe5d387207aabd6fc1', '67826dfe5d387207aabd6fc2'],
accountType: 'user',
entitlements: ['institutions.list', 'users.list', 'users.edit']
})
};
fetch('https://pria.praxislxp.com/api/admin/userInstitutions/enroll', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pria.praxislxp.com/api/admin/userInstitutions/enroll",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'institution' => '67826dfe5d387207aabd6fc1',
'users' => [
'67826dfe5d387207aabd6fc1',
'67826dfe5d387207aabd6fc2'
],
'accountType' => 'user',
'entitlements' => [
'institutions.list',
'users.list',
'users.edit'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pria.praxislxp.com/api/admin/userInstitutions/enroll"
payload := strings.NewReader("{\n \"institution\": \"67826dfe5d387207aabd6fc1\",\n \"users\": [\n \"67826dfe5d387207aabd6fc1\",\n \"67826dfe5d387207aabd6fc2\"\n ],\n \"accountType\": \"user\",\n \"entitlements\": [\n \"institutions.list\",\n \"users.list\",\n \"users.edit\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pria.praxislxp.com/api/admin/userInstitutions/enroll")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"institution\": \"67826dfe5d387207aabd6fc1\",\n \"users\": [\n \"67826dfe5d387207aabd6fc1\",\n \"67826dfe5d387207aabd6fc2\"\n ],\n \"accountType\": \"user\",\n \"entitlements\": [\n \"institutions.list\",\n \"users.list\",\n \"users.edit\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pria.praxislxp.com/api/admin/userInstitutions/enroll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"institution\": \"67826dfe5d387207aabd6fc1\",\n \"users\": [\n \"67826dfe5d387207aabd6fc1\",\n \"67826dfe5d387207aabd6fc2\"\n ],\n \"accountType\": \"user\",\n \"entitlements\": [\n \"institutions.list\",\n \"users.list\",\n \"users.edit\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"created": 3,
"skipped": 1,
"message": "Enrolled 3 user(s). Skipped 1 (already enrolled or invalid)."
}{
"success": false,
"message": "Invalid User Institution",
"error": "<string>"
}{
"success": false,
"message": "Invalid User Institution",
"error": "<string>"
}{
"success": false,
"message": "Invalid User Institution",
"error": "<string>"
}Admin Entitlements
Enroll users into an institution
Creates user-institution memberships for the specified users. Skips users who are already enrolled or invalid. Requires users.add entitlement for the target institution.
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"
]
}
'import requests
url = "https://pria.praxislxp.com/api/admin/userInstitutions/enroll"
payload = {
"institution": "67826dfe5d387207aabd6fc1",
"users": ["67826dfe5d387207aabd6fc1", "67826dfe5d387207aabd6fc2"],
"accountType": "user",
"entitlements": ["institutions.list", "users.list", "users.edit"]
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
institution: '67826dfe5d387207aabd6fc1',
users: ['67826dfe5d387207aabd6fc1', '67826dfe5d387207aabd6fc2'],
accountType: 'user',
entitlements: ['institutions.list', 'users.list', 'users.edit']
})
};
fetch('https://pria.praxislxp.com/api/admin/userInstitutions/enroll', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pria.praxislxp.com/api/admin/userInstitutions/enroll",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'institution' => '67826dfe5d387207aabd6fc1',
'users' => [
'67826dfe5d387207aabd6fc1',
'67826dfe5d387207aabd6fc2'
],
'accountType' => 'user',
'entitlements' => [
'institutions.list',
'users.list',
'users.edit'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pria.praxislxp.com/api/admin/userInstitutions/enroll"
payload := strings.NewReader("{\n \"institution\": \"67826dfe5d387207aabd6fc1\",\n \"users\": [\n \"67826dfe5d387207aabd6fc1\",\n \"67826dfe5d387207aabd6fc2\"\n ],\n \"accountType\": \"user\",\n \"entitlements\": [\n \"institutions.list\",\n \"users.list\",\n \"users.edit\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pria.praxislxp.com/api/admin/userInstitutions/enroll")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"institution\": \"67826dfe5d387207aabd6fc1\",\n \"users\": [\n \"67826dfe5d387207aabd6fc1\",\n \"67826dfe5d387207aabd6fc2\"\n ],\n \"accountType\": \"user\",\n \"entitlements\": [\n \"institutions.list\",\n \"users.list\",\n \"users.edit\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pria.praxislxp.com/api/admin/userInstitutions/enroll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"institution\": \"67826dfe5d387207aabd6fc1\",\n \"users\": [\n \"67826dfe5d387207aabd6fc1\",\n \"67826dfe5d387207aabd6fc2\"\n ],\n \"accountType\": \"user\",\n \"entitlements\": [\n \"institutions.list\",\n \"users.list\",\n \"users.edit\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"created": 3,
"skipped": 1,
"message": "Enrolled 3 user(s). Skipped 1 (already enrolled or invalid)."
}{
"success": false,
"message": "Invalid User Institution",
"error": "<string>"
}{
"success": false,
"message": "Invalid User Institution",
"error": "<string>"
}{
"success": false,
"message": "Invalid User Institution",
"error": "<string>"
}Authorizations
JWT token passed in x-access-token header
Body
application/json
Institution ID to enroll users into
Pattern:
^[0-9a-fA-F]{24}$Example:
"67826dfe5d387207aabd6fc1"
Array of user IDs to enroll
Pattern:
^[0-9a-fA-F]{24}$Example:
[
"67826dfe5d387207aabd6fc1",
"67826dfe5d387207aabd6fc2"
]Role for the new memberships
Available options:
user, admin Example:
"user"
Admin entitlements to grant (only relevant when accountType is admin)
Example:
[
"institutions.list",
"users.list",
"users.edit"
]Response
Users enrolled successfully
Was this page helpful?
⌘I