service_accounts
Creates, updates, deletes, gets or lists a service_accounts resource.
Overview
| Name | service_accounts |
| Type | Resource |
| Id | openai_admin.projects.service_accounts |
Fields
The following fields are returned by SELECT queries:
- get
- list
Project service account retrieved successfully.
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier, which can be referenced in API endpoints |
name | string | The name of the service account |
created_at | integer (unixtime) | The Unix timestamp (in seconds) of when the service account was created |
object | string | The object type, which is always organization.project.service_account (organization.project.service_account) |
role | string | owner or member (owner, member) |
Project service accounts listed successfully.
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier, which can be referenced in API endpoints |
name | string | The name of the service account |
created_at | integer (unixtime) | The Unix timestamp (in seconds) of when the service account was created |
object | string | The object type, which is always organization.project.service_account (organization.project.service_account) |
role | string | owner or member (owner, member) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | project_id, service_account_id | ||
list | select | project_id | limit, after | |
create | insert | project_id, name | ||
delete | delete | project_id, service_account_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. |
service_account_id | string | The ID of the service account. |
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 service account retrieved successfully.
SELECT
id,
name,
created_at,
object,
role
FROM openai_admin.projects.service_accounts
WHERE project_id = '{{ project_id }}' -- required
AND service_account_id = '{{ service_account_id }}' -- required
;
Project service accounts listed successfully.
SELECT
id,
name,
created_at,
object,
role
FROM openai_admin.projects.service_accounts
WHERE project_id = '{{ project_id }}' -- required
AND limit = '{{ limit }}'
AND after = '{{ after }}'
;
INSERT examples
- create
- Manifest
No description available.
INSERT INTO openai_admin.projects.service_accounts (
name,
project_id
)
SELECT
'{{ name }}' /* required */,
'{{ project_id }}'
RETURNING
id,
name,
api_key,
created_at,
object,
role
;
# Description fields are for documentation purposes
- name: service_accounts
props:
- name: project_id
value: "{{ project_id }}"
description: Required parameter for the service_accounts resource.
- name: name
value: "{{ name }}"
description: |
The name of the service account being created.
DELETE examples
- delete
No description available.
DELETE FROM openai_admin.projects.service_accounts
WHERE project_id = '{{ project_id }}' --required
AND service_account_id = '{{ service_account_id }}' --required
;