---
title: "Update User Role"
method: PATCH
path: "/v1/postgres/{postgres_cluster_id}/users/{username}"
tags: ["Postgres Clusters"]
---

# Update User Role

`PATCH /v1/postgres/{postgres_cluster_id}/users/{username}`

Update a specific Postgres user's role within a cluster.

## Path parameters

- `postgres_cluster_id` string, required
- `username` string, required

## Request body

- UpdatePostgresUserRoleRequest
  - `role` 'schema_admin' | 'writer' | 'reader', required — New role for the user.

## Response `204`

No Content

## Other responses

- `400` — Username is reserved, a system user, or malformed
- `404` — 'Cluster not found' for the cluster; 'User not found' for the user
- `422` — role missing or invalid

## Changes

- **2026-08-12** `f54480c4ce7f` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/machines/apis/machines-api/changes/v1/postgres/:postgres_cluster_id/users/:username/patch.md)

---

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