# Coritan API

> Automate what the dashboard does with the Coritan REST API, and find its base URL, credentials, formats and full reference.

Source: https://www.coritan.com/docs/api/

The Coritan API lets a script or an agent do what you do in the [dashboard](https://www.coritan.com/dashboard): order and manage services, pay invoices, edit DNS records and write to support. It is a REST API over HTTPS that takes and returns JSON, and the dashboard is built on the same endpoints.

Every request goes to one base URL:

```text
https://api.coritan.com/api/v1
```

## The two APIs

Client API
: Your own account: services, billing, DNS, support and everything else the dashboard shows you. Its paths start with `/api/v1`, such as `/api/v1/services/`, and it takes the access token you get by signing in.

Organization API
: An [organization](/docs/organizations/) that sells Coritan services under its own brand. Its members manage it with their own access token, and its storefront and its customers use it too. Its paths start with `/api/v1/orgs/{org_slug}`, where `{org_slug}` is the organization's short name.

[Authentication](/docs/api/authentication/) lists which credential each part of either API accepts.

## Make a first request

Sign in with [`POST /auth/login`](/docs/api/reference/client/authentication/#op-post-api-v1-auth-login) to get an access token, as [Make your first API request](/docs/get-started/first-steps-with-the-api/) shows step by step. Put the token in `CORITAN_TOKEN`, then read your account:

```bash
curl https://api.coritan.com/api/v1/auth/me \
  -H "Authorization: Bearer $CORITAN_TOKEN"
```

```json
{
  "id": 4821,
  "email": "alex@example.com",
  "first_name": "Alex",
  "last_name": "Morgan",
  "status": "active",
  "credit_balance": 25.0,
  "currency": "USD"
}
```

A request without a valid token answers `401` or `403` with a `detail` that says why ([Errors](/docs/api/errors/)).

## How the API behaves

- [Authentication](/docs/api/authentication/): access and refresh tokens, how long they last, and the keys some parts of the Organization API take.
- [Errors](/docs/api/errors/): the status codes and the shapes of `detail`.
- [Rate limits](/docs/api/rate-limits/): how many requests you can send, and what to do with a `429`.
- [Pagination and filtering](/docs/api/pagination/): how lists are paged and filtered.
- [Idempotent requests](/docs/api/idempotency/): the `Idempotency-Key` header, so a retried payment or order happens once.

## Reference

The [API reference](/docs/api/reference/) lists every operation with its parameters, request body and responses, generated from the API itself:

- [Client API reference](/docs/api/reference/client/)
- [Organization API reference](/docs/api/reference/organizations/)

Each API also has an interactive reference, where you can send requests from the browser: [the Client API](https://api.coritan.com/docs) and [the Organization API](https://api.coritan.com/docs/org).

## Read these docs as text

Every page of these docs is also plain Markdown, for a script or an AI agent to read:

| What | Where |
| --- | --- |
| One page as Markdown | Add `index.md` to the page's address, such as [`/docs/api/rate-limits/index.md`](/docs/api/rate-limits/index.md) |
| A list of every page | [`/docs/llms.txt`](/docs/llms.txt) |
| Every guide in one file | [`/docs/llms-full.txt`](/docs/llms-full.txt) |
| The API guides and the whole reference in one file | [`/docs/api/llms-full.txt`](/docs/api/llms-full.txt) |
| A search | `https://www.coritan.com/docs/search.json?q=backups` answers with up to 12 results, each with its `title`, `url`, `section` and a `snippet` |

## Billing and availability

The API is free to use. You pay for the services you order through it, exactly as in the dashboard ([Billing](/docs/billing/)). The API is open to every account, and an organization's API is open to its members.
