# Create Service Account

Source: https://agenta.ai/docs/reference/api/create-service-account

`POST /service-accounts/`

Base URL: `https://us.cloud.agenta.ai/api` (US cloud), `https://eu.cloud.agenta.ai/api` (EU cloud) or `$AGENTA_HOST/api` (self-hosted). Authentication: `Authorization: ApiKey YOUR_API_KEY`.

Create a service account of the project. Its role must be one the plan
offers for a member invite; `owner` is refused with `400`.

## Request body schema

Content type: `application/json` (required)

- `service_account` (object, required)
  - `name` (string, required)
  - `description` (string, nullable)
  - `role` (string, required)

## Response schemas

### 200: Successful Response

- `count` (integer) Default: `0`.
- `service_account` (object, nullable)
  - `id` (string (uuid), required)
  - `name` (string, required)
  - `description` (string, nullable)
  - `role` (string, required)
  - `key_count` (integer) Default: `0`.
  - `created_at` (string (date-time), nullable)
  - `updated_at` (string (date-time), nullable)
  - `created_by_id` (string (uuid), nullable)
  - `updated_by_id` (string (uuid), nullable)

### 422: Validation Error

- `detail` (array of object)
  - `loc` (array of string | integer, required)
  - `msg` (string, required)
  - `type` (string, required)
  - `input` (any)
  - `ctx` (Context)
