Fly.io
Postgres Clusters

Create User

View as Markdown

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

POST
/v1/postgres/{postgres_cluster_id}/users

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

Authorization

bearerAuth
AuthorizationBearer <token>

A Fly.io access token. Create one with fly tokens create.

In: header

Path Parameters

postgres_cluster_id*string

Managed Postgres Cluster ID

Request Body

application/json

User details

role*string

Role to grant the user.

username*string

Name for the new user.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/postgres/string/users" \  -H "Content-Type: application/json" \  -d '{    "role": "writer",    "username": "string"  }'
{  "data": {    "role": "schema_admin",    "username": "string"  }}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}