# Edit Service Account

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

`PUT /service-accounts/{service_account_id}`

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`.

Rename the account or change its role. A role change applies at the
account's next request.

## Parameters

- `service_account_id` (in path, string (uuid), required)

## Request body schema

Content type: `application/json` (required)

- `service_account` (object, required): The whole editable state (PUT): a missing description clears it.
  - `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)
