API Documentation

Complete API reference for BLAZED.sh - Deploy containers and scripts on our Web3 PaaS platform.

Authentication

API Key Authentication
All API requests require authentication using your API key.

Base URL

https://blazed.sh

Authentication Header

Authorization: Bearer YOUR_API_KEY

Content Type

Content-Type: application/json

Containers API

Create Container

POST
/api/containers
Create a new container.

Request Body

{
  "name": "my-app",
  "image": "nginx:latest",
  "env": "NODE_ENV=production\nPORT=3000",
  "ports": "3000:8080/tcp",
  "cmd": "/bin/bash -c 'nginx -g daemon off;'",
  "tty": true
}

Response

{
  "id": "RECORD_ID",
  "name": "my-app",
  "image": "nginx:latest",
  "env": "NODE_ENV=production\nPORT=3000",
  "ports": "3000:8080/tcp",
  "cmd": "/bin/bash -c 'nginx -g daemon off;'",
  "tty": true,
  "owner": "USER_ID",
  "created": "2025-01-19T10:30:00.000Z",
  "updated": "2025-01-19T10:30:00.000Z"
}

Stop Container

POST
/api/containers/{id}/stop
Stop a running container.

Response

{
  "status": "success"
}

Container Logs

GET
/api/containers/{id}/logs
Get logs from a container.

Response

{
  "text": "Container log output here..."
}

Container Ports

GET
/api/containers/{id}/ports
Get port mappings for a container.

Response

[
  {
    "containerPort": 3000,
    "hostPort": 8080,
    "protocol": "tcp"
  }
]

Scripts API

Create Script

POST
/api/scripts
Create a new script.

Request Body

{
  "name": "my-script",
  "code": "console.log('Hello from BLAZED.sh!');"
}

Response

{
  "id": "RECORD_ID",
  "name": "my-script",
  "code": "console.log('Hello from BLAZED.sh!');",
  "owner": "USER_ID",
  "created": "2025-01-19T10:30:00.000Z",
  "updated": "2025-01-19T10:30:00.000Z"
}

Update Script

POST
/api/scripts/{id}
Update the name and/or code of an existing script.

Request Body

{
  "name": "updated-script-name",
  "code": "console.log('Updated script code!');"
}

Response

{
  "id": "RECORD_ID",
  "name": "updated-script-name",
  "code": "console.log('Updated script code!');",
  "owner": "USER_ID",
  "created": "2025-01-19T10:30:00.000Z",
  "updated": "2025-01-19T10:35:00.000Z"
}

Run Script

POST
/api/scripts/{id}/run
Execute a script in a containerized environment.

Response

{
  "status": "success"
}

Stop Script

POST
/api/scripts/{id}/stop
Stop a running script.

Response

{
  "status": "success"
}

Script Logs

GET
/api/scripts/{id}/logs
Get logs from a script execution.

Response

{
  "text": "Script execution logs here..."
}