Skip to main content
POST
cURL
This endpoint has a rate limit of 1 request every 3 seconds, shared with the other endpoints that change databases (create, update, update credentials and delete).
The password of a database is never returned by the API. Store it when you create the database or change its password.

Connecting

Use connection.host and connection.port from the response of GET /v1/databases/{databaseId} once the status is active:

Authorizations

Authorization
string
header
required

Your CamposCloud API token, sent as Authorization: Bearer <token>.

Body

application/json
name
string
required

Display name: letters, numbers, spaces, _, . and -, starting with a letter or number, without leading or trailing spaces.

Required string length: 3 - 50
Pattern: ^[A-Za-z0-9][A-Za-z0-9 _.-]*$
Example:

"main-db"

type
enum<string>
required
Available options:
mysql,
postgresql,
mongodb,
redis
Example:

"postgresql"

memoryMB
integer
required

Memory in MB. Must be a JSON number (not a string), at least the minimum allowed for databases (512 MB by default) and must fit in the memory left in the plan.

Required range: x >= 1
Example:

512

password
string
required

Password of the database. 12 to 72 characters, only letters, numbers and _ . @ % + = -, starting with a letter or number. It must also be strong enough (zxcvbn score 3 or higher), otherwise the request is refused with password too weak. use a stronger password.

Required string length: 12 - 72
Pattern: ^[A-Za-z0-9][A-Za-z0-9_.@%+=-]*$
Example:

"Tr0ub4dor.Zebra-Lamp=91"

team
string

ID of the team to create the database in. Requires the canCreateDatabase permission. The memory is taken from the plan of the team owner. Omit to create a personal database.

Pattern: ^[a-f0-9]{24}$
username
string

User that your applications will connect with. Required for mysql, postgresql and mongodb, not allowed for redis. 3 to 32 letters, numbers or _, starting with a letter. Reserved names such as root, admin, postgres and mysql are refused.

Pattern: ^[A-Za-z][A-Za-z0-9_]{2,31}$
Example:

"app_user"

database
string

Name of the initial database. Required for mysql and postgresql, not allowed for mongodb and redis. Up to 63 letters, numbers or _, starting with a letter. Reserved names such as mysql, postgres, information_schema and admin are refused.

Pattern: ^[A-Za-z][A-Za-z0-9_]{0,62}$
Example:

"app_db"

Response

The database that is being created.

_id
string

ID of the database.

Example:

"64b7f0c2a1b2c3d4e5f60718"

name
string

Display name.

Example:

"main-db"

type
enum<string>
Available options:
mysql,
postgresql,
mongodb,
redis
Example:

"postgresql"

status
enum<string>

creating right after creation, active when ready, rebuilding while the container is rebuilt, error when the last rebuild failed.

Available options:
creating,
active,
rebuilding,
error
Example:

"active"

restartRequired
boolean

Whether a change (memory, or the password of a Redis database) is waiting for the next start, stop or restart to be applied.

Example:

false

userId
string | null

ID of the account that owns the database.

Example:

"64b7f0c2a1b2c3d4e5f60700"

teamId

Team of the database: null for personal databases, otherwise the team ID or an object with the ID and name of the team.

Example:

null

workerNodeId

Server that runs the database: its ID, or an object with the ID and name.

Example:
allocatedMemoryMB
integer

Memory reserved for the database, in MB. It counts towards the memory of the plan.

Example:

512

allocatedVCpu
number

vCPUs available to the database.

Example:

1

diskLimitBytes
integer

Disk limit in bytes.

Example:

10737418240

diskUsageBytes
integer | null

Latest measured disk usage in bytes. null when not measured yet.

Example:

52428800

containerImage
string

Image and version of the database engine.

Example:

"postgres:trixie"

connection
object

How to connect to the database. The password is never returned by the API: it is chosen when the database is created and can only be replaced, not read.

currentResourceMetrics
null | object

Latest metrics. null when none were collected yet.

createdAt
string<date-time>
Example:

"2025-01-01T12:00:00.000Z"

updatedAt
string<date-time>
Example:

"2025-01-01T12:00:00.000Z"