API Overview

Base URL: https://api.1bytedns.ru/client/v1

All endpoints return JSON responses. Every response contains a success field.

Quick Start

Create an API Token

API tokens can only be created through the web interface. Log in to your account, navigate to API Tokens, and create a new token with the desired name, permissions, scope, and expiry.

Important: The full token value is shown only once at creation time. Store it securely.

List Your Zones

curl -s https://api.1bytedns.ru/client/v1/zones \
  -H "Authorization: Bearer abc123def456ghi789jkl012mno345pqr678stu901vwx234" | python3 -m json.tool

Create a Zone

curl -s -X POST https://api.1bytedns.ru/client/v1/zones \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "example.com", "default_ttl": 3600}'

Add a DNS Record

curl -s -X POST https://api.1bytedns.ru/client/v1/zones/42/dns_records \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"type": "A", "name": "www.example.com", "content": "192.0.2.1", "ttl": 3600}'

Authentication

All API requests require a Bearer token in the Authorization header:

Authorization: Bearer <api_token>

Permissions

PermissionDescription
zones:readGET zones
zones:editPOST/PATCH/DELETE zones
records:readGET records
records:editPOST/PATCH/DELETE records
groups:readGET address groups
groups:editPOST/PATCH/DELETE address groups
health:readGET health status
health:editPATCH health config

Token Scope (Optional)

Tokens can be scoped to specific zones (scope_zone_ids) or records (scope_record_ids). If scope is set, requests outside the scope return 403.

Failed Authentication

{
  "success": false,
  "result": null,
  "errors": [
    {"code": 1011, "message": "Missing Authorization header"}
  ],
  "messages": []
}

Response Format

Success

{
  "success": true,
  "result": { ... },
  "errors": [],
  "messages": []
}

Error

{
  "success": false,
  "result": null,
  "errors": [
    {"code": 1001, "message": "Zone not found"}
  ],
  "messages": []
}

Paginated

{
  "success": true,
  "result": [ ... ],
  "result_info": {
    "page": 1,
    "per_page": 20,
    "count": 5,
    "total_count": 42,
    "total_pages": 3
  },
  "errors": [],
  "messages": []
}

Success with Warnings

{
  "success": true,
  "result": { ... },
  "errors": [],
  "messages": [
    {"code": 20001, "message": "Example informational message", "type": "warn"}
  ]
}

Rate Limiting

EndpointLimitWindow
All (global)1200 requests60 seconds
Batch operations60 requests60 seconds
Zone creation30 requests60 seconds

Every response includes rate limit headers:

X-RateLimit-Limit: 1200
X-RateLimit-Remaining: 1195
X-RateLimit-Reset: 1705312860

When exceeded, the API returns HTTP 429:

{
  "success": false,
  "result": null,
  "errors": [{"code": 1010, "message": "Rate limit exceeded"}],
  "messages": []
}

Error Codes

CodeHTTPDescription
1000400Bad Request — validation error
1001404Resource not found (zone, record, token)
1002403Access denied — resource doesn't belong to user
1003409User already has a zone with this name (per-user uniqueness)
1004400Invalid domain name
1005400CNAME conflict — cannot coexist with other types
1006404Record not found
1007400Invalid record data
1008400NS apex locked — system-managed records cannot be modified
1009400Zone not empty — cannot delete
1010429Rate limit exceeded
1011401Invalid or expired API token
1012400/422Invalid change batch
1013404Address group not found
1014400Member or group already exists
1015400Invalid IP address
1016400Maximum zones reached (300)
1017409IXFR requires zone transfer to be enabled first
1018409Cannot enable IXFR: zone has records bound to address groups
1019409Cannot bind address group: IXFR is enabled for this zone

Last updated: 2026-06-26