Create a service account
POST/serviceAccounts
Base URL: https://api.tinkermode.com
Create a service account in the project, along with a first token so the caller can authenticate immediately. The raw token secret is returned exactly once in this response and is never stored or returned again. The service account has no permissions until access control group memberships or direct permission statements are added.
Authentication
Send an Authorization header of the form ModeCloud <AUTH_CODE>.
Must contain a user API key for a project super admin or a project API key with "Admin" privileges.
Request body
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
name | string | Yes | The display name of the service account. | |
projectId | integer | Yes | The project the service account belongs to. |
Request example
{
"name": "Data Pipeline Worker",
"projectId": 1234
}Responses
201 Successfully created a new service account and its first token. The raw token secret is returned exactly once.
Content type: application/json
| Property | Type | Required | Constraints | Description | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
serviceAccount | object | Yes | Represents a project-scoped, machine-to-machine API credential. Its permissions come from access control group memberships and direct permission statements, the same as a user. It is available only in projects with fine-grained access control enabled. | |||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||
token | string | Yes | read-only (server-generated) | Raw secret of the first token. Returned exactly once at creation and never again. Send it in the Authorization header. It is rejected if presented in a query string. | ||||||||||||||||||||||||||||||||||||||||
tokenMetadata | object | Yes | Stored metadata for a single service account token. The raw token secret is never persisted or returned in this record. Only a short display suffix is kept. | |||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||
Response example
{
"serviceAccount": {
"createdAt": "2026-06-01T00:00:00.000Z",
"id": 7,
"name": "Data Pipeline Worker",
"projectId": 1234,
"suspended": false,
"updatedAt": "2026-06-01T00:00:00.000Z"
},
"token": "v1.c2F8MTIzNHwxMDA=.1780509470.a8aeb78fd720c11ec8b6bf7976d8f9d27e95cf7dfacea29a7ea9b65a",
"tokenMetadata": {
"createdAt": "2026-06-01T00:00:00.000Z",
"id": 100,
"projectId": 1234,
"serviceAccountId": 7,
"status": "active",
"suffix": "a9b65a"
}
}401 Authorization is required to access this resource.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
403 Request failed because of invalid data or denied permission.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
429 Request failed because of rate limit.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
500 An unexpected error has occurred.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
503 The service is temporarily unavailable.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |