# Query Service Accounts

Source: https://agenta.ai/docs/reference/api/query-service-accounts

`POST /service-accounts/query`

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

List the project's service accounts, newest first. Key prefixes come from
`GET /service-accounts/{service_account_id}/keys/`.

## Response schemas

### 200: Successful Response

- `count` (integer) Default: `0`.
- `service_accounts` (array of object) Default: `[]`.
  - `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)
