API Reference

Complete RESTful API documentation with code examples and interactive testing.

Current Version: v2.0

Authentication

The Host.com API uses Bearer token authentication. Include your API token in the Authorization header of each request.

API Token

Generate an API token from your account dashboard under API Settings.

Example Request
curl -X GET "https://api.host.com/v2/servers" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Keep Your Token Safe

Never share your API token or commit it to version control. Rotate tokens regularly for security.

Servers

List All Servers

GET

Retrieve a list of all servers in your account.

GET https://api.host.com/v2/servers

Response Example

{
  "servers": [
    {
      "id": "srv-abc123",
      "name": "web-server-01",
      "status": "running",
      "ipv4": "192.168.1.100",
      "region": "us-east-1",
      "size": "standard-vps",
      "created_at": "2024-01-15T10:30:00Z"
    }
  ],
  "meta": {
    "total": 1
  }
}

Create Server

POST

Create a new cloud server.

POST https://api.host.com/v2/servers

Request Body

{
  "name": "my-server",
  "region": "us-east-1",
  "size": "standard-vps",
  "image": "ubuntu-22-04",
  "ssh_keys": ["ssh-key-123"]
}

Delete Server

DELETE

Permanently delete a server.

DELETE https://api.host.com/v2/servers/{server_id}

⚠️ This action is irreversible. All data on the server will be lost.

Snapshots

Create Snapshot

POST

Create a point-in-time snapshot of a server.

POST https://api.host.com/v2/servers/{server_id}/snapshots

Request Body

{
  "name": "backup-2024-01-15"
}

Rate Limits

5,000

Requests per hour

100

Requests per minute

429

Rate limit error code

Official SDKs & Libraries

Node.js

npm install @hostcom/sdk

Python

pip install hostcom-sdk

Go

go get github.com/hostcom/sdk

PHP

composer require hostcom/sdk

Ready to Get Started?

Generate your API token and start building with Host.com today.