Deployments API
Deployments represent versioned releases of your services. Use the Deployments API to trigger builds, monitor progress, and view logs.
List Deployments
Get all deployments for a service.
GET /api/projects/:projectId/services/:serviceId/deployments
Response:
{
"deployments": [
{
"id": "dep_123",
"serviceId": "svc_456",
"status": "DEPLOYED",
"commitHash": "abc123",
"commitMessage": "Fix bug in login",
"createdAt": "2024-01-15T10:30:00Z",
"deployedAt": "2024-01-15T10:35:00Z"
}
]
}
Get Deployment
Get a specific deployment by ID.
GET /api/projects/:projectId/services/:serviceId/deployments/:deploymentId
Response:
{
"id": "dep_123",
"serviceId": "svc_456",
"status": "DEPLOYED",
"commitHash": "abc123",
"commitMessage": "Fix bug in login",
"createdAt": "2024-01-15T10:30:00Z",
"deployedAt": "2024-01-15T10:35:00Z",
"logs": "Build logs here..."
}
Trigger Deployment
Trigger a new deployment for a service.
POST /api/projects/:projectId/services/:serviceId/deployments
Request Body:
{
"commitHash": "abc123"
}
Response:
{
"id": "dep_124",
"serviceId": "svc_456",
"status": "BUILDING",
"commitHash": "abc123",
"createdAt": "2024-01-15T11:00:00Z"
}
Deployment Status
Deployments can have the following statuses:
| Status | Description |
|---|---|
BUILDING | Build in progress |
DEPLOYING | Deployment in progress |
DEPLOYED | Successfully deployed |
FAILED | Deployment failed |
CANCELLED | Deployment cancelled |
Use webhooks to receive real-time notifications when deployment status changes.