Skip to content
Hoody.com

The Container Operations and Lifecycle endpoints control the runtime state of a container and expose the history of its state transitions. Use these endpoints to start, stop, restart, pause, or resume a container, and to retrieve a paginated audit log of every status change for debugging, compliance, or operational reporting.

Returns a paginated list of status transition logs for a specific container. Each entry records the previous and new status, the actor that triggered the transition, the elapsed time in the prior status, and any metadata captured at the moment of the transition.

NameInTypeRequiredDescription
idpathstringYesContainer ID
pagequerynumberNoPage number. Default: 1
limitquerynumberNoItems per page. Default: 10
sort_byquerystringNoField to sort by. Default: "transition_time". One of: "transition_time", "created_at", "to_status", "from_status"
sort_orderquerystringNoSort direction. Default: "desc". One of: "asc", "desc"

This endpoint takes no request body.

Terminal window
curl -X GET 'https://api.hoody.com/api/v1/containers/{id}/status-logs?page=1&limit=10&sort_by=transition_time&sort_order=desc' \
-H 'Authorization: Bearer <token>'
{
"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": "manual_operation",
"metadata": {
"command": "start"
}
},
{
"id": "507f1f77bcf86cd799439078",
"container_id": "507f1f77bcf86cd799439011",
"from_status": null,
"to_status": "stopped",
"transition_time": "2025-01-15T09:15:00.000Z",
"duration_ms": null,
"triggered_by": "container_creation",
"metadata": null
}
],
"pagination": {
"total": 15,
"page": 1,
"limit": 10,
"totalPages": 2
}
}
}

Performs a lifecycle operation on a container. The operation path segment selects the action: start, stop, force-stop, restart, pause, or resume. Each successful operation returns the container’s new status and a human-readable message describing the outcome.

NameInTypeRequiredDescription
idpathstringYesContainer ID
operationpathstringYesLifecycle operation to perform. One of: start, stop, force-stop, restart, pause, resume

The body is optional. When present, it may carry the following field:

NameTypeRequiredDescription
timeoutintegerNoUpper bound, in seconds, on how long the operation may run on the host before it is cut off. For stop and restart it is also the time the container is given to shut down cleanly. At most 600. Omit it for the server default.
{
"timeout": 120
}
Terminal window
curl -X POST 'https://api.hoody.com/api/v1/containers/{id}/start' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{"timeout": 120}'
{
"statusCode": 200,
"message": "Container operation completed successfully",
"data": {
"error": false,
"operation": "start",
"container_id": "507f1f77bcf86cd799439011",
"project_id": "507f1f77bcf86cd799439033",
"message": "Container started successfully",
"status": "running"
}
}