---
title: "Create or reuse this user's Dokploy app host"
method: POST
path: "/api/app-hosts"
tags: ["apps"]
---

# Create or reuse this user's Dokploy app host

`POST /api/app-hosts`

## Request

- Base URL: `https://api.monacloud.vn`
- URL: `https://api.monacloud.vn/api/app-hosts`
- 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/app-hosts`. Phản hồi dùng JSON và tuân theo schema được công bố bên dưới. Repo public HTTPS hoặc source=upload → job Dokploy → URL HTTPS / Deploy public git or local archives via Dokploy. Poll /api/jobs/{id} tới succeeded/failed. App host dùng billing LXC Wave A; app không tính thêm phí. POST /api/app-hosts với {} dùng 2 CPU/2 GB RAM/30 GB disk; hỗ trợ billing_mode monthly + plan_code + period. X-Vibecloud-Sandbox: 1 trên /api/apps tạo URL giả, trả estimated_app_host và charged_vnd=0. PUT env thay toàn bộ env, cần POST deploy để áp dụng. Custom domain trả CNAME và SSL pending. Xoá app giữ host; xoá /api/services/{app_host_id} để ngừng phí.

## Request body

- AppHostCreateRequest
  - `app_name` string
  - `package_slug` string, nullable
  - `cpu` integer, nullable
  - `ram_gb` integer, nullable
  - `disk_gb` integer, nullable
  - `hostname` string, nullable
  - `billing_mode` 'hourly' | 'monthly'
  - `plan_code` string, nullable
  - `period` 'month' | 'year'

## 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

- `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)
