Server API Documentation

Complete server infrastructure management API for deploying, scaling, and monitoring your applications with enterprise-grade reliability and security.

Overview

The Webburns Tech Server API provides comprehensive control over your server infrastructure, allowing you to deploy, scale, monitor, and manage applications with enterprise-grade reliability and security.

Base URL: https://api.webburnstech.com/server/v1/

GraphQL Endpoint: https://api.webburnstech.com/server/graphql

Current Version: v1.3.5

Format: REST and GraphQL APIs available

API Types

REST API

Traditional RESTful API with predictable resource-oriented URLs, JSON requests/responses, and standard HTTP methods.

HTTP Methods 6

GraphQL API

Flexible GraphQL API allowing you to request exactly the data you need in a single query.

Queries 25+

Getting Started

To start using the Server API, you'll need an API key with appropriate permissions. You can obtain one from the API Keys page.

All API requests must include your API key in the request header:

Authorization: Bearer YOUR_API_KEY

Authentication

All API requests require authentication using an API key with appropriate permissions. We support both API key authentication and OAuth 2.0 for more advanced use cases.

POST /auth/token

Authenticate and receive an access token for API requests.

Request Parameters

Parameter Type Required Description
api_key string Yes Your API key (for API key authentication)
client_id string No OAuth 2.0 client ID
client_secret string No OAuth 2.0 client secret
grant_type string No OAuth 2.0 grant type

Code Examples

curl -X POST "https://api.webburnstech.com/server/v1/auth/token" \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "YOUR_API_KEY"
  }'
import requests

url = "https://api.webburnstech.com/server/v1/auth/token"
data = {
    "api_key": "YOUR_API_KEY"
}

response = requests.post(url, json=data)
print(response.json())
const fetch = require('node-fetch');

const url = 'https://api.webburnstech.com/server/v1/auth/token';
const data = {
    api_key: 'YOUR_API_KEY'
};

