curl --request POST \
--url https://api.primeintellect.ai/api/admin/users/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"identifiers": [
"<string>"
],
"updates": {
"isBanned": true,
"hasBetaAccess": true,
"blacklistAdd": [],
"blacklistRemove": []
}
}
'import requests
url = "https://api.primeintellect.ai/api/admin/users/batch"
payload = {
"identifiers": ["<string>"],
"updates": {
"isBanned": True,
"hasBetaAccess": True,
"blacklistAdd": [],
"blacklistRemove": []
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
identifiers: ['<string>'],
updates: {isBanned: true, hasBetaAccess: true, blacklistAdd: [], blacklistRemove: []}
})
};
fetch('https://api.primeintellect.ai/api/admin/users/batch', 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://api.primeintellect.ai/api/admin/users/batch",
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([
'identifiers' => [
'<string>'
],
'updates' => [
'isBanned' => true,
'hasBetaAccess' => true,
'blacklistAdd' => [
],
'blacklistRemove' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.primeintellect.ai/api/admin/users/batch"
payload := strings.NewReader("{\n \"identifiers\": [\n \"<string>\"\n ],\n \"updates\": {\n \"isBanned\": true,\n \"hasBetaAccess\": true,\n \"blacklistAdd\": [],\n \"blacklistRemove\": []\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.primeintellect.ai/api/admin/users/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"identifiers\": [\n \"<string>\"\n ],\n \"updates\": {\n \"isBanned\": true,\n \"hasBetaAccess\": true,\n \"blacklistAdd\": [],\n \"blacklistRemove\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.primeintellect.ai/api/admin/users/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"identifiers\": [\n \"<string>\"\n ],\n \"updates\": {\n \"isBanned\": true,\n \"hasBetaAccess\": true,\n \"blacklistAdd\": [],\n \"blacklistRemove\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"matched": 123,
"updated": 123,
"notFound": [
"<string>"
],
"dryRun": false,
"cacheFailures": 0
},
"status": "<string>"
}{
"errors": [
{
"param": "<string>",
"details": "<string>"
}
]
}Batch Update Users
Apply one set of changes to up to 1000 users, resolved by id/email/slug.
Identifiers that match no user are reported in notFound rather than
failing the batch.
curl --request POST \
--url https://api.primeintellect.ai/api/admin/users/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"identifiers": [
"<string>"
],
"updates": {
"isBanned": true,
"hasBetaAccess": true,
"blacklistAdd": [],
"blacklistRemove": []
}
}
'import requests
url = "https://api.primeintellect.ai/api/admin/users/batch"
payload = {
"identifiers": ["<string>"],
"updates": {
"isBanned": True,
"hasBetaAccess": True,
"blacklistAdd": [],
"blacklistRemove": []
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
identifiers: ['<string>'],
updates: {isBanned: true, hasBetaAccess: true, blacklistAdd: [], blacklistRemove: []}
})
};
fetch('https://api.primeintellect.ai/api/admin/users/batch', 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://api.primeintellect.ai/api/admin/users/batch",
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([
'identifiers' => [
'<string>'
],
'updates' => [
'isBanned' => true,
'hasBetaAccess' => true,
'blacklistAdd' => [
],
'blacklistRemove' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.primeintellect.ai/api/admin/users/batch"
payload := strings.NewReader("{\n \"identifiers\": [\n \"<string>\"\n ],\n \"updates\": {\n \"isBanned\": true,\n \"hasBetaAccess\": true,\n \"blacklistAdd\": [],\n \"blacklistRemove\": []\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.primeintellect.ai/api/admin/users/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"identifiers\": [\n \"<string>\"\n ],\n \"updates\": {\n \"isBanned\": true,\n \"hasBetaAccess\": true,\n \"blacklistAdd\": [],\n \"blacklistRemove\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.primeintellect.ai/api/admin/users/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"identifiers\": [\n \"<string>\"\n ],\n \"updates\": {\n \"isBanned\": true,\n \"hasBetaAccess\": true,\n \"blacklistAdd\": [],\n \"blacklistRemove\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"matched": 123,
"updated": 123,
"notFound": [
"<string>"
],
"dryRun": false,
"cacheFailures": 0
},
"status": "<string>"
}{
"errors": [
{
"param": "<string>",
"details": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Resolve the identifiers and report what would change, without writing.
Body
Apply one set of changes to many users.
identifiers accepts a user id, email or slug for each user, so the
caller does not have to resolve them first; anything that matches nothing is
reported back rather than failing the batch.
1 - 1000 elementsThe fields a batch edit may change. At least one must be given.
Mirrors the admin UI's batch panel: ban/unban, grant/revoke beta, and add/remove blacklist modules. Blacklist changes are add/remove rather than a replacement list, because a batch spans users with different blacklists and a replacement would flatten them all to the same value.
Show child attributes
Show child attributes
Was this page helpful?