Skip to content

The Container Operations API provides lifecycle control for individual containers and visibility into their state transition history. Use these endpoints to start, stop, restart, pause, or resume containers, and to audit when and how container status changes occurred.

GET /api/v1/containers/{id}/status-logs

Returns a paginated list of status transition logs for a specific container, ordered by transition time by default. Useful for auditing runtime behavior, debugging unexpected restarts, and observing how long a container spent in each state.

NameInTypeRequiredDescription
idpathstringYesContainer ID
pagequerynumberNoPage number. Default: 1
limitquerynumberNoNumber of log entries per page. Default: 10
sort_byquerystringNoField to sort logs by. Default: "transition_time". Allowed values: "transition_time", "created_at", "to_status", "from_status"
sort_orderquerystringNoSort direction. Default: "desc". Allowed values: "asc", "desc"

This endpoint does not accept a request body.

{
"statusCode": 200,
"message": "Status logs retrieved successfully",
"data": {
"logs": [
{
"id": "507f1f77bcf86cd799439077",
"container_id": "507f1f77bcf86cd799439011",
"from_status": "stopped",
"to_status": "running",
"transition_time": "2025-01-15T10:30:00.000Z",
"duration_ms": 3500,
"triggered_by": "user",
"metadata": {
"command": "start"
}
},
{
"id": "507f1f77bcf86cd799439078",
"container_id": "507f1f77bcf86cd799439011",
"from_status": null,
"to_status": "stopped",
"transition_time": "2025-01-15T09:55:12.000Z",
"duration_ms": null,
"triggered_by": "system",
"metadata": null
}
],
"pagination": {
"total": 15,
"page": 1,
"limit": 10,
"totalPages": 2
}
}
}
const result = await client.api.containers.getStatusLogs({
page: 1,
limit: 10,
sort_by: "transition_time",
sort_order: "desc",
id: "507f1f77bcf86cd799439011"
});
Terminal window
curl -X GET "https://api.hoody.com/api/v1/containers/507f1f77bcf86cd799439011/status-logs?page=1&limit=10&sort_by=transition_time&sort_order=desc" \
-H "Authorization: Bearer <token>"

POST /api/v1/containers/{id}/{operation}

Performs a lifecycle operation on a container. The operation path segment selects the action: start, stop, force-stop, restart, pause, or resume. State-aware operations like start and pause return a 400 OPERATION_STATE_CONFLICT when the container is already in the target state.

NameInTypeRequiredDescription
idpathstringYesContainer ID
operationpathstringYesThe lifecycle operation to perform. Allowed values: "start", "stop", "force-stop", "restart", "pause", "resume"

This endpoint does not accept a request body.

{
"statusCode": 200,
"message": "Container operation completed successfully",
"data": {
"error": false,
"operation": "start",
"container_id": "507f1f77bcf86cd799439011",
"project_id": "507f1f77bcf86cd799439033",
"message": "Container started successfully",
"status": "running"
}
}
const result = await client.api.containers.manage({
operation: "start",
id: "507f1f77bcf86cd799439011"
});
Terminal window
curl -X POST "https://api.hoody.com/api/v1/containers/507f1f77bcf86cd799439011/start" \
-H "Authorization: Bearer <token>"