---
title: "Upload code local rồi deploy / Upload local code and deploy"
method: POST
path: "/api/apps/{app_id}/upload"
tags: ["apps"]
---

# Upload code local rồi deploy / Upload local code and deploy

`POST /api/apps/{app_id}/upload`

## Request

- Base URL: `https://api.monacloud.vn`
- URL: `https://api.monacloud.vn/api/apps/{app_id}/upload`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Token`

Multipart archive zip/tar.gz ≤ APPS_UPLOAD_MAX_MB (80 MiB mặc định), build_path mặc định /; bỏ node_modules, .git, .env*, *.pem, chặn traversal/liên kết, giới hạn dữ liệu giải nén cùng mức và 10.000 entries; trả job id, sandbox từ chối file / Upload a bounded archive, sanitize paths and secrets, detect Dockerfile → dockerfile, index.html only → static, otherwise nixpacks; return a job ID; sandbox rejects uploads. 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í.

## Path parameters

- `app_id` string, required

## Headers

- `X-Vibecloud-Sandbox` '1'

## 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`: App đang bận hoặc source không phải upload / App busy or not an upload source
- `413`: Archive quá lớn / Archive too large
- `422`: Archive không hợp lệ hoặc sandbox / Invalid archive or sandbox upload

---

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