Referensi API

Deployment

Deploy, rollback, periksa status, dan kelola deployment proyek.

Terakhir diperbarui:

API Deployment

Kelola deployment untuk proyek Anda.

Deploy / Redeploy

POST /api/v1/projects/{projectId}/deploy

Request Body (opsional):

{ "startOver": false }

Memicu deployment baru. Untuk deployment yang gagal, sistem secara otomatis mencoba ulang dari langkah yang gagal. Atur startOver: true untuk melewati deteksi percobaan ulang dan menjalankan seluruh pipeline dari awal.

Respons:

{
  "data": {
    "id": "deployment-uuid",
    "version": 3,
    "status": "queued",
    "isRetry": false,
    "queuePriority": 2
  }
}

Periksa Status Deployment

GET /api/v1/projects/{projectId}/status

Mengembalikan kemajuan deployment secara real-time. Poll endpoint ini untuk melacak status deployment.

{
  "data": {
    "step": 3,
    "totalSteps": 6,
    "status": "in_progress",
    "message": "Building your app...",
    "progress": 50
  }
}

Status yang mungkin: queued, in_progress, completed, failed, cancelled

Rollback

POST /api/v1/projects/{projectId}/rollback
{ "targetDeploymentId": "deployment-uuid" }

Mengembalikan proyek ke deployment sukses sebelumnya. Deployment target harus memiliki status completed.

Batalkan Deployment

POST /api/v1/projects/{projectId}/cancel

Membatalkan deployment yang sedang berjalan dan mereset proyek ke status draft. Hanya berfungsi ketika status proyek adalah queued, generating, atau deploying.

Aktifkan Kembali Proyek

POST /api/v1/projects/{projectId}/reactivate

Mengaktifkan kembali proyek yang ditangguhkan dengan membuat deployment baru dari repositori kode yang tersimpan. Membutuhkan 1 kredit.