API Reference

The Swiftdock daemon exposes a RESTful HTTP API for programmatic control of containers and images.

Base URL

http://localhost:8080

All endpoints are relative to this base URL.

Endpoints

GET /health

Description: Health check endpoint to verify the daemon is running.

Response

200 OK

OK

Example

curl http://localhost:8080/health
POST /images/pull

Description: Pull an OCI/Docker image from a registry.

Request Body

application/json

{
  "image": "alpine:latest"
}

Response

200 OK

OK

Example

curl -X POST http://localhost:8080/images/pull \
  -H "Content-Type: application/json" \
  -d '{"image": "alpine:latest"}'
POST /containers/create

Description: Create a new container from an image.

Request Body

application/json

{
  "image": "alpine:latest",
  "command": ["echo", "Hello World"]
}

Response

200 OK

{
  "id": "6B53E52E-B2EC-435D-B957-B5202C1E5677",
  "image": "alpine:latest",
  "status": "created",
  "pid": null
}

Example

curl -X POST http://localhost:8080/containers/create \
  -H "Content-Type: application/json" \
  -d '{"image": "alpine:latest", "command": ["echo", "Hello"]}'
POST /containers/:id/start

Description: Start a created container.

Path Parameters

Response

200 OK

{
  "pid": 85965
}

Example

curl -X POST http://localhost:8080/containers/6B53E52E-B2EC-435D-B957-B5202C1E5677/start
GET /containers

Description: List all containers.

Response

200 OK

[
  {
    "id": "6B53E52E-B2EC-435D-B957-B5202C1E5677",
    "image": "alpine:latest",
    "status": "exited",
    "pid": 85965
  },
  {
    "id": "2DF48833-0B9F-466C-938E-741F47F72B09",
    "image": "alpine:latest",
    "status": "created",
    "pid": null
  }
]

Example

curl http://localhost:8080/containers
GET /containers/:id/logs

Description: Get stdout/stderr logs from a container.

Path Parameters

Response

200 OK

Hello World

Example

curl http://localhost:8080/containers/6B53E52E-B2EC-435D-B957-B5202C1E5677/logs

Error Handling

The API returns standard HTTP status codes:

Content Type

All requests and responses use application/json unless otherwise specified.