users
Creates, updates, deletes, gets or lists a users resource.
Overview
| Name | users |
| Type | Resource |
| Id | openai_admin.projects.users |
Fields
The following fields are returned by SELECT queries:
- get
- list
Project user retrieved successfully.
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier, which can be referenced in API endpoints |
name | string | The name of the user |
added_at | integer (unixtime) | The Unix timestamp (in seconds) of when the project was added. |
email | string | The email address of the user |
object | string | The object type, which is always organization.project.user (organization.project.user) |
role | string | owner or member |
Project users listed successfully.
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier, which can be referenced in API endpoints |
name | string | The name of the user |
added_at | integer (unixtime) | The Unix timestamp (in seconds) of when the project was added. |
email | string | The email address of the user |
object | string | The object type, which is always organization.project.user (organization.project.user) |
role | string | owner or member |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | project_id, user_id | ||
list | select | project_id | limit, after | |
create | insert | project_id, role | ||
update | update | project_id, user_id | ||
delete | delete | project_id, user_id |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
project_id | string | The ID of the project. |
user_id | string | The ID of the user. |
after | string | 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. |
limit | integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. |
SELECT examples
- get
- list
Project user retrieved successfully.
SELECT
id,
name,
added_at,
email,
object,
role
FROM openai_admin.projects.users
WHERE project_id = '{{ project_id }}' -- required
AND user_id = '{{ user_id }}' -- required
;
Project users listed successfully.
SELECT
id,
name,
added_at,
email,
object,
role
FROM openai_admin.projects.users
WHERE project_id = '{{ project_id }}' -- required
AND limit = '{{ limit }}'
AND after = '{{ after }}'
;
INSERT examples
- create
- Manifest
No description available.
INSERT INTO openai_admin.projects.users (
user_id,
email,
role,
project_id
)
SELECT
'{{ user_id }}',
'{{ email }}',
'{{ role }}' /* required */,
'{{ project_id }}'
RETURNING
id,
name,
added_at,
email,
object,
role
;
# Description fields are for documentation purposes
- name: users
props:
- name: project_id
value: "{{ project_id }}"
description: Required parameter for the users resource.
- name: user_id
value: "{{ user_id }}"
description: |
The ID of the user.
- name: email
value: "{{ email }}"
description: |
Email of the user to add.
- name: role
value: "{{ role }}"
description: |
`owner` or `member`
UPDATE examples
- update
No description available.
UPDATE openai_admin.projects.users
SET
role = '{{ role }}'
WHERE
project_id = '{{ project_id }}' --required
AND user_id = '{{ user_id }}' --required
RETURNING
id,
name,
added_at,
email,
object,
role;
DELETE examples
- delete
No description available.
DELETE FROM openai_admin.projects.users
WHERE project_id = '{{ project_id }}' --required
AND user_id = '{{ user_id }}' --required
;