curl --request PUT \
--url https://app.base44.com/api/workspace/members/bulk/role \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"email": "dana@acme.com",
"role": "editor"
},
{
"email": "sam@acme.com",
"role": "viewer"
}
]
}
'import requests
url = "https://app.base44.com/api/workspace/members/bulk/role"
payload = { "items": [
{
"email": "dana@acme.com",
"role": "editor"
},
{
"email": "sam@acme.com",
"role": "viewer"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{email: 'dana@acme.com', role: 'editor'},
{email: 'sam@acme.com', role: 'viewer'}
]
})
};
fetch('https://app.base44.com/api/workspace/members/bulk/role', 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://app.base44.com/api/workspace/members/bulk/role",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'email' => 'dana@acme.com',
'role' => 'editor'
],
[
'email' => 'sam@acme.com',
'role' => 'viewer'
]
]
]),
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://app.base44.com/api/workspace/members/bulk/role"
payload := strings.NewReader("{\n \"items\": [\n {\n \"email\": \"dana@acme.com\",\n \"role\": \"editor\"\n },\n {\n \"email\": \"sam@acme.com\",\n \"role\": \"viewer\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.base44.com/api/workspace/members/bulk/role")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"email\": \"dana@acme.com\",\n \"role\": \"editor\"\n },\n {\n \"email\": \"sam@acme.com\",\n \"role\": \"viewer\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/workspace/members/bulk/role")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"email\": \"dana@acme.com\",\n \"role\": \"editor\"\n },\n {\n \"email\": \"sam@acme.com\",\n \"role\": \"viewer\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"email": "dana@acme.com",
"message": "Member role updated to editor.",
"status": "success"
}
]
}{
"detail": {
"message": "Some members could not be updated. No changes were applied.",
"errors": [
{
"email": "sam@acme.com",
"error_code": "MEMBER_NOT_FOUND",
"message": "Member sam@acme.com not found in workspace 67e0b12c4d8a3f005b21c9e4"
}
]
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Update workspace member roles in bulk
Changes the roles of up to 200 members at once, the same way as Update workspace member role.
You can’t change your own role or the owner’s. A role that a group grants can only be changed at the group, with Update workspace group or by changing its members. admin needs the Business plan or higher. Moving someone to viewer removes their own credit limit, and promoting a guest makes them a full member.
Every item is checked before anything changes. If any item can’t be applied, nothing changes and the request returns a 400 whose detail.errors lists each rejected item with its email, a message, and an error_code when there is one. A member who isn’t in the workspace, or a change you couldn’t make on the single-member endpoint, is reported there rather than as a 403 or 404.
A 200 has one entry in results per item, in request order. An item whose member changed while the request ran comes back with status skipped and wasn’t applied. Count only success entries as done. A member whose role a group took over, or whose membership changed, is skipped and keeps their role.
This is limited to 5 requests per minute, shared by Update workspace member roles in bulk, Remove workspace members in bulk, and Set member credit limits in bulk. A signed-in session has its own limit, and every personal access token for the workspace shares one. Some workspaces have a different limit.
curl --request PUT \
--url https://app.base44.com/api/workspace/members/bulk/role \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"email": "dana@acme.com",
"role": "editor"
},
{
"email": "sam@acme.com",
"role": "viewer"
}
]
}
'import requests
url = "https://app.base44.com/api/workspace/members/bulk/role"
payload = { "items": [
{
"email": "dana@acme.com",
"role": "editor"
},
{
"email": "sam@acme.com",
"role": "viewer"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{email: 'dana@acme.com', role: 'editor'},
{email: 'sam@acme.com', role: 'viewer'}
]
})
};
fetch('https://app.base44.com/api/workspace/members/bulk/role', 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://app.base44.com/api/workspace/members/bulk/role",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'email' => 'dana@acme.com',
'role' => 'editor'
],
[
'email' => 'sam@acme.com',
'role' => 'viewer'
]
]
]),
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://app.base44.com/api/workspace/members/bulk/role"
payload := strings.NewReader("{\n \"items\": [\n {\n \"email\": \"dana@acme.com\",\n \"role\": \"editor\"\n },\n {\n \"email\": \"sam@acme.com\",\n \"role\": \"viewer\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.base44.com/api/workspace/members/bulk/role")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"email\": \"dana@acme.com\",\n \"role\": \"editor\"\n },\n {\n \"email\": \"sam@acme.com\",\n \"role\": \"viewer\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/workspace/members/bulk/role")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"email\": \"dana@acme.com\",\n \"role\": \"editor\"\n },\n {\n \"email\": \"sam@acme.com\",\n \"role\": \"viewer\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"email": "dana@acme.com",
"message": "Member role updated to editor.",
"status": "success"
}
]
}{
"detail": {
"message": "Some members could not be updated. No changes were applied.",
"errors": [
{
"email": "sam@acme.com",
"error_code": "MEMBER_NOT_FOUND",
"message": "Member sam@acme.com not found in workspace 67e0b12c4d8a3f005b21c9e4"
}
]
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Personal access token, sent as Authorization: Bearer <token>.
Query Parameters
Body
Role changes to apply in one request.
The role changes, 1 to 200. Each email can appear once.
1 - 200 elementsShow child attributes
Show child attributes
[ { "email": "dana@acme.com", "role": "editor" }, { "email": "sam@acme.com", "role": "viewer" } ]
Response
The outcome for each member.
The outcome of each item.
One entry per item, in request order.
Show child attributes
Show child attributes
[ { "email": "dana@acme.com", "message": "Member role updated to editor.", "status": "success" } ]
Was this page helpful?