Coolify logoCoolify
POST
/databases/postgresql

Create a new PostgreSQL database.

Authorization

bearerAuth
AuthorizationBearer <token>

Go to Keys & Tokens / API tokens and create a new token. Use the token as the bearer token.

In: header

Request Body

application/json

Database data

TypeScript Definitions

Use the request body type in TypeScript.

server_uuid*string

UUID of the server

project_uuid*string

UUID of the project

environment_name*string

Name of the environment. You need to provide at least one of environment_name or environment_uuid.

environment_uuid*string

UUID of the environment. You need to provide at least one of environment_name or environment_uuid.

postgres_user?string

PostgreSQL user

postgres_password?string

PostgreSQL password

postgres_db?string

PostgreSQL database

postgres_initdb_args?string

PostgreSQL initdb args

postgres_host_auth_method?string

PostgreSQL host auth method

postgres_conf?string

PostgreSQL conf

destination_uuid?string

UUID of the destination if the server has multiple destinations

name?string

Name of the database

description?string

Description of the database

image?string

Docker Image of the database

is_public?boolean

Is the database public?

public_port?integer

Public port of the database

limits_memory?string

Memory limit of the database

limits_memory_swap?string

Memory swap limit of the database

limits_memory_swappiness?integer

Memory swappiness of the database

limits_memory_reservation?string

Memory reservation of the database

limits_cpus?string

CPU limit of the database

limits_cpuset?string

CPU set of the database

limits_cpu_shares?integer

CPU shares of the database

instant_deploy?boolean

Instant deploy the database

Response Body

application/json

application/json

application/json

curl -X POST "https://app.coolify.io/api/v1/databases/postgresql" \  -H "Content-Type: application/json" \  -d '{    "server_uuid": "string",    "project_uuid": "string",    "environment_name": "string",    "environment_uuid": "string"  }'
Empty
{  "message": "Invalid token."}
{  "message": "Unauthenticated."}
{  "message": "Validation error.",  "errors": {    "name": [      "The name field is required."    ],    "api_url": [      "The api url field is required.",      "The api url format is invalid."    ]  }}