Skip to main content
PATCH
/
v1
/
organization
/
members
Modify organization membership
curl --request PATCH \
  --url https://api.braintrust.dev/v1/organization/members \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "invite_users": {
    "ids": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ],
    "emails": [
      "<string>"
    ],
    "service_accounts": [
      {
        "name": "<string>",
        "token_name": "<string>"
      }
    ],
    "send_invite_emails": true,
    "group_ids": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ],
    "group_names": [
      "<string>"
    ],
    "group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "group_name": "<string>"
  },
  "remove_users": {
    "ids": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ],
    "emails": [
      "<string>"
    ]
  },
  "org_name": "<string>",
  "org_id": "<string>"
}'
{
  "status": "success",
  "org_id": "<string>",
  "send_email_error": "<string>"
}

Authorizations

Authorization
string
header
required

Most Braintrust endpoints are authenticated by providing your API key as a header Authorization: Bearer [api_key] to your HTTP request. You can create an API key in the Braintrust organization settings page.

Body

application/json

Members to add/remove

invite_users
object | null

Users to invite to the organization

remove_users
object | null

Users to remove from the organization

org_name
string | null

For nearly all users, this parameter should be unnecessary. But in the rare case that your API key belongs to multiple organizations, or in case you want to explicitly assert the organization you are modifying, you may specify the name of the organization.

org_id
string | null

For nearly all users, this parameter should be unnecessary. But in the rare case that your API key belongs to multiple organizations, or in case you want to explicitly assert the organization you are modifying, you may specify the id of the organization.

Response

A success status

status
enum<string>
required
Available options:
success
org_id
string
required

The id of the org that was modified.

send_email_error
string | null

If invite emails failed to send for some reason, the patch operation will still complete, but we will return an error message here