Skip to main content

Start Container

POST /api/containers/{id}/start?env=1
Starts a stopped container.

Path Parameters

id
string
required
The container ID or name to start

Query Parameters

env
string
required
The environment ID where the container is located

Response

success
boolean
Whether the container was successfully started

Error Responses

error
string
Error message if the request fails
Status Codes:
  • 200 - Container started successfully
  • 403 - Permission denied or environment access denied
  • 500 - Failed to start container

Example

curl -X POST "https://your-dockhand.com/api/containers/abc123def456/start?env=1" \
  -H "Cookie: session=your-session-cookie"

Response Example

{
  "success": true
}

Stop Container

POST /api/containers/{id}/stop?env=1
Stops a running container by sending SIGTERM and then SIGKILL after a grace period.

Path Parameters

id
string
required
The container ID or name to stop

Query Parameters

env
string
required
The environment ID where the container is located

Response

success
boolean
Whether the container was successfully stopped

Error Responses

error
string
Error message if the request fails
Status Codes:
  • 200 - Container stopped successfully
  • 403 - Permission denied or environment access denied
  • 500 - Failed to stop container

Example

curl -X POST "https://your-dockhand.com/api/containers/abc123def456/stop?env=1" \
  -H "Cookie: session=your-session-cookie"

Response Example

{
  "success": true
}

Restart Container

POST /api/containers/{id}/restart?env=1
Restarts a container. This is equivalent to stopping and then starting the container.

Path Parameters

id
string
required
The container ID or name to restart

Query Parameters

env
string
required
The environment ID where the container is located

Response

success
boolean
Whether the container was successfully restarted

Error Responses

error
string
Error message if the request fails
Status Codes:
  • 200 - Container restarted successfully
  • 403 - Permission denied or environment access denied
  • 500 - Failed to restart container

Example

curl -X POST "https://your-dockhand.com/api/containers/abc123def456/restart?env=1" \
  -H "Cookie: session=your-session-cookie"

Response Example

{
  "success": true
}

Pause Container

POST /api/containers/{id}/pause?env=1
Pauses all processes within a container using cgroups freezer. The container continues to exist and hold its resources, but all processes are suspended.

Path Parameters

id
string
required
The container ID or name to pause

Query Parameters

env
string
required
The environment ID where the container is located

Response

success
boolean
Whether the container was successfully paused

Error Responses

error
string
Error message if the request fails
Status Codes:
  • 200 - Container paused successfully
  • 403 - Permission denied (requires ‘stop’ permission)
  • 500 - Failed to pause container

Example

curl -X POST "https://your-dockhand.com/api/containers/abc123def456/pause?env=1" \
  -H "Cookie: session=your-session-cookie"

Response Example

{
  "success": true
}

Unpause Container

POST /api/containers/{id}/unpause?env=1
Resumes all processes that were previously paused in a container.

Path Parameters

id
string
required
The container ID or name to unpause

Query Parameters

env
string
required
The environment ID where the container is located

Response

success
boolean
Whether the container was successfully unpaused

Error Responses

error
string
Error message if the request fails
Status Codes:
  • 200 - Container unpaused successfully
  • 403 - Permission denied (requires ‘start’ permission)
  • 500 - Failed to unpause container

Example

curl -X POST "https://your-dockhand.com/api/containers/abc123def456/unpause?env=1" \
  -H "Cookie: session=your-session-cookie"

Response Example

{
  "success": true
}

Build docs developers (and LLMs) love