API reference

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

Path and query parameters
FieldTypeWhat it is
id (path)requiredintegerThe organization id.

Request body

application/json, required

Request body fields
FieldTypeWhat it is
userIdrequiredinteger
roleOrgRoleowner 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".
budgetMicrosinteger or nullMicro USD per UTC month. Null clears it.

Example

{
  "userId": 0,
  "role": "owner",
  "budgetMicros": 0
}

Answer 200

Changed.

Fields of the 200 answer
FieldTypeWhat it is
okboolean
budgetobject

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.

Antimatter