Docksmith exposes a REST API at /api/.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/health |
Server health check |
| GET | /api/status |
System status with last check time |
| GET | /api/docker-config |
Docker configuration info |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/check |
Check all containers (clears cache) |
| POST | /api/trigger-check |
Background check (uses cache) |
| GET | /api/container/{name}/recheck |
Recheck single container |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/update |
Update single container |
| POST | /api/update/batch |
Batch update multiple containers |
| POST | /api/rollback |
Rollback to previous version |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/operations |
List operations with filtering |
| GET | /api/operations/{id} |
Get operation by ID |
| GET | /api/history |
Check and update history |
| GET | /api/policies |
Get rollback policies |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/restart |
Restart container (name in body) |
| POST | /api/restart/container/{name} |
Restart container by name |
| POST | /api/restart/stack/{name} |
Restart entire stack |
| POST | /api/restart/start/{name} |
SSE-based restart with progress |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/labels/{container} |
Get container labels |
| POST | /api/labels/set |
Set labels (restarts container) |
| POST | /api/labels/remove |
Remove labels (restarts container) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/scripts |
List available scripts |
| GET | /api/scripts/assigned |
List script assignments |
| POST | /api/scripts/assign |
Assign script to container |
| DELETE | /api/scripts/assign/{container} |
Remove assignment |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/registry/tags/{image} |
Get tags for image |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/events |
SSE stream for real-time updates |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/explorer |
Get all Docker resources (containers, images, networks, volumes) |
| GET | /api/images |
List all images |
| GET | /api/networks |
List all networks |
| GET | /api/volumes |
List all volumes |
| DELETE | /api/images/{id} |
Remove an image |
| DELETE | /api/networks/{id} |
Remove a network |
| DELETE | /api/volumes/{name} |
Remove a volume |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/fix-compose-mismatch/{name} |
Fix container where running image differs from compose file |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/containers/{name}/logs |
Get container logs |
| GET | /api/containers/{name}/inspect |
Inspect container details |
| GET | /api/containers/{name}/stats |
Get container resource stats |
| POST | /api/containers/{name}/stop |
Stop a container |
| POST | /api/containers/{name}/start |
Start a container |
| POST | /api/containers/{name}/restart |
Restart a container |
| DELETE | /api/containers/{name} |
Remove a container |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/prune/containers |
Remove stopped containers |
| POST | /api/prune/images |
Remove unused images |
| POST | /api/prune/networks |
Remove unused networks |
| POST | /api/prune/volumes |
Remove unused volumes |
| POST | /api/prune/system |
Remove all unused resources |
Returns server health status.
curl http://localhost:3000/api/healthResponse:
{
"status": "ok",
"version": "1.0.0"
}Returns system status including last check time. Used by Homepage widget.
curl http://localhost:3000/api/statusResponse:
{
"data": {
"total_checked": 25,
"updates_found": 3,
"last_cache_refresh": "2024-01-15T10:30:00Z",
"last_background_run": "2024-01-15T10:30:00Z"
}
}Discovers containers and checks for updates. Clears registry cache.
curl http://localhost:3000/api/checkResponse:
{
"data": {
"containers": [
{
"name": "nginx",
"stack": "web",
"image": "nginx:1.24.0",
"current_version": "1.24.0",
"latest_version": "1.25.3",
"status": "UPDATE_AVAILABLE",
"update_available": true,
"labels": {
"docksmith.version-pin-major": "false"
}
}
],
"total": 25,
"updates_available": 3
}
}| Status | Description |
|---|---|
UP_TO_DATE |
Container is running the latest version |
UP_TO_DATE_PINNABLE |
Container uses latest tag, can be pinned to specific version |
UPDATE_AVAILABLE |
Newer version available |
UPDATE_AVAILABLE_BLOCKED |
Update available but blocked by pre-update check |
COMPOSE_MISMATCH |
Running image differs from compose file specification |
LOCAL_IMAGE |
Container uses locally built image (no registry) |
IGNORED |
Container is ignored via docksmith.ignore label |
ERROR |
Error checking container status |
When a container has status: "COMPOSE_MISMATCH", the response includes additional fields:
{
"name": "myapp",
"status": "COMPOSE_MISMATCH",
"image": "nginx:1.24.0",
"compose_image": "nginx:1.25.0",
"error": "Running image (nginx:1.24.0) differs from compose specification (nginx:1.25.0)"
}image— The image currently runningcompose_image— The image specified in the compose fileerror— Human-readable description of the mismatch
Use POST /api/fix-compose-mismatch/{name} to sync the container to the compose file specification.
Recheck a single container for updates. Useful after changing labels.
curl http://localhost:3000/api/container/nginx/recheckResponse:
{
"data": {
"name": "nginx",
"current_version": "1.24.0",
"latest_version": "1.25.3",
"update_available": true
}
}Update a single container.
curl -X POST http://localhost:3000/api/update \
-H "Content-Type: application/json" \
-d '{"container":"nginx"}'With specific version:
curl -X POST http://localhost:3000/api/update \
-H "Content-Type: application/json" \
-d '{"container":"nginx","version":"1.25.0"}'With script override:
curl -X POST http://localhost:3000/api/update \
-H "Content-Type: application/json" \
-d '{"container":"nginx","script":"/scripts/check.sh"}'Response:
{
"data": {
"operation_id": "op_2024011510302345",
"container": "nginx",
"status": "started"
}
}Update multiple containers.
curl -X POST http://localhost:3000/api/update/batch \
-H "Content-Type: application/json" \
-d '{"containers":["nginx","redis","postgres"]}'Rollback a previous update.
curl -X POST http://localhost:3000/api/rollback \
-H "Content-Type: application/json" \
-d '{"operation_id":"op_2024011510302345"}'Fix a container where the running image doesn't match the compose file specification. This can happen when:
- The compose file was edited but the container wasn't recreated
- The container lost its tag reference and is running with a bare SHA digest
The operation will:
- Pull the image specified in the compose file
- Recreate the container with
docker compose up -d
curl -X POST http://localhost:3000/api/fix-compose-mismatch/mycontainerResponse:
{
"success": true,
"data": {
"operation_id": "op_2024011510302345"
}
}Error response (e.g., container uses build: instead of image:):
{
"success": false,
"error": "failed to extract image from compose file: no image key found for service mycontainer"
}Note: This endpoint only works for containers that use image: in their compose file. Containers using build: cannot be fixed this way - they need to be rebuilt manually.
List operations with optional filtering.
# All operations
curl http://localhost:3000/api/operations
# Filter by container
curl "http://localhost:3000/api/operations?container=nginx"
# Filter by status
curl "http://localhost:3000/api/operations?status=complete"
# Filter by type
curl "http://localhost:3000/api/operations?type=update"
# Limit results
curl "http://localhost:3000/api/operations?limit=10"Response:
{
"data": [
{
"operation_id": "op_2024011510302345",
"container_name": "nginx",
"stack_name": "web",
"operation_type": "update",
"status": "complete",
"old_version": "1.24.0",
"new_version": "1.25.3",
"started_at": "2024-01-15T10:30:23Z",
"completed_at": "2024-01-15T10:31:45Z"
}
]
}Get rollback policies for containers.
curl http://localhost:3000/api/policiesResponse:
{
"data": {
"containers": {
"nginx": {
"can_rollback": true,
"last_operation_id": "op_2024011510302345",
"old_version": "1.24.0"
}
}
}
}Set labels on a container. Updates compose file and restarts container.
curl -X POST http://localhost:3000/api/labels/set \
-H "Content-Type: application/json" \
-d '{
"container": "nginx",
"labels": {
"docksmith.version-pin-major": "true",
"docksmith.ignore": "false"
}
}'Remove labels from a container.
curl -X POST http://localhost:3000/api/labels/remove \
-H "Content-Type: application/json" \
-d '{
"container": "nginx",
"labels": ["docksmith.ignore"]
}'Server-Sent Events stream for real-time updates.
curl -N http://localhost:3000/api/eventsEvent types:
update.progress— Update stage changescontainer.updated— Update completedcheck.progress— Background check progressrestart.progress— Restart operation progresscontainer.stopped— Container stoppedcontainer.removed— Container removed
Event format:
data: {"type":"update.progress","payload":{"container":"nginx","stage":"pulling_image","progress":50,"message":"Pulling nginx:1.25.3"}}
Get available tags for an image. Useful for testing regex patterns.
curl http://localhost:3000/api/registry/tags/nginx
curl http://localhost:3000/api/registry/tags/ghcr.io/linuxserver/plexResponse:
{
"data": {
"image_ref": "nginx",
"tags": ["1.25.3", "1.25.2", "1.25.1", "1.24.0", "latest", "alpine"],
"count": 6
}
}Get all Docker resources in one call.
curl http://localhost:3000/api/explorerResponse:
{
"data": {
"containers": [...],
"images": [...],
"networks": [...],
"volumes": [...]
}
}Get container logs.
# Get last 100 lines
curl "http://localhost:3000/api/containers/nginx/logs?tail=100"
# Get logs since timestamp
curl "http://localhost:3000/api/containers/nginx/logs?since=2024-01-15T10:00:00Z"Response:
{
"data": {
"logs": "2024-01-15 10:30:00 [notice] nginx started..."
}
}Get container resource statistics.
curl http://localhost:3000/api/containers/nginx/statsResponse:
{
"data": {
"cpu_percent": 2.5,
"memory_usage": 52428800,
"memory_limit": 1073741824,
"memory_percent": 4.88,
"network_rx": 1048576,
"network_tx": 524288
}
}Stop a running container.
curl -X POST http://localhost:3000/api/containers/nginx/stopStart a stopped container.
curl -X POST http://localhost:3000/api/containers/nginx/startRemove a container.
# Remove stopped container
curl -X DELETE http://localhost:3000/api/containers/nginx
# Force remove running container
curl -X DELETE "http://localhost:3000/api/containers/nginx?force=true"Remove all unused Docker resources.
curl -X POST http://localhost:3000/api/prune/systemResponse:
{
"data": {
"containers_deleted": 3,
"images_deleted": 5,
"networks_deleted": 2,
"volumes_deleted": 1,
"space_reclaimed": 1073741824
}
}All endpoints return errors in a consistent format:
{
"error": {
"message": "Container not found: nginx",
"code": "NOT_FOUND"
}
}HTTP status codes:
200— Success400— Bad request (invalid parameters)404— Not found429— Rate limited500— Server error
Docksmith has no built-in authentication. Deploy behind an authenticating reverse proxy for production use.
See integrations.md for reverse proxy examples.