API reference · Organizations
Change a member's role or budget
PATCH/api/orgs/{id}/membersSigned in session
Only an owner makes or unmakes an owner, and the last owner cannot be demoted. A budget is a monthly ceiling on the shared balance, so a lead can cap a member without giving them a wallet of their own.
Parameters
| Field | Type | What it is |
|---|---|---|
| id (path)required | integer | The organization id. |
Request body
application/json, required
| Field | Type | What it is |
|---|---|---|
| userIdrequired | integer | |
| role | OrgRole | owner does everything. admin does everything but delete the organization, and never acts on an owner. member uses the keys. billing reads the money and the trail and changes nothing. One of "owner", "admin", "member", "billing". |
| budgetMicros | integer or null | Micro USD per UTC month. Null clears it. |
Example
{
"userId": 0,
"role": "owner",
"budgetMicros": 0
}Answer 200
Changed.
| Field | Type | What it is |
|---|---|---|
| ok | boolean | |
| budget | object |
Errors
- 400OpenAI shaped error.
- 403OpenAI shaped error.
- 404OpenAI shaped error.
- 409OpenAI shaped error.
Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.