> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloudblast.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Build on CloudBlast with the V2 REST API

# CloudBlast API

The CloudBlast API lets you manage your cloud infrastructure programmatically. Create servers, manage IP addresses, configure firewalls, and more — all through a simple REST interface.

## Base URL

```
https://console.cloudblast.io/api/v2
```

## Key Concepts

<CardGroup cols={2}>
  <Card title="Template Slugs" icon="layer-group">
    Templates are identified by **slugs** (e.g., `ubuntu-24.04`) instead of UUIDs. Slugs work across all nodes in a location — you don't need to know which node your server will land on.
  </Card>

  <Card title="Automatic Node Selection" icon="server">
    When creating a server, the API automatically selects the best node based on available resources, template availability, and IP availability.
  </Card>

  <Card title="Server Identification" icon="fingerprint">
    Servers can be identified by their full **UUID** (36 chars) or **short UUID** (8 chars) in all API endpoints.
  </Card>

  <Card title="Consistent Responses" icon="code">
    All responses use `{"data": ...}` for success and `{"error": {"code": "...", "message": "..."}}` for errors.
  </Card>
</CardGroup>

## Quick Start

1. **Get your API key** from [Account Settings](https://console.cloudblast.io/settings/api)
2. **Pick a location and template:**

```bash theme={null}
# List locations
curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://console.cloudblast.io/api/v2/locations

# List templates for a location
curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://console.cloudblast.io/api/v2/locations/1/templates
```

3. **Create a server:**

```bash theme={null}
curl -X POST https://console.cloudblast.io/api/v2/servers \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "plan_id": 1,
    "location_id": 1,
    "template_slug": "ubuntu-24.04",
    "hostname": "my-server.example.com"
  }'
```

The response includes the server details, root password, and IP addresses.

## Typical Workflow

```mermaid theme={null}
sequenceDiagram
    participant You
    participant API
    You->>API: GET /plans
    API-->>You: Available plans
    You->>API: GET /locations
    API-->>You: Available locations
    You->>API: GET /locations/1/templates
    API-->>You: Template slugs (ubuntu-24.04, debian-12, ...)
    You->>API: POST /servers
    API-->>You: Server details (installing...)
    You->>API: GET /servers/{uuid}/status
    API-->>You: { state: "running" }
```
