Users
Manage users and their role in an organization. Users will be automatically added to the Default project.
List users
get https://api.openai.com/v1/organization/users
Lists all of the users in the organization.
Query parameters
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
Returns
A list of User objects.
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.
Returns
The updated User object.
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.
Returns
The User object matching the specified ID.
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.
Returns
Confirmation of the deleted user
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.
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
}