curl --request PATCH \
--url https://scribe.skeptrune.com/api/org/members/{userId} \
--header 'Content-Type: application/json' \
--cookie scribe_session= \
--data '
{
"role": "admin"
}
'import requests
url = "https://scribe.skeptrune.com/api/org/members/{userId}"
payload = { "role": "admin" }
headers = {
"cookie": "scribe_session=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {cookie: 'scribe_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({role: 'admin'})
};
fetch('https://scribe.skeptrune.com/api/org/members/{userId}', 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://scribe.skeptrune.com/api/org/members/{userId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'role' => 'admin'
]),
CURLOPT_COOKIE => "scribe_session=",
CURLOPT_HTTPHEADER => [
"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://scribe.skeptrune.com/api/org/members/{userId}"
payload := strings.NewReader("{\n \"role\": \"admin\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("cookie", "scribe_session=")
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.patch("https://scribe.skeptrune.com/api/org/members/{userId}")
.header("cookie", "scribe_session=")
.header("Content-Type", "application/json")
.body("{\n \"role\": \"admin\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://scribe.skeptrune.com/api/org/members/{userId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["cookie"] = 'scribe_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"role\": \"admin\"\n}"
response = http.request(request)
puts response.read_body{
"userId": "usr_V1StGXR8_Z5jdHi6BmyT",
"email": "[email protected]",
"name": "Ada Lovelace",
"handle": "ada",
"avatarUrl": "/api/uploads/users/usr_V1StGXR8_Z5jdHi6BmyT/avatar",
"role": "member",
"joinedAt": 1752624000000
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}Change a member role
Changes the role of a member. Requires a user session with the admin role or higher — membership cannot be managed with an API key. The last owner of an organization cannot be demoted.
curl --request PATCH \
--url https://scribe.skeptrune.com/api/org/members/{userId} \
--header 'Content-Type: application/json' \
--cookie scribe_session= \
--data '
{
"role": "admin"
}
'import requests
url = "https://scribe.skeptrune.com/api/org/members/{userId}"
payload = { "role": "admin" }
headers = {
"cookie": "scribe_session=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {cookie: 'scribe_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({role: 'admin'})
};
fetch('https://scribe.skeptrune.com/api/org/members/{userId}', 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://scribe.skeptrune.com/api/org/members/{userId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'role' => 'admin'
]),
CURLOPT_COOKIE => "scribe_session=",
CURLOPT_HTTPHEADER => [
"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://scribe.skeptrune.com/api/org/members/{userId}"
payload := strings.NewReader("{\n \"role\": \"admin\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("cookie", "scribe_session=")
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.patch("https://scribe.skeptrune.com/api/org/members/{userId}")
.header("cookie", "scribe_session=")
.header("Content-Type", "application/json")
.body("{\n \"role\": \"admin\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://scribe.skeptrune.com/api/org/members/{userId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["cookie"] = 'scribe_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"role\": \"admin\"\n}"
response = http.request(request)
puts response.read_body{
"userId": "usr_V1StGXR8_Z5jdHi6BmyT",
"email": "[email protected]",
"name": "Ada Lovelace",
"handle": "ada",
"avatarUrl": "/api/uploads/users/usr_V1StGXR8_Z5jdHi6BmyT/avatar",
"role": "member",
"joinedAt": 1752624000000
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}Authorizations
Browser session cookie set by the WorkOS sign-in flow.
Path Parameters
User id of the member whose role to change.
Body
The new role.
New role for the member.
New role to assign to the member.
owner, admin, member "member"
Response
The updated member.
A user who belongs to the organization, with their role.
User id of the member.
"usr_V1StGXR8_Z5jdHi6BmyT"
Email address of the member.
Display name of the member.
"Ada Lovelace"
Unique handle of the member.
"ada"
Avatar URL of the member, or null.
"/api/uploads/users/usr_V1StGXR8_Z5jdHi6BmyT/avatar"
Role of a user inside an organization.
owner, admin, member "member"
When the member joined the organization (epoch milliseconds).
1752624000000