---
title: "Rotate service account token"
method: POST
path: "/api/v1/organizations/{organizationID}/serviceaccounts/{serviceAccountID}/rotate"
tags: ["Service accounts"]
---

# Rotate service account token

`POST /api/v1/organizations/{organizationID}/serviceaccounts/{serviceAccountID}/rotate`

Rotates a service account's access token. The returned access
token can only be read once.

## Response `200`

A service account creation.

- ServiceAccountCreate — A new service account.
  - `metadata` OrganizationScopedResourceReadMetadata, required — Metadata required for all API resource reads and writes.
    - `name` string, required — A valid Kubernetes label value, typically used for resource names that can be indexed in the database.
    - `description` string — The resource description, this optionally augments the name with more context.
    - `tags` Tag[] — A list of tags.
      - `name` string, required — A unique tag name.
      - `value` string, required — The value of the tag.
    - `id` string, required — The unique resource ID.
    - `creationTime` string, date-time, required — The time the resource was created.
    - `createdBy` string — The user who created the resource.
    - `modifiedTime` string, date-time — The time a resource was updated.
    - `modifiedBy` string — The user who updated the resource.
    - `deletionTime` string, date-time — The time the resource was deleted.
    - `provisioningStatus` 'unknown' | 'provisioning' | 'provisioned' | 'deprovisioning' | 'error', required — The provisioning state of a resource.
    - `healthStatus` 'unknown' | 'healthy' | 'degraded' | 'error', required — The health state of a resource.
    - `organizationId` string, required — The organization identifier the resource belongs to.
  - `spec` ServiceAccountSpec, required — A service account specification.
    - `groupIDs` string[], required — A list of group IDs.
  - `status` ServiceAccountStatus, required — A service account status.
    - `expiry` string, date-time, required — When the service token is due to expire.
    - `accessToken` string — A long lived access token that can be exchanged for an API access token.

## Other responses

- `401` — Authentication failed or the access token has expired.
- `403` — Request was denied by authorization, this may be caused by the authorization token not having the required scope for an API, or the user doesn't have the necessary privileges on the provider platform.
- `500` — An unexpected or unhandled error occurred. This may be a transient error and may succeed on a retry. If this isn't the case, please report it as an issue.

---

[API](https://skmtc.net/nscale/apis/region-service-api.md) · [All operations](https://skmtc.net/nscale/apis/region-service-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nscale/region-service-api/revisions/c2991b23da6e/schema)
