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.source

List project users

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

Returns a list of users in the project.source

Path parameters

The ID of the project.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 ProjectUser objects.source

Example request
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"
Response

Create project user

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

Adds a user to the project. Users must already be members of the organization to be added to a project.source

Path parameters

The ID of the project.source

Request body

The ID of the user.source

owner or membersource

Returns

The created ProjectUser object.source

Example request
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"
  }'
Response

Retrieve project user

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

Retrieves a user in the project.source

Path parameters

The ID of the project.source

The ID of the user.source

Returns

The ProjectUser object matching the specified ID.source

Example request
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"
Response

Modify project user

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

Modifies a user's role in the project.source

Path parameters

The ID of the project.source

The ID of the user.source

Request body

owner or membersource

Returns

The updated ProjectUser object.source

Example request
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"
  }'
Response

Delete project user

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

Deletes a user from the project.source

Path parameters

The ID of the project.source

The ID of the user.source

Returns

Confirmation that project has been deleted or an error in case of an archived project, which has no userssource

Example request
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"
Response

The project user object

Represents an individual user in a project.source

The object type, which is always organization.project.usersource

The identifier, which can be referenced in API endpointssource

The name of the usersource

The email address of the usersource

owner or membersource

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

OBJECT The project user object
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
}