Skip to Content
kosemdocs
ReferenceAPIService accounts

Create service account in project

Creates a service account in an organization or a project.

POST
/v1/projects/{project}/serviceAccounts

Creates a service account in an organization or a project.

Authorization

bearer
headerAuthorizationBearer <token>

An access token, or an API key.

Path Parameters

project*string

The project's ID.

Match^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$

Request Body

application/json
  1. body
accountId*string

A readable name, unique within the organization or project that owns the account: 6 to 30 lowercase letters, digits or hyphens, starting with a letter. It never changes.

Match^[a-z][a-z0-9-]{4,28}[a-z0-9]$
description?string

What the account is for.

Lengthlength <= 1000
displayName?string

Name shown in user interfaces.

Lengthlength <= 100

Response Body

Created

application/json
  1. response
accountId*string

A readable name, unique within the organization or project that owns the account.

createTime*string

When the account was created.

Formatdate-time
description*string

What the account is for.

displayName*string

Name shown in user interfaces.

name*string

Resource name, projects/{project_id}/serviceAccounts/{service_account_id} for a project's account or organizations/{organization_id}/serviceAccounts/{service_account_id} for an organization's own. It never changes.

state*string

Lifecycle state: the keys of an ACTIVE account work, and a DISABLED one's are refused.

Value in"ACTIVE""DISABLED"
updateTime*string

When the account was last updated.

Formatdate-time
Example Request
curl -X POST 'https://api.kosem.ai/v1/projects/string/serviceAccounts' \
  -H 'Content-Type: application/json' \
  -d '{
  "accountId": "string"
}'
Example Response
{
  "accountId": "string",
  "createTime": "2019-08-24T14:15:22Z",
  "description": "string",
  "displayName": "string",
  "name": "string",
  "state": "ACTIVE",
  "updateTime": "2019-08-24T14:15:22Z"
}