---
title: "Create User"
method: POST
path: "/postgres/{postgres_cluster_id}/users"
tags: ["Postgres Clusters"]
---

# Create User

`POST /postgres/{postgres_cluster_id}/users`

Create a Postgres user within a specific cluster. Fetch the generated password from the credentials endpoint.

## Path parameters

- `postgres_cluster_id` string, required

## Request body

- CreatePostgresUserRequest
  - `role` 'schema_admin' | 'writer' | 'reader', required — Role to grant the user.
  - `username` string, required — Name for the new user.

## Response `201`

Created

- CreatePostgresUserResponse
  - `data` PostgresUser
    - `role` 'schema_admin' | 'writer' | 'reader' — User role.
    - `username` string — User name.

## Other responses

- `400` — Username is reserved, a system user, or malformed
- `404` — Cluster not found
- `409` — User already exists
- `422` — username or role missing, or role 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)
