Deployments

Deploy applications and view deployment history.

Deploy

POST /v1/projects/:id/deploy
Content-Type: multipart/form-data
curl -X POST https://api.sota.io/v1/projects/550e8400-e29b-41d4-a716-446655440000/deploy \
  -H "Authorization: Bearer <token>" \
  -F "archive=@app.tar.gz"

Request

Upload your code as a .tar.gz archive (max 50 MB) in the archive form field.

Response

Returns 202 Accepted — the build starts asynchronously:

{
  "data": {
    "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "project_id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "pending",
    "image_tag": null,
    "build_method": null,
    "framework": null,
    "error_message": null,
    "url": null,
    "created_at": "2026-02-25T14:30:00Z",
    "updated_at": "2026-02-25T14:30:00Z"
  }
}

The deployment starts building immediately. Use the logs stream endpoint to follow build progress.

While a rollback or redeploy of the project is in progress, the upload is refused with 409 Conflict and the code deployment_in_progress; try again once it has finished. Uploads do not block each other: a new upload while an earlier build is still running is queued behind it.

Redeploy

Re-deploy the current image with the latest environment variables. No code upload needed — uses the existing built image.

POST /v1/projects/:id/redeploy
curl -X POST https://api.sota.io/v1/projects/550e8400-e29b-41d4-a716-446655440000/redeploy \
  -H "Authorization: Bearer <token>"

Returns 200 OK with the new deployment:

{
  "data": {
    "id": "new-deployment-uuid",
    "project_id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "deploying",
    "created_at": "2026-02-28T12:00:00Z"
  }
}

Useful after changing environment variables — redeploy picks up the new values without re-building.

If the project already has a deployment in progress (a deploy, rollback or another redeploy), the API returns 409 Conflict with the code deployment_in_progress; wait until it has finished and try again.

List Deployments

GET /v1/projects/:id/deployments
curl https://api.sota.io/v1/projects/550e8400-e29b-41d4-a716-446655440000/deployments \
  -H "Authorization: Bearer <token>"

Response:

{
  "data": [
    {
      "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "project_id": "550e8400-e29b-41d4-a716-446655440000",
      "status": "running",
      "image_tag": "registry.sota.io/my-app:7c9e6679",
      "build_method": "railpack",
      "framework": "nextjs",
      "url": "my-app.sota.io",
      "created_at": "2026-02-25T14:30:00Z",
      "updated_at": "2026-02-25T14:31:00Z"
    }
  ],
  "pagination": {
    "next_cursor": null,
    "has_more": false
  }
}

Stream Build Logs

GET /v1/projects/:id/deployments/:deploy_id/logs/stream

This endpoint uses Server-Sent Events (SSE) to stream build logs in real-time.

curl -N https://api.sota.io/v1/projects/550e8400-.../deployments/7c9e6679-.../logs/stream \
  -H "Authorization: Bearer <token>"

Each event contains a log line:

data: [build] Installing dependencies...
data: [build] Building application...
data: [deploy] Container started
data: [deploy] Health check passed

The connection closes when the deployment completes or fails. Maximum connection duration: 15 minutes.

Get Deployment Logs

GET /v1/projects/:id/deployments/:deploy_id/logs

Returns all available logs for the deployment as text or JSON, depending on the Accept header.

Deployment Statuses

StatusDescription
pendingDeployment created, waiting for build to start
buildingCode archive uploaded, build in progress
builtImage built successfully, preparing to deploy
deployingContainer starting, running health checks
runningContainer healthy, serving traffic
failedBuild or health check failed
stoppedContainer stopped (replaced by newer deployment)