Skip to main content
POST
/
data-views
/
service-accounts
Python
import os
from datagrid_ai import Datagrid

client = Datagrid(
    api_key=os.environ.get("DATAGRID_API_KEY"),  # This is the default and can be omitted
)
service_account = client.data_views.service_accounts.create(
    name="name",
    type="gcp",
)
print(service_account.id)
{
  "object": "service_account",
  "type": "gcp",
  "id": "<string>",
  "email": "<string>",
  "created_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

The name of the service account. Your organization's domain will automatically be prepended to the service account name. The name must only include letters (a-z, A-Z), numbers (0-9), and hyphens (-), and must be between 6 and 30 characters long.

type
enum<string>
required

The type of service account, currently only gcp is supported.

Available options:
gcp

Response

201 - application/json

Successfully created service account

The service_account object represents a service account for accessing data views.

object
enum<string>
required

The object type, which is always service_account.

Available options:
service_account
type
enum<string>
required

The type of service account, currently only gcp is supported.

Available options:
gcp
id
string
required

The service account identifier.

email
string
required

The email address of the service account.

created_at
string<date-time>
required

The ISO string for when the service account was created.