---
title: "Update a Service Account"
method: PATCH
path: "/service-accounts/{service_account}"
tags: ["service-accounts"]
---

# Update a Service Account

`PATCH /service-accounts/{service_account}`

## Request

- Base URL: `https://example.scalr.io/api/iacp/v3`
- URL: `https://example.scalr.io/api/iacp/v3/service-accounts/{service_account}`
- Auth: HTTP bearer

This endpoint updates [IAM](https://docs.scalr.io/docs/identity-and-access-management) service account by ID.

## Path parameters

- `service_account` string, required

## Query parameters

- `include` string[]

## Request body

- ServiceAccountDocument: JSON:API Document. see: https://jsonapi.org/format/#document-structure
  - `data` ServiceAccount: Represents a service account definition. A service account is a special type of account intended to represent a non-human user that needs to authenticate and be authorized to access data in Scalr APIs.
    - `attributes` object, required
      - `created-at` string, date-time
      - `description` string, nullable: The service account description.
      - `email` string: A read-only field which is generated when a service account is created. Consists of `<name>@<account-domain>.scalr.io`
      - `name` string, required: The service account name. The service account email will be created using this name.
      - `status` 'Active' | 'Inactive': The service account status. Can be: `Active`, `Inactive`.
    - `id` string
    - `links` object
      - `self` string
    - `relationships` object, required
      - `account` object, required: The account ID, the service account belongs to.
        - `data` object, required
          - `id` string, required
          - `type` 'accounts' | '', required
      - `created-by` object: The user who created the service account.
        - `data` object, nullable, required
          - `id` string, required
          - `type` 'users' | '', required
      - `owners` object: The teams, the service account belongs to.
        - `data` object[], nullable, required
          - `id` string, required
          - `type` 'teams' | '', required
    - `type` 'service-accounts', required
  - `included` object[]
  - `meta` object

## Response `200`

Successfully updated.

- ServiceAccountDocument: JSON:API Document. see: https://jsonapi.org/format/#document-structure
  - `data` ServiceAccount: Represents a service account definition. A service account is a special type of account intended to represent a non-human user that needs to authenticate and be authorized to access data in Scalr APIs.
    - `attributes` object, required
      - `created-at` string, date-time
      - `description` string, nullable: The service account description.
      - `email` string: A read-only field which is generated when a service account is created. Consists of `<name>@<account-domain>.scalr.io`
      - `name` string, required: The service account name. The service account email will be created using this name.
      - `status` 'Active' | 'Inactive': The service account status. Can be: `Active`, `Inactive`.
    - `id` string
    - `links` object
      - `self` string
    - `relationships` object, required
      - `account` object, required: The account ID, the service account belongs to.
        - `data` object, required
          - `id` string, required
          - `type` 'accounts' | '', required
      - `created-by` object: The user who created the service account.
        - `data` object, nullable, required
          - `id` string, required
          - `type` 'users' | '', required
      - `owners` object: The teams, the service account belongs to.
        - `data` object[], nullable, required
          - `id` string, required
          - `type` 'teams' | '', required
    - `type` 'service-accounts', required
  - `included` object[]
  - `meta` object

## Other responses

- `403`: User unauthorized to perform this action.
- `404`: Service account not found.
- `422`: Malformed request body (missing attributes, wrong types, etc.).
- `4XX`: Client error.
- `5XX`: Server error.

---

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