v7

latestOpenAPI 3.0.3raw.githubusercontent.com2026-08-013764062.2 MB
Service Accounts

Update a service account.

Enterprise feature

Updates an existing service account identified by its id.

put/api/admin/service-account/{id}

Path parameters

idstring required

Request body

namestring

The name of the service account

rootRoleinteger

The id of the root role for the service account

Example request

{
  "name": "Service Account 1",
  "rootRole": 1
}

Response

#/components/schemas/serviceAccountSchema

idnumber required

The service account id

isAPIboolean

Deprecated: for internal use only, should not be exposed through the API

namestring

The name of the service account

emailstring

Deprecated: service accounts don't have emails associated with them

usernamestring

The service account username

imageUrlstring

The service account image url

inviteLinkstring

Deprecated: service accounts cannot be invited via an invitation link

loginAttemptsnumber

Deprecated: service accounts cannot log in to Unleash

emailSentboolean

Deprecated: internal use only

rootRoleinteger

The root role id associated with the service account

seenAtstring date-time nullable

Deprecated. This property is always null. To find out when a service account was last seen, check its tokens list and refer to each token's lastSeen property instead.

createdAtstring date-time

The service account creation date

Example response

{
  "id": 54321,
  "name": "My Service Account",
  "email": "noemail@getunleash.io",
  "username": "my-service-account",
  "imageUrl": "https://example.com/my-service-account.png",
  "inviteLink": "https://example.com/invite-link",
  "rootRole": 1,
  "createdAt": "2021-01-01T00:00:00.000Z",
  "tokens": [
    {
      "id": 1,
      "secret": "user:xyzrandomstring",
      "createdAt": "2023-04-19T08:15:14.000Z",
      "seenAt": "2023-04-19T08:15:14.000Z",
      "userId": 1337,
      "description": "user:xyzrandomstring",
      "expiresAt": "2023-04-19T08:15:14.000Z"
    }
  ]
}