> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.divert.ly/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.divert.ly/_mcp/server.

# API reference

> Overview of the Divertly REST API: base URL, authentication, response format, pagination, and links to every endpoint.

The Divertly API lets you do everything the dashboard does from your own code: add domains, create routes, add targets, change weights, generate QR codes, and manage your organization.

## Basics

|                |                                             |
| -------------- | ------------------------------------------- |
| Base URL       | `https://api.divert.ly/v1`                  |
| Authentication | `Authorization: Key <base64(keyId:secret)>` |
| Format         | JSON requests and responses                 |

Successful responses are wrapped in a `body` field. List endpoints that paginate also return a `meta` block, and accept `page` (1-based) and `size` (1–256, default 20). Errors return `{ "error": "<message>", "meta": { "errorCode": "<code>" } }`.

```bash
curl https://api.divert.ly/v1/whoami \
  -H "Authorization: Key $CREDENTIAL"
```

## Where to go next

* [Authentication](/docs/developers/authentication): create a key and sign requests.
* [API Guide](/docs/developers/api-guide): envelope, pagination, and notes on specific endpoints.
* [Manage Routes with the API](/docs/user-guides/manage-routes-with-the-api): a walkthrough of common tasks.
* [Rate Limits & Errors](/docs/developers/rate-limits-errors): limits and the full error code list.

## Explore the endpoints

The endpoints below are grouped by resource. Use the interactive explorer on any endpoint page to try a request with your own API key.

> **Note**
>
> Official SDKs for Python, JavaScript, and Go are coming soon. Until then, the API is plain HTTP and works with any client. See [SDKs](/docs/developers/sdks).