API Reference

Complete REST API documentation for SnapDeploy

Base URL: https://snapdeploy.dev/api

Authentication

All API requests require authentication using an API key.

curl -H "X-API-Key: your-api-key-here" \
https://snapdeploy.dev/api/containers

Get your API key from API Keys page in your dashboard

Containers

GET /api/containers

List all containers for the authenticated user.

Response (200 OK):
[
  {
    "containerId": "cont-abc123",
    "containerName": "my-app",
    "status": "RUNNING",
    "imageName": "nginx:latest",
    "cpu": "512",
    "memory": "1024",
    "createdAt": "2025-11-26T10:00:00Z"
  }
]
POST /api/containers/deploy

Deploy a new container from a Docker image.

Request Body:
{
  "imageName": "nginx:latest",
  "containerName": "my-app",
  "cpu": "512",
  "memory": "1024",
  "environmentVariables": {
    "PORT": "8080",
    "NODE_ENV": "production"
  }
}
Response (201 Created):
{
  "containerId": "cont-abc123",
  "status": "DEPLOYING",
  "message": "Container deployment started"
}
GET /api/containers/{containerId}

Get details of a specific container.

POST /api/containers/{containerId}/stop

Stop a running container.

DELETE /api/containers/{containerId}

Delete a container permanently.

Deployments

POST /api/deployments/github

Deploy directly from a GitHub repository.

Request Body:
{
  "repoUrl": "https://github.com/username/repo",
  "branch": "main",
  "containerName": "my-github-app",
  "buildCommand": "npm run build",
  "startCommand": "npm start"
}
GET /api/deployments

List all deployments with their status.

Logs

GET /api/logs/{containerId}

Retrieve container logs.

Query Parameters:
  • startTime - ISO 8601 timestamp
  • endTime - ISO 8601 timestamp
  • limit - Max number of log lines (default: 100)

Metrics

GET /api/metrics/{containerId}

Get performance metrics for a container.

Response:
{
  "cpu": {
    "current": 45.2,
    "average": 38.7,
    "max": 87.3
  },
  "memory": {
    "current": 512,
    "average": 478,
    "max": 1024
  },
  "network": {
    "bytesIn": 1048576,
    "bytesOut": 524288
  }
}

Error Codes

400
Bad Request
Invalid request parameters
401
Unauthorized
Invalid or missing API key
404
Not Found
Resource not found
429
Too Many Requests
Rate limit exceeded
500
Internal Server Error
Something went wrong on our end

Start Building with Our API

Get your API key and start deploying in minutes