Endpoint
Change a member's role
/v1/team/members/{id}No API key changes the team: this call answers passkey_approval_required for every member and role. Roles are changed in the dashboard by a signed-in member, with a passkey.
- Scope a restricted key needs
team:write- Publishable key
- Not allowed: secret or restricted key only
- Idempotency-Key
- Not used. A PATCH is already safe to repeat.
Parameters
| Parameter | Type and place | Meaning |
|---|---|---|
idrequired | stringpath | The id of the member. |
Orrerie-Version | stringheader | API version date. Default: the version the key was created with. Example 2026-10-11. |
Request body
A JSON object. The body is required. A field the call does not list is refused with parameter_unknown.
| Field | Type | Meaning |
|---|---|---|
rolerequired | string | One of admin, developer, support, cashier, viewer. |
Example request
Refused in this release
Every request to this call is answered 403 with passkey_approval_required and reason members_dashboard_only. Roles are changed in the dashboard by a signed-in member, with a passkey.
curl
curl -X PATCH https://api.orrerie.com/v1/team/members/mem_ceh1wpzdrpk13cnpcjy9w0fa \
-H "Authorization: Bearer $ORRERIE_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"role": "support"
}'JavaScript
const response = await fetch("https://api.orrerie.com/v1/team/members/mem_ceh1wpzdrpk13cnpcjy9w0fa", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.ORRERIE_SECRET_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"role": "support"
}),
});
const result = await response.json();
if (!response.ok) throw new Error(`${result.error.code}: ${result.error.message}`);
console.log(result);Python
import os
import requests
response = requests.patch(
"https://api.orrerie.com/v1/team/members/mem_ceh1wpzdrpk13cnpcjy9w0fa",
headers={"Authorization": f"Bearer {os.environ['ORRERIE_SECRET_KEY']}"},
json={
"role": "support",
},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(f"{result['error']['code']}: {result['error']['message']}")
print(result)PHP
<?php
$request = curl_init('https://api.orrerie.com/v1/team/members/mem_ceh1wpzdrpk13cnpcjy9w0fa');
curl_setopt_array($request, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ORRERIE_SECRET_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'role' => 'support',
]),
]);
$body = curl_exec($request);
if ($body === false) {
throw new RuntimeException(curl_error($request));
}
$result = json_decode($body, true);
if (curl_getinfo($request, CURLINFO_HTTP_CODE) >= 400) {
throw new RuntimeException($result['error']['code'] . ': ' . $result['error']['message']);
}
print_r($result);Responses
200 OK
The answer is the member object. Headers: Orrerie-Request-Id.
Example response, 200
{
"id": "mem_re2bmvrnbzsbefcwx64ftp5w",
"object": "member",
"livemode": true,
"created": "2026-09-02T09:15:44.020Z",
"user": "usr_vhpdrdebjrkc46bb09vn6nbm",
"email": "till@acme.example",
"name": "Ana Lopez",
"role": "support",
"status": "active",
"holds_wallet_key": false,
"passkey_count": 1,
"invited_by": null,
"invitation_expires_at": null,
"last_active_at": "2026-10-12T09:00:00.000Z"
}Any other status: an error
A status of 400 or above answers with the error object. Branch on its code, never on its message.
Errors
Beside the errors every call can answer with (a bad key, a missing scope, the rate limit), this call answers with:
| Code | HTTP | Meaning |
|---|---|---|
passkey_approval_required | 403 | The action can only be done by a signed-in member in the dashboard (settlement asset, key-holding roles, approvals). No API key can do it. |