---
title: "API Reference"
description: "Edge Network REST API: authentication, endpoints for Compute, CDN, DNS, and Storage, error handling, rate limiting, and pagination. Learn how to integrate Edge services into your applications."
url: https://edge.network/academy/api-reference/
---

# API Reference

[Back to Academy](https://edge.network/academy)
API & SDK
15 min read

# API Reference

Edge exposes a REST API for Compute, CDN, DNS, and Storage. 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, Python SDK, or Go SDK articles for storage integration.

## Authentication

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

```
Authorization: Bearer ek_live_xxxxxxxxxxxxxxxxxxxxxxxx
```

API keys follow the format `ek_live_...`
for production. Generate keys in the **Control Panel → 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:

```
{
  "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:

```
{
  "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. Include
`Retry-After` in responses to
indicate when to retry. Implement exponential backoff for production clients.

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

## Resource endpoints

### Compute

`/api/compute/vms`

- `GET` list VMs
- `POST` create VM
- `GET /:id` get VM
- `DELETE /:id` delete VM
- `POST /:id/power` power on/off

### CDN

`/api/cdn/deployments`

- `GET` list deployments
- `POST` create deployment
- `GET /:id/domains` domains
- `POST /:id/purge` purge cache

### DNS

`/api/dns/zones`

- `GET` list zones
- `POST` create zone
- `GET /:id/records` list records, `POST` create, `PUT/:recordId` update, `DELETE/:recordId` delete

### Storage

`/api/storage/buckets`

- `GET` list buckets
- `POST` create bucket
- `GET /:bucket/objects` list objects
- Presigned URLs generated via Storage API or S3 SDK

Storage uses the S3-compatible API at `https://storage.edge.network` — use AWS S3 SDKs for object operations.

## Example requests

### List VMs

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

Response:

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

### Create CDN deployment

```
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:

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

### Create DNS record

```
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:

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

## Next steps

[JavaScript SDK](https://edge.network/academy/sdk-javascript) [CLI Documentation](https://edge.network/docs/cli)
