---
title: Update a service account
description: Updates the name, description, or role of a service account.
doc_version: 0.1.0-preview
last_updated: 2026-09-14
---

# Update a service account

`PATCH /v1/workspaces/{workspaceId}/service-accounts/{serviceAccountId}`

Updates the name, description, or role of a service account. Requires an admin key. Omit a field to leave it unchanged.

## Authentication

Send `Authorization: Bearer <SPARK_API_KEY>`. Read the key from the
SPARK_API_KEY environment variable. Never print it.

## Path parameters

- `workspaceId` (string) — The workspace id.
- `serviceAccountId` (string) — The service account id.

## Request body

- `name` (string (optional)) — Display name.
- `description` (string (optional)) — Optional notes.
- `role` (string (optional)) — New workspace role for keys this account owns. One of: viewer, editor, admin.

## Example request

```bash
curl --request PATCH \
  --url "https://api.beta.graphon.ai/v1/workspaces/wspQ7WsH2Np5L/service-accounts/sacD4e5F6g7H8" \
  --header "Authorization: Bearer $SPARK_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"name":"Nightly CI"}'
```

## Example response

```json
{
  "id": "sacD4e5F6g7H8",
  "workspaceId": "wspQ7WsH2Np5L",
  "name": "CI runner",
  "description": "Deploys from GitHub Actions.",
  "role": "viewer",
  "status": "active",
  "createdBy": "usrB2c3D4e5F6",
  "createdByName": "Ada Lovelace",
  "createdAt": "2026-09-14T18:00:00.000Z",
  "keyCount": 0,
  "revision": 1
}
```

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
