api
Deployments API
Create, manage, and monitor deployments via the REST API.
Deployments#
Deployments are the core resource in Runix. Each deployment represents a running service — a web app, API, worker, database, or static site.
/deploymentsList all deployments in your workspace.
🔒 Auth: Bearer token required
statusstringoptionalFilter by status: running, failed, stopped, buildingproject_iduuidoptionalFilter by project[
{
"id": "a1b2c3d4-...",
"service_name": "my-api",
"status": "running",
"subdomain": "my-api-x7kf",
"service_type": "web_service",
"instance_type": "starter",
"created_at": "2026-02-25T10:00:00Z"
}
]Example: list all deployments
curl https://api.runix.dev/deployments \
-H "Authorization: Bearer $TOKEN"/deploymentsCreate a new deployment. Runix clones the repo, detects the runtime, generates a Dockerfile with AI, builds the image, and starts the container.
🔒 Auth: Bearer token required
repo_urlstringrequiredGitHub repository URL (e.g., https://github.com/user/repo)branchstringoptionalBranch to deploy. Defaults to main.service_namestringrequiredUnique name for the service (lowercase, hyphens allowed)service_typestringrequiredOne of: web_service, static_site, background_worker, cron_job, postgresql, redis, kafkainstance_typestringoptionalOne of: starter, standard, pro. Defaults to starter.envobjectoptionalKey-value pairs of environment variables to setproject_iduuidoptionalProject to assign this deployment to{
"id": "a1b2c3d4-...",
"service_name": "my-api",
"status": "building",
"subdomain": "my-api-x7kf",
"url": "https://my-api-x7kf.runixcloud.dev"
}Example: create a deployment
curl -X POST https://api.runix.dev/deployments \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"repo_url": "https://github.com/user/my-api",
"service_name": "my-api",
"service_type": "web_service",
"env": {
"NODE_ENV": "production"
}
}'/deployments/{id}Get full details for a single deployment, including status, URL, configuration, and resource usage.
🔒 Auth: Bearer token required
iduuidrequiredDeployment ID{
"id": "a1b2c3d4-...",
"service_name": "my-api",
"status": "running",
"subdomain": "my-api-x7kf",
"url": "https://my-api-x7kf.runixcloud.dev",
"repo_url": "https://github.com/user/my-api",
"branch": "main",
"service_type": "web_service",
"instance_type": "starter",
"created_at": "2026-02-25T10:00:00Z",
"updated_at": "2026-02-25T10:05:00Z"
}/deployments/{id}Stop and delete a deployment. This stops the container and removes all associated resources. This action cannot be undone.
🔒 Auth: Bearer token required
iduuidrequiredDeployment IDDeleting a deployment permanently removes the container and its data. Database deployments will lose all stored data. Make sure you have backups before deleting.
Example: delete a deployment
curl -X DELETE https://api.runix.dev/deployments/a1b2c3d4-... \
-H "Authorization: Bearer $TOKEN"/deployments/{id}/redeployTrigger a fresh build and deploy from the latest commit on the configured branch. This pulls the latest code, regenerates the Dockerfile if needed, and replaces the running container.
🔒 Auth: Bearer token required
iduuidrequiredDeployment ID{
"id": "a1b2c3d4-...",
"status": "building"
}Example: redeploy
curl -X POST https://api.runix.dev/deployments/a1b2c3d4-.../redeploy \
-H "Authorization: Bearer $TOKEN"/deployments/{id}/rollbackRoll back to a previous deployment version. Restores the container from a previous build without rebuilding.
🔒 Auth: Bearer token required
iduuidrequiredDeployment ID{
"id": "a1b2c3d4-...",
"status": "running",
"message": "Rolled back successfully"
}/deployments/{id}/historyList the deployment history, including previous builds and rollbacks.
🔒 Auth: Bearer token required
iduuidrequiredDeployment ID[
{
"version": 3,
"status": "running",
"commit_sha": "abc1234",
"created_at": "2026-02-25T12:00:00Z"
},
{
"version": 2,
"status": "replaced",
"commit_sha": "def5678",
"created_at": "2026-02-24T15:00:00Z"
}
]/deployments/{id}/logsStream runtime logs from the running container in real time. Returns a Server-Sent Events (SSE) stream.
🔒 Auth: Bearer token required
iduuidrequiredDeployment IDThis endpoint returns a Server-Sent Events (SSE) stream, not regular JSON. Use an SSE client or curl with --no-buffer to consume it.
Example: stream runtime logs
curl -N https://api.runix.dev/deployments/a1b2c3d4-.../logs \
-H "Authorization: Bearer $TOKEN"/deployments/{id}/build-streamStream build logs during the Docker image build process. Returns a Server-Sent Events (SSE) stream. Useful for watching builds in progress.
🔒 Auth: Bearer token required
iduuidrequiredDeployment IDExample: stream build logs
curl -N https://api.runix.dev/deployments/a1b2c3d4-.../build-stream \
-H "Authorization: Bearer $TOKEN"/deployments/{id}/connectionGet connection details for a database deployment (PostgreSQL, Redis, Kafka). Returns the host, port, username, password, and connection string.
🔒 Auth: Bearer token required
iduuidrequiredDeployment ID (must be a database service){
"host": "pg-abc123.runixcloud.dev",
"port": 5432,
"username": "runix",
"password": "...",
"database": "app",
"connection_string": "postgresql://runix:...@pg-abc123.runixcloud.dev:5432/app"
}Connection info contains secrets. Do not log or expose these values. Use environment variables to inject them into your application.