API Reference
RESTful API for programmatic infrastructure management
API Reference
The Fugoku API is a RESTful HTTP API for managing compute, storage, and networking resources programmatically.
Base URL
https://api.fugoku.com/v1All API requests must use HTTPS. HTTP requests will be rejected.
Authentication
Use Bearer token authentication with your API token.
Get API Token
Via Console: Account → API Credentials → Create New Token
Via CLI:
fugoku auth tokenMaking Authenticated Requests
Include token in Authorization header:
curl https://api.fugoku.com/v1/instances \
-H "Authorization: Bearer $FUGOKU_API_TOKEN"Security: Never commit tokens to version control. Use environment variables or secret management.
Rate Limits
- Authenticated requests: 1000 requests/hour
- Burst limit: 100 requests/minute
- Unauthenticated requests: 10 requests/hour (for public endpoints only)
Rate limit headers:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 987
X-RateLimit-Reset: 1646064000If rate limited, API returns 429 Too Many Requests.
Response Format
All responses are JSON.
Success response:
{
"data": {
"id": "inst-abc123",
"name": "web-1",
"status": "running"
},
"meta": {
"request_id": "req-xyz789"
}
}Error response:
{
"error": {
"code": "resource_not_found",
"message": "Instance 'web-1' not found",
"details": {
"resource_type": "instance",
"resource_id": "web-1"
}
},
"meta": {
"request_id": "req-xyz789"
}
}HTTP Status Codes
| Code | Meaning |
|---|---|
| 200 | OK - Request succeeded |
| 201 | Created - Resource created |
| 202 | Accepted - Request accepted, processing async |
| 204 | No Content - Request succeeded, no body |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Missing or invalid token |
| 403 | Forbidden - Valid token, insufficient permissions |
| 404 | Not Found - Resource doesn't exist |
| 409 | Conflict - Resource state conflict |
| 422 | Unprocessable Entity - Validation failed |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error - Server error |
| 503 | Service Unavailable - Temporary outage |
Pagination
List endpoints support pagination.
Request:
curl "https://api.fugoku.com/v1/instances?page=2&per_page=50" \
-H "Authorization: Bearer $FUGOKU_API_TOKEN"Response includes pagination meta:
{
"data": [ /* instances */ ],
"meta": {
"pagination": {
"page": 2,
"per_page": 50,
"total_pages": 5,
"total_count": 234
}
},
"links": {
"first": "https://api.fugoku.com/v1/instances?page=1",
"prev": "https://api.fugoku.com/v1/instances?page=1",
"next": "https://api.fugoku.com/v1/instances?page=3",
"last": "https://api.fugoku.com/v1/instances?page=5"
}
}Defaults:
page: 1per_page: 25 (max 100)
Compute Instances
List Instances
GET /v1/instancesQuery parameters:
region- Filter by regionstatus- Filter by status (running, stopped, provisioning)tag- Filter by tag
Example:
curl "https://api.fugoku.com/v1/instances?region=lagos-1&status=running" \
-H "Authorization: Bearer $FUGOKU_API_TOKEN"Get Instance
GET /v1/instances/:idExample:
curl https://api.fugoku.com/v1/instances/web-1 \
-H "Authorization: Bearer $FUGOKU_API_TOKEN"Response:
{
"data": {
"id": "inst-abc123",
"name": "web-1",
"region": "lagos-1",
"plan": "standard-2",
"image": "ubuntu-22.04",
"status": "running",
"public_ip": "102.89.45.178",
"private_ip": "10.10.0.5",
"created_at": "2024-02-25T10:30:00Z",
"tags": ["production", "web"],
"specs": {
"vcpu": 2,
"ram_gb": 4,
"disk_gb": 80
}
}
}Create Instance
POST /v1/instancesRequest body:
{
"name": "web-1",
"region": "lagos-1",
"plan": "standard-2",
"image": "ubuntu-22.04",
"ssh_keys": ["laptop"],
"tags": ["production"],
"user_data": "#cloud-config\n...",
"private_networks": ["backend-net"],
"backups": true
}Example:
curl -X POST https://api.fugoku.com/v1/instances \
-H "Authorization: Bearer $FUGOKU_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "web-1",
"region": "lagos-1",
"plan": "standard-2",
"image": "ubuntu-22.04"
}'Instance Actions
POST /v1/instances/:id/actionsActions:
start- Start stopped instancestop- Stop running instancereboot- Reboot instancerebuild- Reinstall OSresize- Change plan
Example (reboot):
curl -X POST https://api.fugoku.com/v1/instances/web-1/actions \
-H "Authorization: Bearer $FUGOKU_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"type": "reboot"}'Example (resize):
curl -X POST https://api.fugoku.com/v1/instances/web-1/actions \
-H "Authorization: Bearer $FUGOKU_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "resize",
"plan": "standard-4"
}'Delete Instance
DELETE /v1/instances/:idExample:
curl -X DELETE https://api.fugoku.com/v1/instances/web-1 \
-H "Authorization: Bearer $FUGOKU_API_TOKEN"Block Storage
List Volumes
GET /v1/volumesCreate Volume
POST /v1/volumesRequest body:
{
"name": "my-data",
"size_gb": 100,
"region": "lagos-1",
"snapshot_id": "snap-abc123" // optional
}Attach Volume
POST /v1/volumes/:id/attachRequest body:
{
"instance_id": "web-1"
}Detach Volume
POST /v1/volumes/:id/detachSnapshots
Create Snapshot
POST /v1/volumes/:volume_id/snapshotsRequest body:
{
"name": "before-upgrade"
}List Snapshots
GET /v1/snapshotsNetworking
Create Network
POST /v1/networksRequest body:
{
"name": "backend-net",
"subnet": "10.10.0.0/24",
"region": "lagos-1",
"dhcp_enabled": true
}Attach Instance to Network
POST /v1/networks/:id/attachRequest body:
{
"instance_id": "web-1"
}Create Floating IP
POST /v1/floating-ipsRequest body:
{
"region": "lagos-1"
}Assign Floating IP
POST /v1/floating-ips/:ip/assignRequest body:
{
"instance_id": "web-1"
}Load Balancers
Create Load Balancer
POST /v1/load-balancersRequest body:
{
"name": "api-lb",
"region": "lagos-1",
"algorithm": "round_robin",
"protocol": "http",
"port": 80,
"backend_port": 8080,
"health_check": {
"path": "/health",
"interval": 10,
"timeout": 5,
"unhealthy_threshold": 3
}
}Add Backend
POST /v1/load-balancers/:id/backendsRequest body:
{
"instance_id": "api-1",
"weight": 100
}Firewalls
List Rules
GET /v1/instances/:id/firewall/rulesAdd Rule
POST /v1/instances/:id/firewall/rulesRequest body:
{
"direction": "inbound",
"protocol": "tcp",
"port": 80,
"source": "0.0.0.0/0"
}Account & Billing
Get Account Info
GET /v1/accountGet Usage
GET /v1/account/usageQuery parameters:
start_date- ISO 8601 date (default: start of current month)end_date- ISO 8601 date (default: now)
Example:
curl "https://api.fugoku.com/v1/account/usage?start_date=2024-02-01&end_date=2024-02-29" \
-H "Authorization: Bearer $FUGOKU_API_TOKEN"Response:
{
"data": {
"period": {
"start": "2024-02-01T00:00:00Z",
"end": "2024-02-29T23:59:59Z"
},
"summary": {
"compute": 47.20,
"storage": 14.00,
"networking": 5.00,
"total": 66.20
},
"breakdown": {
"instances": [
{
"id": "inst-abc123",
"name": "web-1",
"hours": 720,
"cost": 12.00
}
],
"volumes": [ /* ... */ ],
"bandwidth": { /* ... */ }
}
}
}Webhooks
Receive notifications for events.
Coming Q3 2026.
Planned events:
- instance.created
- instance.deleted
- instance.started
- instance.stopped
- snapshot.completed
- snapshot.failed
SDKs
Official SDKs:
Node.js / TypeScript:
npm install @fugoku/sdkconst Fugoku = require('@fugoku/sdk');
const client = new Fugoku({ apiToken: process.env.FUGOKU_API_TOKEN });
async function createInstance() {
const instance = await client.instances.create({
name: 'web-1',
region: 'lagos-1',
plan: 'standard-2',
image: 'ubuntu-22.04'
});
console.log(`Created instance: ${instance.id}`);
}Python:
pip install fugokuimport fugoku
client = fugoku.Client(api_token=os.environ['FUGOKU_API_TOKEN'])
instance = client.instances.create(
name='web-1',
region='lagos-1',
plan='standard-2',
image='ubuntu-22.04'
)
print(f'Created instance: {instance.id}')Go:
go get github.com/fugoku/fugoku-goimport "github.com/fugoku/fugoku-go"
client := fugoku.NewClient(os.Getenv("FUGOKU_API_TOKEN"))
instance, err := client.Instances.Create(&fugoku.InstanceCreateRequest{
Name: "web-1",
Region: "lagos-1",
Plan: "standard-2",
Image: "ubuntu-22.04",
})Error Handling
Always check status codes and parse error responses.
Example (Node.js):
try {
const instance = await client.instances.create({ /* ... */ });
} catch (error) {
if (error.status === 422) {
console.error('Validation failed:', error.body.error.details);
} else if (error.status === 429) {
console.error('Rate limited, retry after:', error.headers['x-ratelimit-reset']);
} else {
console.error('API error:', error.body.error.message);
}
}Best Practices
- Use SDKs when available - Handle auth, retries, pagination automatically
- Store tokens securely - Environment variables, not code
- Implement exponential backoff - For 429 and 5xx errors
- Use webhook events - Instead of polling for status changes (when available)
- Validate input locally - Reduce API calls for validation errors
- Cache responses - When data doesn't change frequently
- Use request IDs - Include in support requests for debugging
Support
- API Issues: support@fugoku.com
- Feature Requests: GitHub Discussions
- Status: status.fugoku.com
Next Steps:
- Install the CLI for command-line access
- Use Terraform for infrastructure as code
- Read Getting Started for basics
- Explore Compute for instance types