Skip to main content

service_accounts

Creates, updates, deletes, gets or lists a service_accounts resource.

Overview

Nameservice_accounts
TypeResource
Idopenai_admin.projects.service_accounts

Fields

The following fields are returned by SELECT queries:

Project service account retrieved successfully.

NameDatatypeDescription
idstringThe identifier, which can be referenced in API endpoints
namestringThe name of the service account
created_atinteger (unixtime)The Unix timestamp (in seconds) of when the service account was created
objectstringThe object type, which is always organization.project.service_account (organization.project.service_account)
rolestringowner or member (owner, member)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectproject_id, service_account_id
listselectproject_idlimit, after
createinsertproject_id, name
deletedeleteproject_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.

NameDatatypeDescription
project_idstringThe ID of the project.
service_account_idstringThe ID of the service account.
afterstringA 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.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

SELECT examples

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
;

INSERT examples

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
;

DELETE examples

No description available.

DELETE FROM openai_admin.projects.service_accounts
WHERE project_id = '{{ project_id }}' --required
AND service_account_id = '{{ service_account_id }}' --required
;