fetch(url, {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
const url = 'https://api.webburnstech.com/server/v1/auth/token';
const data = {
    api_key: 'YOUR_API_KEY'
};

fetch(url, {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

Response Example

{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "servers:read servers:write deployments:create",
  "account": {
    "id": "acc_123456",
    "name": "John Doe",
    "plan": "enterprise"
  }
}

Rate Limits

To ensure fair usage and system stability, the Server API implements rate limits based on your subscription plan and the type of operation being performed.

Plan Read Requests/Min Write Requests/Min Deployment Requests/Hour WebSocket Connections
Starter 60 20 10 5
Professional 300 100 50 25
Enterprise 1,000 500 200 100
Custom Custom Custom Custom Custom

Rate limit headers are included in every response:

  • X-RateLimit-Limit: Your request limit per minute
  • X-RateLimit-Remaining: Remaining requests in the current window
  • X-RateLimit-Reset: Time when the rate limit resets (UTC timestamp)
  • X-RateLimit-Type: Type of rate limit (read, write, deployment)

Server Access & Security

Our Server API provides comprehensive security features to protect your infrastructure, including SSH key management, firewall rules, and SSL certificate automation.

POST /servers/{id}/firewall/rules

Add a new firewall rule to a specific server.

Path Parameters

Parameter Type Required Description
id string Yes Server ID

Request Body

Parameter Type Required Description
direction string Yes Direction of traffic (inbound/outbound)
protocol string Yes Protocol (tcp, udp, icmp)
port string Yes Port or port range (e.g., "80" or "8000-8080")
source string Yes Source IP or CIDR (for inbound) or destination (for outbound)
action string Yes Action to take (allow/deny)

Code Examples

curl -X POST "https://api.webburnstech.com/server/v1/servers/srv_123456/firewall/rules" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "direction": "inbound",
    "protocol": "tcp",
    "port": "443",
    "source": "0.0.0.0/0",
    "action": "allow"
  }'
import requests

url = "https://api.webburnstech.com/server/v1/servers/srv_123456/firewall/rules"
headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Content-Type": "application/json"
}
data = {
    "direction": "inbound",
    "protocol": "tcp",
    "port": "443",
    "source": "0.0.0.0/0",
    "action": "allow"
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
const fetch = require('node-fetch');

const url = 'https://api.webburnstech.com/server/v1/servers/srv_123456/firewall/rules';
const headers = {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
    'Content-Type': 'application/json'
};
const data = {
    direction: 'inbound',
    protocol: 'tcp',
    port: '443',
    source: '0.0.0.0/0',
    action: 'allow'
};

fetch(url, {
    method: 'POST',
    headers: headers,
    body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
const url = 'https://api.webburnstech.com/server/v1/servers/srv_123456/firewall/rules';
const headers = {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
    'Content-Type': 'application/json'
};
const data = {
    direction: 'inbound',
    protocol: 'tcp',
    port: '443',
    source: '0.0.0.0/0',
    action: 'allow'
};

fetch(url, {
    method: 'POST',
    headers: headers,
    body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

REST API

Our REST API follows standard RESTful principles with resource-oriented URLs, standard HTTP methods, and JSON request/response formats.

Server Management Endpoints

GET /servers

List all servers in your account with optional filtering and pagination.

Query Parameters

Parameter Type Required Description
page integer No Page number for pagination (default: 1)
per_page integer No Number of items per page (default: 20, max: 100)
status string No Filter by server status (active, stopped, pending, error)
region string No Filter by server region
POST /servers

Create a new server with the specified configuration.

Request Body

Parameter Type Required Description
name string Yes Server name
region string Yes Server region
plan string Yes Server plan/size
image string Yes Operating system image
ssh_keys array No Array of SSH key IDs to add to the server
user_data string No Cloud-init script for server initialization
GET /servers/{id}

Get detailed information about a specific server.

Path Parameters

Parameter Type Required Description
id string Yes Server ID
PUT /servers/{id}

Update a server's configuration or metadata.

Path Parameters

Parameter Type Required Description
id string Yes Server ID

Request Body

Parameter Type Required Description
name string No New server name
tags array No Array of tags for the server
DELETE /servers/{id}

Delete a server and all associated resources.

Path Parameters

Parameter Type Required Description
id string Yes Server ID

GraphQL API

Our GraphQL API allows you to request exactly the data you need in a single query, reducing over-fetching and improving performance for complex data requirements.

POST /graphql

Execute GraphQL queries and mutations against the Server API.

Request Body

Parameter Type Required Description
query string Yes GraphQL query string
variables object No Variables for the GraphQL query
operationName string No Name of the operation if query contains multiple operations

Code Examples

curl -X POST "https://api.webburnstech.com/server/graphql" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query { servers { id name status region plan { name memory vcpus disk } } }"
  }'
import requests

url = "https://api.webburnstech.com/server/graphql"
headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Content-Type": "application/json"
}
query = """
query {
  servers {
    id
    name
    status
    region
    plan {
      name
      memory
      vcpus
      disk
    }
  }
}
"""

response = requests.post(url, headers=headers, json={"query": query})
print(response.json())
const fetch = require('node-fetch');

const url = 'https://api.webburnstech.com/server/graphql';
const headers = {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
    'Content-Type': 'application/json'
};
const query = `
query {
  servers {
    id
    name
    status
    region
    plan {
      name
      memory
      vcpus
      disk
    }
  }
}
`;

fetch(url, {
    method: 'POST',
    headers: headers,
    body: JSON.stringify({ query })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
const url = 'https://api.webburnstech.com/server/graphql';
const headers = {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
    'Content-Type': 'application/json'
};
const query = `
query {
  servers {
    id
    name
    status
    region
    plan {
      name
      memory
      vcpus
      disk
    }
  }
}
`;

fetch(url, {
    method: 'POST',
    headers: headers,
    body: JSON.stringify({ query })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

Response Example

{
  "data": {
    "servers": [
      {
        "id": "srv_123456",
        "name": "web-server-1",
        "status": "active",
        "region": "us-east-1",
        "plan": {
          "name": "professional-2x",
          "memory": 8192,
          "vcpus": 4,
          "disk": 160
        }
      },
      {
        "id": "srv_789012",
        "name": "db-server-1",
        "status": "active",
        "region": "us-east-1",
        "plan": {
          "name": "enterprise-4x",
          "memory": 16384,
          "vcpus": 8,
          "disk": 320
        }
      }
    ]
  }
}

Server Management

Manage your server instances with actions like starting, stopping, rebooting, and resizing.

Web Server Cluster

Production web servers with load balancing

Active
4 vCPUs 8GB RAM

Database Server

Primary database with replication

Active
8 vCPUs 16GB RAM

Staging Server

Testing environment

Stopped
2 vCPUs 4GB RAM

Backup Server

Automated backups storage

Pending
4 vCPUs 8GB RAM
POST /servers/{id}/actions

Execute an action on a server (start, stop, reboot, resize, etc.).

Path Parameters

Parameter Type Required Description
id string Yes Server ID

Request Body

Parameter Type Required Description
type string Yes Action type (start, stop, reboot, resize, snapshot, etc.)
plan string No New plan for resize action

Monitoring & Logs

Monitor your server performance and access logs for debugging and optimization.

GET /servers/{id}/metrics

Retrieve server performance metrics (CPU, memory, disk, network).

Path Parameters

Parameter Type Required Description
id string Yes Server ID

Query Parameters

Parameter Type Required Description
metric string Yes Metric type (cpu, memory, disk, network)
start string Yes Start time (ISO 8601 format)
end string Yes End time (ISO 8601 format)
step string No Step size (e.g., "1m", "5m", "1h")

Deployment

Deploy your applications to servers with automated build processes and zero-downtime deployments.

POST /deployments

Create a new deployment for an application.

Request Body

Parameter Type Required Description
app_id string Yes Application ID
branch string Yes Git branch to deploy
environment string Yes Deployment environment (staging, production)
strategy string No Deployment strategy (rolling, blue-green, canary)

Error Handling

The Server API uses conventional HTTP response codes to indicate the success or failure of requests.

Code Name Description
200 OK Request succeeded
201 Created Resource created successfully
202 Accepted Request accepted for processing
204 No Content Request succeeded, no content to return
400 Bad Request Invalid request parameters
401 Unauthorized Authentication failed
403 Forbidden Insufficient permissions
404 Not Found Resource not found
429 Too Many Requests Rate limit exceeded
500 Internal Server Error Server encountered an error
502 Bad Gateway Invalid response from upstream server
503 Service Unavailable Service temporarily unavailable

Error Response Format

All error responses follow the same format:

{
  "error": {
    "code": "invalid_request",
    "message": "The request was invalid",
    "details": {
      "field": "name",
      "issue": "required field missing"
    },
    "request_id": "req_123456789",
    "documentation_url": "https://docs.webburnstech.com/errors/invalid_request"
  }
}