API Documentation
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.shAuthentication Header
Authorization: Bearer YOUR_API_KEYContent Type
Content-Type: application/jsonContainers API
Create Container
POST
/api/containersCreate 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}/stopStop a running container.
Response
{
"status": "success"
}Container Logs
GET
/api/containers/{id}/logsGet logs from a container.
Response
{
"text": "Container log output here..."
}Container Ports
GET
/api/containers/{id}/portsGet port mappings for a container.
Response
[
{
"containerPort": 3000,
"hostPort": 8080,
"protocol": "tcp"
}
]Scripts API
Create Script
POST
/api/scriptsCreate 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}/runExecute a script in a containerized environment.
Response
{
"status": "success"
}Stop Script
POST
/api/scripts/{id}/stopStop a running script.
Response
{
"status": "success"
}Script Logs
GET
/api/scripts/{id}/logsGet logs from a script execution.
Response
{
"text": "Script execution logs here..."
}