---
title: "Create a sandbox database instance"
method: POST
path: "/api/sandbox/databases"
tags: ["sandbox"]
---

# Create a sandbox database instance

`POST /api/sandbox/databases`

## Request

- Base URL: `https://api.monacloud.vn`
- URL: `https://api.monacloud.vn/api/sandbox/databases`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Token`

Tạo dữ liệu hoặc thực thi thao tác tại `/api/sandbox/databases`. Phản hồi dùng JSON và tuân theo schema được công bố bên dưới. Engine nhận `mongodb`, `postgresql`, `mysql` (`mongo` là alias). Route thật trả 409 `engine_not_available` trước khi tạo job nếu template đã resolve chưa có trên node; route sandbox không kiểm tra hạ tầng.

## Request body

- DatabaseCreateRequest: Database create payload. Like LxcCreateRequest, callers may either pass `package_slug` or explicit cpu/ram_gb/disk_gb (not both).
  - `app_name` string, required
  - `engine` 'mongodb' | 'postgresql' | 'mysql': Database engine. `mongo` is accepted as a compatibility alias for `mongodb`; canonical values are `mongodb`, `postgresql`, and `mysql`.
  - `package_slug` string, nullable
  - `cpu` integer, nullable
  - `ram_gb` integer, nullable
  - `disk_gb` integer, nullable

## Response `200`

Successful Response

- JobResponse
  - `id` string, required
  - `status` 'awaiting_upload' | 'queued' | 'pending' | 'running' | 'done' | 'succeeded' | 'failed' | 'retrying' | 'cancelled', required
  - `type` string, required
  - `result` object, nullable
  - `error` string, nullable
  - `attempts` integer
  - `max_attempts` integer
  - `stages` JobStage[]
    - `name` string, required
    - `status` 'running' | 'succeeded' | 'failed', required
    - `started_at` string, date-time, required
    - `updated_at` string, date-time, required
    - `completed_at` string, date-time, nullable
    - `duration_seconds` number, nullable
    - `error` string, nullable
    - `detail` object, nullable
  - `created_at` string, date-time, nullable
  - `updated_at` string, date-time, nullable
  - `sandbox` boolean
  - `expires_at` string, date-time, nullable

## Other responses

- `409`: Conflict
- `422`: Validation Error

---

[API](https://skmtc.dev/monacloud/apis/mona-cloud-api-compute-truoc-ay-vibecloud.md) · [All operations](https://skmtc.dev/monacloud/apis/mona-cloud-api-compute-truoc-ay-vibecloud/llms.txt) · [OpenAPI document](https://skmtc.dev/monacloud/apis/mona-cloud-api-compute-truoc-ay-vibecloud/revisions/34a120ed37ce?raw)
