Sign Up

Service Accounts

List service accounts

GET
/orgs/{org_id}/service-accounts

Authorization

user_jwt read:service_accounts
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:service_accounts

Path Parameters

org_id*string

The organization ID

Formatuuid

Query Parameters

limit?integer

Maximum number of items to return, 1–200 (default 100)

Formatint64
Range1 <= value <= 200
Default100
cursor?string

Opaque continuation token returned as next_cursor by a previous request

Response Body

The page of service accounts

application/json
  1. response
next_cursor?|

The cursor for the next page, or null at the end.

service_accounts*array<>

The service accounts.

curl -X GET 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/service-accounts'
{  "next_cursor": "string",  "service_accounts": [    {      "archived_at": "2019-08-24T14:15:22Z",      "created_at": "2019-08-24T14:15:22Z",      "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",      "description": "string",      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "live_key_count": 0,      "name": "string",      "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",      "org_permissions": [        "string"      ],      "roles": [        "string"      ],      "updated_at": "2019-08-24T14:15:22Z"    }  ]}

Create a service account

POST
/orgs/{org_id}/service-accounts

Creates a named account for organization automation.

Authorization

user_jwt write:service_accounts
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: write:service_accounts

Path Parameters

org_id*string

The organization ID

Formatuuid

Request Body

application/json
  1. body
description?|

The service account purpose, or null when omitted.

name*string

The service account name.

roles*array<string>

The role identifiers to assign.

Items1 <= items

Response Body

The created service account

application/json
  1. response
archived_at?|

When the service account was archived, or null.

Formatdate-time
created_at*string

When the service account was created.

Formatdate-time
created_by?|

The user who created the service account, or null.

Formatuuid
description?|

The optional description.

id*string

The service account ID.

Formatuuid
live_key_count*integer

The number of active API keys owned by the service account.

Formatint64
name*string

The service account name.

org_id*string

The organization ID.

Formatuuid
org_permissions*array<string>

The effective permissions granted by the roles.

roles*array<string>

The assigned role identifiers.

updated_at*string

When the service account was last updated.

Formatdate-time
curl -X POST 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/service-accounts' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "roles": [    "string"  ]}'
{  "archived_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "description": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "live_key_count": 0,  "name": "string",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "org_permissions": [    "string"  ],  "roles": [    "string"  ],  "updated_at": "2019-08-24T14:15:22Z"}

Get a service account

GET
/orgs/{org_id}/service-accounts/{service_account_id}

Authorization

user_jwt read:service_accounts
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: read:service_accounts

Path Parameters

org_id*string

The organization ID

Formatuuid
service_account_id*string

The service account ID

Formatuuid

Response Body

The service account

application/json
  1. response
archived_at?|

When the service account was archived, or null.

Formatdate-time
created_at*string

When the service account was created.

Formatdate-time
created_by?|

The user who created the service account, or null.

Formatuuid
description?|

The optional description.

id*string

The service account ID.

Formatuuid
live_key_count*integer

The number of active API keys owned by the service account.

Formatint64
name*string

The service account name.

org_id*string

The organization ID.

Formatuuid
org_permissions*array<string>

The effective permissions granted by the roles.

roles*array<string>

The assigned role identifiers.

updated_at*string

When the service account was last updated.

Formatdate-time
curl -X GET 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/service-accounts/497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "archived_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "description": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "live_key_count": 0,  "name": "string",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "org_permissions": [    "string"  ],  "roles": [    "string"  ],  "updated_at": "2019-08-24T14:15:22Z"}

Update a service account

PATCH
/orgs/{org_id}/service-accounts/{service_account_id}

Updates the name, description, or complete role set. Narrowing roles may revoke API keys.

Authorization

user_jwt write:service_accounts
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: write:service_accounts

Path Parameters

org_id*string

The organization ID

Formatuuid
service_account_id*string

The service account ID

Formatuuid

Request Body

application/json
  1. body
description?|

The replacement description; null clears it.

name?|

The replacement name.

roles?array<string>|

The replacement role identifiers.

Response Body

The service account

application/json
  1. response
archived_at?|

When the service account was archived, or null.

Formatdate-time
created_at*string

When the service account was created.

Formatdate-time
created_by?|

The user who created the service account, or null.

Formatuuid
description?|

The optional description.

id*string

The service account ID.

Formatuuid
live_key_count*integer

The number of active API keys owned by the service account.

Formatint64
name*string

The service account name.

org_id*string

The organization ID.

Formatuuid
org_permissions*array<string>

The effective permissions granted by the roles.

roles*array<string>

The assigned role identifiers.

updated_at*string

When the service account was last updated.

Formatdate-time
curl -X PATCH 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/service-accounts/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{}'
{  "archived_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "description": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "live_key_count": 0,  "name": "string",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "org_permissions": [    "string"  ],  "roles": [    "string"  ],  "updated_at": "2019-08-24T14:15:22Z"}
DELETE
/orgs/{org_id}/service-accounts/{service_account_id}

Archives the service account and revokes its active API keys.

Authorization

user_jwt delete:service_accounts
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: delete:service_accounts

Path Parameters

org_id*string

The organization ID

Formatuuid
service_account_id*string

The service account ID

Formatuuid

Response Body

Service account archived

curl -X DELETE 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/service-accounts/497f6eca-6276-4993-bfeb-53cbbbba6f08'
Empty
POST
/orgs/{org_id}/service-accounts/{service_account_id}/update-preview

Authorization

user_jwt write:service_accounts
headerAuthorizationBearer <token>

Bearer access token for a signed-in user.

Scope: write:service_accounts

Path Parameters

org_id*string

The organization ID

Formatuuid
service_account_id*string

The service account ID

Formatuuid

Request Body

application/json
  1. body

The same body as the update, previewed without applying it.

description?|

The replacement description; null clears it.

name?|

The replacement name.

roles?array<string>|

The replacement role identifiers.

Response Body

The change impact

application/json
  1. response
revoked_api_keys*integer

The number of API keys the change would revoke.

Formatint64
Range0 <= value
revoked_preview_grants*integer

The number of preview grants the change would revoke.

Formatint64
Range0 <= value
curl -X POST 'https://example.com/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/service-accounts/497f6eca-6276-4993-bfeb-53cbbbba6f08/update-preview' \  -H 'Content-Type: application/json' \  -d '{}'
{  "revoked_api_keys": 0,  "revoked_preview_grants": 0}