---
title: "API reference"
description: "The Edge Network REST API: authentication, Compute, CDN, DNS and Storage endpoints, error handling, rate limiting, pagination and example requests."
url: "https://edge.network/academy/api-reference"
category: "API & SDKs"
readingTime: "3 min"
level: "intermediate"
---

# API reference

Edge exposes a REST API for Compute, CDN, DNS, Storage and Shield. Use it to automate deployments, manage resources and integrate with your tooling.

## Base URL and architecture

The Edge API is served at `https://api.edge.network`. All requests use REST over HTTPS. Edge does not provide a GraphQL endpoint. Use the REST API for all programmatic access to Compute, CDN and DNS.

For **Storage**, Edge uses S3-compatible object storage. Storage is accessed via `https://storage.edge.network` using the AWS S3 API, not the REST API above. See the [JavaScript SDK](/academy/sdk-javascript), [Python SDK](/academy/sdk-python) or [Go SDK](/academy/sdk-go) articles for storage integration.

## Authentication

Authenticate with a **Bearer token** using your API key. Pass it in the `Authorization` header:

```http
Authorization: Bearer ek_live_xxxxxxxxxxxxxxxxxxxxxxxx
```

API keys follow the format `ek_live_...` for production. Generate keys in **Console → Settings → API Keys**. Never expose API keys in client-side code or public repositories.

## Common headers and response format

Include `Content-Type: application/json` for request bodies, and expect `application/json` in responses.

Successful responses return the requested data directly or wrapped in a standard envelope. For example, a list response:

```json
{
  "data": [...],
  "meta": {
    "total": 42,
    "page": 1,
    "per_page": 20
  }
}
```

## Error handling

Errors return appropriate HTTP status codes (e.g. `400` for bad request, `401` for unauthorised, `404` for not found, `429` for rate limiting) and a JSON body with an error code and message:

```json
{
  "error": {
    "code": "validation_error",
    "message": "Invalid VM configuration"
  }
}
```

Handle errors by checking the HTTP status and parsing the `error` object for retry logic or user-facing messages.

## Rate limiting and pagination

The API is rate limited per account. When you exceed the limit, you receive HTTP `429`, with a `Retry-After` header indicating when to retry. Implement exponential backoff for production clients.

List endpoints support pagination via the `page` and `per_page` query parameters.

## Resource endpoints

### Compute

| Method | Path | Action |
|---|---|---|
| `GET` | `/api/compute/vms` | List VMs |
| `POST` | `/api/compute/vms` | Create a VM |
| `GET` | `/api/compute/vms/:id` | Get a VM |
| `DELETE` | `/api/compute/vms/:id` | Delete a VM |
| `POST` | `/api/compute/vms/:id/power` | Power on/off |

### CDN

| Method | Path | Action |
|---|---|---|
| `GET` | `/api/cdn/deployments` | List deployments |
| `POST` | `/api/cdn/deployments` | Create a deployment |
| `GET` | `/api/cdn/deployments/:id/domains` | List domains |
| `POST` | `/api/cdn/deployments/:id/purge` | Purge cache |

### DNS

| Method | Path | Action |
|---|---|---|
| `GET` | `/api/dns/zones` | List zones |
| `POST` | `/api/dns/zones` | Create a zone |
| `GET` | `/api/dns/zones/:id/records` | List records |
| `POST` | `/api/dns/zones/:id/records` | Create a record |
| `PUT` | `/api/dns/zones/:id/records/:recordId` | Update a record |
| `DELETE` | `/api/dns/zones/:id/records/:recordId` | Delete a record |

### Storage

| Method | Path | Action |
|---|---|---|
| `GET` | `/api/storage/buckets` | List buckets |
| `POST` | `/api/storage/buckets` | Create a bucket |
| `GET` | `/api/storage/buckets/:bucket/objects` | List objects |

Presigned URLs are generated via the Storage API or an S3 SDK. For object operations, use the S3-compatible API at `https://storage.edge.network` with the AWS S3 SDKs.

## Example requests

### List VMs

```bash
curl -X GET "https://api.edge.network/api/compute/vms" \
  -H "Authorization: Bearer ek_live_xxx"
```

Response:

```json
{
  "data": [
    { "id": "vm_123", "name": "web-1", "status": "running" }
  ],
  "meta": { "total": 1, "page": 1, "per_page": 20 }
}
```

### Create a CDN deployment

```bash
curl -X POST "https://api.edge.network/api/cdn/deployments" \
  -H "Authorization: Bearer ek_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{"origin": "https://mysite.com", "name": "cdn-prod"}'
```

Response:

```json
{
  "id": "cdn_456",
  "name": "cdn-prod",
  "origin": "https://mysite.com",
  "cname": "cdn-456.edge.network"
}
```

### Create a DNS record

```bash
curl -X POST "https://api.edge.network/api/dns/zones/zone_789/records" \
  -H "Authorization: Bearer ek_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{"type": "A", "name": "www", "value": "203.0.113.1"}'
```

Response:

```json
{
  "id": "rec_abc",
  "type": "A",
  "name": "www",
  "value": "203.0.113.1"
}
```

## Next steps

- [JavaScript SDK](/academy/sdk-javascript)
- [CLI documentation](/docs/cli)
