Users

Manage users and their role in an organization. Users will be automatically added to the Default project.source

List users

get https://api.openai.com/v1/organization/users

Lists all of the users in the organization.source

Query parameters

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.source

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.source

Returns

A list of User objects.source

Example request
1
2
3
curl https://api.openai.com/v1/organization/users?after=user_abc&limit=20 \
  -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
  -H "Content-Type: application/json"
Response

Modify user

post https://api.openai.com/v1/organization/users/{user_id}

Modifies a user's role in the organization.source

Path parameters

The ID of the user.source

Request body

owner or readersource

Returns

The updated User object.source

Example request
1
2
3
4
5
6
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"
  }'
Response

Retrieve user

get https://api.openai.com/v1/organization/users/{user_id}

Retrieves a user by their identifier.source

Path parameters

The ID of the user.source

Returns

The User object matching the specified ID.source

Example request
1
2
3
curl https://api.openai.com/v1/organization/users/user_abc \
  -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
  -H "Content-Type: application/json"
Response

Delete user

delete https://api.openai.com/v1/organization/users/{user_id}

Deletes a user from the organization.source

Path parameters

The ID of the user.source

Returns

Confirmation of the deleted usersource

Example request
1
2
3
curl -X DELETE https://api.openai.com/v1/organization/users/user_abc \
  -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
  -H "Content-Type: application/json"
Response

The user object

Represents an individual user within an organization.source

The object type, which is always organization.usersource

The identifier, which can be referenced in API endpointssource

The name of the usersource

The email address of the usersource

owner or readersource

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

OBJECT The user object
1
2
3
4
5
6
7
8
{
    "object": "organization.user",
    "id": "user_abc",
    "name": "First Last",
    "email": "user@example.com",
    "role": "owner",
    "added_at": 1711471533
}