Project users
Manage users within a project, including adding, updating roles, and removing users. Users cannot be removed from the Default project, unless they are being removed from the organization.
List project users
Returns a list of users in the project.
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 ProjectUser objects.
1
2
3
curl https://api.openai.com/v1/organization/projects/proj_abc/users?after=user_abc&limit=20 \
-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
-H "Content-Type: application/json"
Create project user
Adds a user to the project. Users must already be members of the organization to be added to a project.
Returns
The created ProjectUser object.
1
2
3
4
5
6
7
curl -X POST https://api.openai.com/v1/organization/projects/proj_abc/users \
-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{
"user_id": "user_abc",
"role": "member"
}'
Retrieve project user
Retrieves a user in the project.
Path parameters
Returns
The ProjectUser object matching the specified ID.
1
2
3
curl https://api.openai.com/v1/organization/projects/proj_abc/users/user_abc \
-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
-H "Content-Type: application/json"
Modify project user
Modifies a user's role in the project.
Path parameters
Returns
The updated ProjectUser object.
1
2
3
4
5
6
curl -X POST https://api.openai.com/v1/organization/projects/proj_abc/users/user_abc \
-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{
"role": "owner"
}'
Delete project user
Deletes a user from the project.
Path parameters
Returns
Confirmation that project has been deleted or an error in case of an archived project, which has no users
1
2
3
curl -X DELETE https://api.openai.com/v1/organization/projects/proj_abc/users/user_abc \
-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
-H "Content-Type: application/json"
The project user object
Represents an individual user in a project.
1
2
3
4
5
6
7
8
{
"object": "organization.project.user",
"id": "user_abc",
"name": "First Last",
"email": "user@example.com",
"role": "owner",
"added_at": 1711471533
}