Update user role in workspace
curl --request PUT \
--url https://api.blaxel.ai/v0/users/{subOrEmail} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"role": "<string>"
}
'import requests
url = "https://api.blaxel.ai/v0/users/{subOrEmail}"
payload = { "role": "<string>" }
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({role: '<string>'})
};
fetch('https://api.blaxel.ai/v0/users/{subOrEmail}', 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.blaxel.ai/v0/users/{subOrEmail}",
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([
'role' => '<string>'
]),
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.blaxel.ai/v0/users/{subOrEmail}"
payload := strings.NewReader("{\n \"role\": \"<string>\"\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://api.blaxel.ai/v0/users/{subOrEmail}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"role\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blaxel.ai/v0/users/{subOrEmail}")
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 \"role\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"accepted": true,
"email": "<string>",
"email_verified": true,
"expired": true,
"family_name": "<string>",
"given_name": "<string>",
"role": "<string>",
"source": "directory_sync",
"sub": "<string>"
}workspaces
Update user role in workspace
Updates the role of a user in the workspace.
PUT
/
users
/
{subOrEmail}
Update user role in workspace
curl --request PUT \
--url https://api.blaxel.ai/v0/users/{subOrEmail} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"role": "<string>"
}
'import requests
url = "https://api.blaxel.ai/v0/users/{subOrEmail}"
payload = { "role": "<string>" }
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({role: '<string>'})
};
fetch('https://api.blaxel.ai/v0/users/{subOrEmail}', 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.blaxel.ai/v0/users/{subOrEmail}",
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([
'role' => '<string>'
]),
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.blaxel.ai/v0/users/{subOrEmail}"
payload := strings.NewReader("{\n \"role\": \"<string>\"\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://api.blaxel.ai/v0/users/{subOrEmail}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"role\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blaxel.ai/v0/users/{subOrEmail}")
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 \"role\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"accepted": true,
"email": "<string>",
"email_verified": true,
"expired": true,
"family_name": "<string>",
"given_name": "<string>",
"role": "<string>",
"source": "directory_sync",
"sub": "<string>"
}Authorizations
OAuth2ApiKeyAuth
OAuth2 authentication with JWT tokens
Path Parameters
Sub or email of the user
Body
application/json
The new role to assign to the user
Response
User role updated successfully
Workspace user
Whether the user has accepted the workspace invitation
Workspace user email
Whether the user's email has been verified
Whether the invitation has expired
Workspace user family name
Workspace user given name
Workspace user role
Source of the user provisioning
Available options:
directory_sync, invitation, domain_capture Workspace user identifier
Last modified on August 27, 2026
Was this page helpful?
