---
title: "Update an API user"
method: PUT
path: "/api-users/{userId}"
tags: ["Users"]
---

# Update an API user

`PUT /api-users/{userId}`

Rename an existing API user. The user's site memberships,
roles and access token are left unchanged — only the
human-readable label is updated. The new `name` must remain
unique across API users in the organisation.

Requires the caller's site-user to hold the `users:manage`
permission on a site that the API user belongs to.

## Request body

- object
  - `name` string, required — New human-readable label for the API user. Must be unique across API users in the organisation.
  - `site_id` string, uuid, required — Identifier of the API user's primary site. Used to validate uniqueness of `name` within the owning organisation; the user's existing site memberships are not changed by this field.

## Response `200`

An API User

- object — Single-item envelope mixin. `allOf` this into any show response that wraps its `data` payload in an outer object; the concrete schema (e.g. `ShowUser`) adds its own `data` property with the appropriate `$ref` and keeps its own title so the SDK surface is unchanged.
  - `data` ApiUser, required
    - `id` string, uuid, required — The ID of the user
    - `name` string, required — The user's name
    - `organisation_name` string — The name of the organisation that this user belongs to
    - `organisation_id` string, uuid, required — The ID of the organisation that this user belongs to
    - `site_ids` string[], required — The IDs of the sites that this user belongs to
    - `status` string, required — The status of the user
    - `created_at` string, date-time, required — The date and time the user was created
    - `updated_at` string, date-time, required — The date and time the user was last updated

## Other responses

- `401` — The user is unauthenticated
- `403` — The authenticated user does not have permission.
- `404` — The resource couldn't be found
- `422` — The request didn't pass validation

---

[API](https://skmtc.dev/try/apis/trybe-api.md) · [All operations](https://skmtc.dev/try/apis/trybe-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/try/trybe-api/revisions/f37f92702da5/schema)
