# Create User (/postgres-clusters/Postgres_users_create)

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

`POST /v1/postgres/{postgres_cluster_id}/users`

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `postgres_cluster_id` | path | `string` | Yes | Managed Postgres Cluster ID |

## Request Body

Type: `createPostgresUserRequest`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `role` | `string` | Yes | Role to grant the user. — Enum: schema_admin, writer, reader |
| `username` | `string` | Yes | Name for the new user. |

## Responses

| Status | Description | Schema |
| --- | --- | --- |
| `201` | Created | `createPostgresUserResponse` |
| `400` | Username is reserved, a system user, or malformed | `PostgresErrorResponse` |
| `404` | Cluster not found | `PostgresErrorResponse` |
| `409` | User already exists | `PostgresErrorResponse` |
| `422` | username or role missing, or role invalid | `PostgresErrorResponse` |

The full machine-readable OpenAPI spec is available at /openapi.json.