---
title: "Update service account"
method: PUT
path: "/v1/service-accounts/{id}"
tags: ["Service Accounts"]
---

# Update service account

`PUT /v1/service-accounts/{id}`

## Request

- Base URL: `https://docs.grepr.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.grepr.ai/v1/service-accounts/{id}`
- Auth: one of:
  - API key in header `GREPR-API-KEY`
  - OpenID Connect (`https://grepr-prod.us.auth0.com/.well-known/openid-configuration`)

Updates the name and role assignments of a service account

## Path parameters

- `id` string, required

## Request body

- UpdateServiceAccount: Request to update a service account
  - `name` string, required: Display name for the service account
  - `roleIds` string[], required: List of role IDs to assign to the service account

## Response `200`

Service account updated successfully

- ServiceAccountRead: Service account for programmatic API access
  - `clientId` string, required: OAuth2 client ID for authentication
  - `id` string, required: Unique identifier
  - `name` string, required: Display name of the service account
  - `roles` Role[], required: List of assigned roles
    - `builtin` boolean: Whether this is a built-in role
    - `createdAt` string, date-time: When the role was created (null for system roles)
    - `createdBy` string: Who created the role (null for system roles)
    - `description` string, required: Description of the role
    - `effect` string: The effect of this role's permissions: 'allow' or 'deny'. Defaults to 'allow' for standard roles.
    - `id` string, required: The id of the role.
    - `name` string, required: The user-facing name of the role.
    - `permissionIds` string[], required: Permission IDs assigned to this role (empty for system roles)

## Other responses

- `400`: Invalid request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Service account not found

---

[API](https://skmtc.dev/grepr/apis/grepr-api.md) - [All operations](https://skmtc.dev/grepr/apis/grepr-api/llms.txt) - [OpenAPI document](https://skmtc.dev/grepr/apis/grepr-api/revisions/2a5ce03a0bf0?raw)
