# API reference

> The Domains API: addresses, authentication, operations, errors and limits.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://domains.docs.sypnia.com/api/

For agents: Domains API at https://domains.api.sypnia.com/v1; Bearer key with scopes read, dns, purchase (owner/billing only), admin; long operations return 202 + operation (GET /operations/{id} pending/succeeded/failed, webhook domains.operation.completed); error codes 400 invalid_request/invalid_name/tld_not_supported, 401, 402 insufficient_credits, 403 forbidden/needs_approval, 404, 409 not_available/transfer_locked/owned_by_connection, 410 quote_expired, 422 contact_invalid/auth_code_invalid, 429.

API: `https://domains.api.sypnia.com/v1` **\[Cloud]**, or your engine's address **\[Engine]**.

## Authentication

`Authorization: Bearer <key>`. Keys belong to an organization and have scopes: `read` (search, quotes, domains, records), `dns` (change records and connections), `purchase` (buy, renew, transfer in; only for owner and billing members), `admin` (contacts, locks, keys).

## Operations

Registrations, renewals and transfers take from seconds to days, so they return `202` with an **operation**: `GET /operations/{id}` gives `pending`, `succeeded` or `failed` with the reason, and a webhook `domains.operation.completed` is sent when it ends.

## Errors

```json
{ "error": { "code": "not_available", "message": "laespiga.co was registered by someone else a moment ago. Try: laespiga.com, laespigapan.co" } }
```

| Status | Codes                                                     |
| ------ | --------------------------------------------------------- |
| 400    | `invalid_request`, `invalid_name`, `tld_not_supported`    |
| 401    | `unauthorized`                                            |
| 402    | `insufficient_credits`                                    |
| 403    | `forbidden`, `needs_approval`                             |
| 404    | `not_found`                                               |
| 409    | `not_available`, `transfer_locked`, `owned_by_connection` |
| 410    | `quote_expired`                                           |
| 422    | `contact_invalid`, `auth_code_invalid`                    |
| 429    | `rate_limited`                                            |

- [Endpoints](/api/endpoints/): Search, quotes, registrations, transfers, domains, zones, records and connections.
