Skip to content

API Reference ​

Welcome to the 0.link API reference documentation. Our REST API provides programmatic access to domain registration and DNS management services.

Base URL ​

All API requests are made to:

https://api.0.link/api

Authentication ​

All API requests require authentication using your API key in the Authorization header:

bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
     https://api.0.link/api/domains

Alternatively, you can pass the token as a query parameter:

bash
curl "https://api.0.link/api/domains?token=YOUR_API_KEY"

Learn more about authentication

Request Format ​

Headers ​

Include these headers in all requests:

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Accept: application/json

Request Methods ​

MethodUsage
GETRetrieve data
POSTCreate new resources
PUTUpdate resources
DELETERemove resources

Request Body ​

For POST and PUT requests, send data as JSON:

json
{
  "name": "example.com",
  "years": 1,
  "contacts": {
    "registrant": {
      "first_name": "John",
      "last_name": "Doe",
      "email": "[email protected]"
    }
  }
}

Response Format ​

Success Response ​

Successful responses return the requested data directly:

json
{
  "id": "dom_abc123",
  "name": "example.com",
  "status": "active",
  "expires_at": "2027-01-20T00:00:00Z",
  "created_at": "2026-01-20T10:30:00Z"
}

List endpoints return arrays:

json
[
  {
    "id": "dom_abc123",
    "name": "example.com",
    "status": "active"
  },
  {
    "id": "dom_def456",
    "name": "mysite.io",
    "status": "active"
  }
]

Error Response ​

Error responses include detailed information:

json
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "The request contains invalid parameters",
    "details": "The 'name' field is required"
  }
}

Core Resources ​

Domains ​

Register and manage domain names.

MethodEndpointDescription
GET/domainsList all domains
POST/domainsRegister a new domain
GET/domains/{id}Get domain by ID
GET/domains/by-name/{name}Get domain by name
POST/domains/searchSearch available domains
POST/domains/quoteGet pricing for domains
PUT/domains/{id}/nameserversUpdate nameservers
PUT/domains/{id}/contactsUpdate contacts
PUT/domains/{id}/autorenewUpdate auto-renew setting
PUT/domains/{id}/transfer-lockUpdate transfer lock
POST/domains/{id}/auth-codeGenerate auth code
POST/domains/{id}/renewRenew domain

View Domains API documentation

DNS Records ​

Manage DNS records for your domains.

MethodEndpointDescription
GET/domains/{id}/dns/recordsList DNS records
POST/domains/{id}/dns/recordsCreate DNS record
PUT/domains/{id}/dns/records/{record_id}Update DNS record
DELETE/domains/{id}/dns/records/{record_id}Delete DNS record

View DNS Records API documentation

API Key Scopes ​

API keys have one of three scopes:

ScopeDescription
READRead-only access to domains and DNS records
WRITERead and write access to all resources
ADMINFull administrative access (default)

Learn more about API key scopes

HTTP Status Codes ​

CodeDescription
200OK - Request successful
201Created - Resource created
204No Content - Successful deletion
400Bad Request - Invalid request
401Unauthorized - Invalid API key
403Forbidden - Insufficient scope
404Not Found - Resource doesn't exist
422Unprocessable Entity - Validation error
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Server error

Rate Limiting ​

API requests are rate limited. When rate limited, you'll receive a 429 response:

json
{
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Too many requests",
    "retry_after": 60
  }
}

View rate limiting details

Example Requests ​

List Your Domains ​

bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
     https://api.0.link/api/domains

Search for Available Domains ​

bash
curl -X POST \
     -H "Authorization: Bearer YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{"query": "mysite", "tlds": ["com", "io", "net"]}' \
     https://api.0.link/api/domains/search

Register a Domain ​

bash
curl -X POST \
     -H "Authorization: Bearer YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{
       "name": "example.com",
       "years": 1,
       "contacts": {
         "registrant": {
           "first_name": "John",
           "last_name": "Doe",
           "email": "[email protected]",
           "phone": "+1.5551234567",
           "address": {
             "street": "123 Main St",
             "city": "San Francisco",
             "state": "CA",
             "postal_code": "94102",
             "country": "US"
           }
         }
       }
     }' \
     https://api.0.link/api/domains

Create a DNS Record ​

bash
curl -X POST \
     -H "Authorization: Bearer YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{"type": "A", "name": "@", "content": "192.0.2.1", "ttl": 3600}' \
     https://api.0.link/api/domains/dom_abc123/dns/records

SDK Integration ​

Use our official SDKs for easier integration:

JavaScript/Node.js ​

javascript
const response = await fetch('https://api.0.link/api/domains', {
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
});
const domains = await response.json();

Python ​

python
import requests

headers = {'Authorization': 'Bearer YOUR_API_KEY'}
response = requests.get('https://api.0.link/api/domains', headers=headers)
domains = response.json()

Getting Help ​