Get your free beta license ↗
API operation · databases group
POST

/databases

First published 3 Oct 20260.1.0Unchanged since publication

Create a MariaDB database

Who may call it
AdministratorResellerCustomer
Token scope, any of
databasesall
Answers201 Created

UrbeStack creates the database, records its owner, and returns the database in database. Administrators must supply user to name the customer and can choose any valid name. Customers create databases for themselves. Resellers can create databases for themselves or supply user to select one of their customers. For customers and resellers, name must start with the owner's username followed by an underscore, as in CUSTOMER_.

The API returns 400 for an administrator request without user or for an invalid name. A valid name contains 1 to 64 ASCII letters, digits, or underscores. If the name already exists in MariaDB without a recorded owner, creation is refused. An administrator can assign that database to a customer using POST /databases/{name}/adopt.

As a command

Run as root on the server

Request body

JSON· 2 fields
nameDatabaseNameRequired
A database or database user name can contain up to 64 letters, digits, and underscores. For a customer, UrbeStack forms the name as <username>_<what they type> and converts it to lowercase, while an administrator specifies the full name.
A username consists of lowercase letters, digits and underscores. For the user role, it also serves as the system account name.

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X POST "$API/databases" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "alice",
    "user": "alice"
  }'
Response · 201 Created
{
  "database": {
    "created_at": "2026-09-09T10:15:00Z",
    "id": 1,
    "measured_at": "text",
    "name": "alice",
    "size_bytes": 1,
    "user": "alice",
    "user_id": 2
  }
}

Errors

11 errors, each a status and a sentence
400--name is required
400A <what> name is 1 to 64 letters, digits or underscores
400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
400Username '<value>' is reserved
400user is required: the customer the database is for
401Authentication required
404MariaDB has no database named <name>
409Database <name> already exists
409Database <name> exists in MariaDB with no record of whose it is; an administrator can adopt it: urbestack-database-adopt --name <name> --user
409The disk allowance of <user.name> is used up:
409The package <p.name> allows <limit>
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.1.0 on 3 Oct 2026.
urbestack.com/docs/api/post-databases/