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

# Update User Role

`PATCH /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

---

[API](https://skmtc.net/machines/apis/machines-api.md) · [All operations](https://skmtc.net/machines/apis/machines-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/machines/machines-api/versions/633ddedda749/schema)
