Skip to content
Primary navigation

Modify user

POST/organization/users/{user_id}

Modifies a user's role in the organization.

Path ParametersExpand Collapse
user_id: string
Body ParametersJSONExpand Collapse
role: "owner" or "reader"

owner or reader

One of the following:
"owner"
"reader"
ReturnsExpand Collapse
User = object { id, added_at, email, 3 more }

Represents an individual user within an organization.

id: string

The identifier, which can be referenced in API endpoints

added_at: number

The Unix timestamp (in seconds) of when the user was added.

email: string

The email address of the user

name: string

The name of the user

object: "organization.user"

The object type, which is always organization.user

role: "owner" or "reader"

owner or reader

One of the following:
"owner"
"reader"

Modify user

curl -X POST https://api.openai.com/v1/organization/users/user_abc \
  -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "role": "owner"
  }'
{
    "object": "organization.user",
    "id": "user_abc",
    "name": "First Last",
    "email": "user@example.com",
    "role": "owner",
    "added_at": 1711471533
}
Returns Examples
{
    "object": "organization.user",
    "id": "user_abc",
    "name": "First Last",
    "email": "user@example.com",
    "role": "owner",
    "added_at": 1711471533
}