Skip to content

Domains API

The Domains API allows you to register, manage, and configure domain names through 0.link. This includes domain registration, nameserver configuration, contact management, and domain lifecycle operations.

Base URL

https://api.0.link/api/domains

Authentication

All Domains API endpoints require authentication. Include your API key in the Authorization header:

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

Endpoints

MethodEndpointDescriptionRequired Scope
GET/domainsList all domainsREAD
POST/domainsRegister a new domainWRITE
GET/domains/{id}Get domain by IDREAD
GET/domains/by-name/{name}Get domain by nameREAD
POST/domains/searchSearch available domainsREAD
POST/domains/quoteGet pricing for domainsREAD
PUT/domains/{id}/nameserversUpdate nameserversWRITE
PUT/domains/{id}/contactsUpdate contactsWRITE
PUT/domains/{id}/autorenewUpdate auto-renew settingWRITE
PUT/domains/{id}/transfer-lockUpdate transfer lockWRITE
POST/domains/{id}/auth-codeGenerate auth codeWRITE
POST/domains/{id}/renewRenew domainWRITE

List Domains

Get a list of all domains in your account.

http
GET /api/domains

Example Request

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

Example Response

json
[
  {
    "id": "dom_abc123",
    "name": "example.com",
    "status": "active",
    "expires_at": "2026-01-15T00:00:00Z",
    "auto_renew": true,
    "transfer_locked": true,
    "nameservers": [
      "ns1.0.link",
      "ns2.0.link"
    ],
    "created_at": "2024-01-15T10:30:00Z"
  },
  {
    "id": "dom_def456",
    "name": "mysite.io",
    "status": "active",
    "expires_at": "2025-06-20T00:00:00Z",
    "auto_renew": false,
    "transfer_locked": true,
    "nameservers": [
      "ns1.0.link",
      "ns2.0.link"
    ],
    "created_at": "2024-06-20T14:00:00Z"
  }
]

Register Domain

Register a new domain name.

http
POST /api/domains

Request Body

json
{
  "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"
      }
    }
  },
  "nameservers": [
    "ns1.0.link",
    "ns2.0.link"
  ],
  "auto_renew": true
}

Parameters

ParameterTypeRequiredDescription
namestringYesDomain name to register
yearsintegerNoRegistration period (1-10, default: 1)
contactsobjectYesContact information
contacts.registrantobjectYesRegistrant contact details
nameserversarrayNoCustom nameservers (default: 0.link nameservers)
auto_renewbooleanNoEnable auto-renewal (default: true)

Example Request

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

Example Response

json
{
  "id": "dom_xyz789",
  "name": "example.com",
  "status": "pending",
  "expires_at": "2027-01-20T00:00:00Z",
  "auto_renew": true,
  "transfer_locked": true,
  "nameservers": [
    "ns1.0.link",
    "ns2.0.link"
  ],
  "contacts": {
    "registrant": {
      "first_name": "John",
      "last_name": "Doe",
      "email": "[email protected]"
    }
  },
  "created_at": "2026-01-20T10:30:00Z"
}

Get Domain by ID

Retrieve details for a specific domain by its ID.

http
GET /api/domains/{id}

Example Request

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

Example Response

json
{
  "id": "dom_abc123",
  "name": "example.com",
  "status": "active",
  "expires_at": "2026-01-15T00:00:00Z",
  "auto_renew": true,
  "transfer_locked": true,
  "nameservers": [
    "ns1.0.link",
    "ns2.0.link"
  ],
  "contacts": {
    "registrant": {
      "first_name": "John",
      "last_name": "Doe",
      "email": "[email protected]",
      "phone": "+1.5551234567",
      "organization": "Example Inc",
      "address": {
        "street": "123 Main St",
        "city": "San Francisco",
        "state": "CA",
        "postal_code": "94102",
        "country": "US"
      }
    }
  },
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-06-01T08:00:00Z"
}

Get Domain by Name

Retrieve details for a specific domain by its name.

http
GET /api/domains/by-name/{name}

Example Request

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

Example Response

Same as Get Domain by ID.


Search Domains

Search for available domain names.

http
POST /api/domains/search

Request Body

json
{
  "query": "example",
  "tlds": ["com", "io", "net", "org"]
}

Parameters

ParameterTypeRequiredDescription
querystringYesDomain name to search (without TLD)
tldsarrayNoTLDs to check (default: popular TLDs)

Example Request

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

Example Response

json
{
  "results": [
    {
      "name": "myawesomesite.com",
      "available": true,
      "price": {
        "registration": 12.99,
        "renewal": 14.99,
        "currency": "USD"
      }
    },
    {
      "name": "myawesomesite.io",
      "available": true,
      "price": {
        "registration": 39.99,
        "renewal": 39.99,
        "currency": "USD"
      }
    },
    {
      "name": "myawesomesite.net",
      "available": false,
      "price": null
    }
  ]
}

Get Domain Quote

Get pricing information for one or more domains.

http
POST /api/domains/quote

Request Body

json
{
  "domains": [
    { "name": "example.com", "years": 1 },
    { "name": "example.io", "years": 2 }
  ]
}

Example Request

bash
curl -X POST \
     -H "Authorization: Bearer YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{
       "domains": [
         { "name": "example.com", "years": 1 },
         { "name": "example.io", "years": 2 }
       ]
     }' \
     https://api.0.link/api/domains/quote

Example Response

json
{
  "quotes": [
    {
      "name": "example.com",
      "years": 1,
      "available": true,
      "price": {
        "registration": 12.99,
        "total": 12.99,
        "currency": "USD"
      }
    },
    {
      "name": "example.io",
      "years": 2,
      "available": true,
      "price": {
        "registration": 39.99,
        "total": 79.98,
        "currency": "USD"
      }
    }
  ],
  "total": {
    "amount": 92.97,
    "currency": "USD"
  }
}

Update Nameservers

Update the nameservers for a domain.

http
PUT /api/domains/{id}/nameservers

Request Body

json
{
  "nameservers": [
    "ns1.example.com",
    "ns2.example.com"
  ]
}

Parameters

ParameterTypeRequiredDescription
nameserversarrayYesList of nameserver hostnames (2-13)

Example Request

bash
curl -X PUT \
     -H "Authorization: Bearer YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{
       "nameservers": [
         "ns1.cloudflare.com",
         "ns2.cloudflare.com"
       ]
     }' \
     https://api.0.link/api/domains/dom_abc123/nameservers

Example Response

json
{
  "id": "dom_abc123",
  "name": "example.com",
  "nameservers": [
    "ns1.cloudflare.com",
    "ns2.cloudflare.com"
  ],
  "updated_at": "2026-01-20T10:30:00Z"
}

Update Contacts

Update the contact information for a domain.

http
PUT /api/domains/{id}/contacts

Request Body

json
{
  "registrant": {
    "first_name": "Jane",
    "last_name": "Smith",
    "email": "[email protected]",
    "phone": "+1.5559876543",
    "address": {
      "street": "456 Oak Ave",
      "city": "New York",
      "state": "NY",
      "postal_code": "10001",
      "country": "US"
    }
  }
}

Example Request

bash
curl -X PUT \
     -H "Authorization: Bearer YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{
       "registrant": {
         "first_name": "Jane",
         "last_name": "Smith",
         "email": "[email protected]",
         "phone": "+1.5559876543",
         "address": {
           "street": "456 Oak Ave",
           "city": "New York",
           "state": "NY",
           "postal_code": "10001",
           "country": "US"
         }
       }
     }' \
     https://api.0.link/api/domains/dom_abc123/contacts

Example Response

json
{
  "id": "dom_abc123",
  "name": "example.com",
  "contacts": {
    "registrant": {
      "first_name": "Jane",
      "last_name": "Smith",
      "email": "[email protected]"
    }
  },
  "updated_at": "2026-01-20T10:30:00Z"
}

Update Auto-Renew

Enable or disable automatic renewal for a domain.

http
PUT /api/domains/{id}/autorenew

Request Body

json
{
  "auto_renew": true
}

Example Request

bash
curl -X PUT \
     -H "Authorization: Bearer YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{"auto_renew": true}' \
     https://api.0.link/api/domains/dom_abc123/autorenew

Example Response

json
{
  "id": "dom_abc123",
  "name": "example.com",
  "auto_renew": true,
  "updated_at": "2026-01-20T10:30:00Z"
}

Update Transfer Lock

Enable or disable the transfer lock for a domain.

http
PUT /api/domains/{id}/transfer-lock

Request Body

json
{
  "transfer_locked": true
}

TIP

Transfer lock prevents unauthorized domain transfers. It's recommended to keep this enabled unless you're actively transferring the domain.

Example Request

bash
curl -X PUT \
     -H "Authorization: Bearer YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{"transfer_locked": false}' \
     https://api.0.link/api/domains/dom_abc123/transfer-lock

Example Response

json
{
  "id": "dom_abc123",
  "name": "example.com",
  "transfer_locked": false,
  "updated_at": "2026-01-20T10:30:00Z"
}

Generate Auth Code

Generate an authorization code for domain transfer.

http
POST /api/domains/{id}/auth-code

WARNING

Auth codes are sensitive. They allow the domain to be transferred to another registrar. Only generate an auth code when you intend to transfer the domain.

Example Request

bash
curl -X POST \
     -H "Authorization: Bearer YOUR_API_KEY" \
     https://api.0.link/api/domains/dom_abc123/auth-code

Example Response

json
{
  "id": "dom_abc123",
  "name": "example.com",
  "auth_code": "X9kP2mN7qR4s",
  "expires_at": "2026-01-27T10:30:00Z"
}

Renew Domain

Renew a domain for additional years.

http
POST /api/domains/{id}/renew

Request Body

json
{
  "years": 1
}

Parameters

ParameterTypeRequiredDescription
yearsintegerNoRenewal period (1-10, default: 1)

Example Request

bash
curl -X POST \
     -H "Authorization: Bearer YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{"years": 2}' \
     https://api.0.link/api/domains/dom_abc123/renew

Example Response

json
{
  "id": "dom_abc123",
  "name": "example.com",
  "status": "active",
  "expires_at": "2028-01-15T00:00:00Z",
  "renewal": {
    "years": 2,
    "price": 25.98,
    "currency": "USD"
  },
  "updated_at": "2026-01-20T10:30:00Z"
}

Domain Statuses

StatusDescription
pendingDomain registration is being processed
activeDomain is registered and active
expiredDomain has expired
redemptionDomain is in redemption period
pending_deleteDomain is pending deletion
transferred_outDomain was transferred to another registrar

Error Responses

Domain Not Found

json
{
  "error": {
    "code": "DOMAIN_NOT_FOUND",
    "message": "The specified domain was not found"
  }
}

Domain Unavailable

json
{
  "error": {
    "code": "DOMAIN_UNAVAILABLE",
    "message": "This domain is not available for registration"
  }
}

Invalid Nameservers

json
{
  "error": {
    "code": "INVALID_NAMESERVERS",
    "message": "Invalid nameserver configuration",
    "details": "At least 2 nameservers are required"
  }
}

Insufficient Scope

json
{
  "error": {
    "code": "INSUFFICIENT_SCOPE",
    "message": "This action requires WRITE scope"
  }
}

Code Examples

JavaScript

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

// Register a new domain
const newDomain = await fetch('https://api.0.link/api/domains', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    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'
        }
      }
    }
  })
}).then(res => res.json());

// Update nameservers
await fetch('https://api.0.link/api/domains/dom_abc123/nameservers', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    nameservers: ['ns1.cloudflare.com', 'ns2.cloudflare.com']
  })
});

Python

python
import requests

API_KEY = 'YOUR_API_KEY'
BASE_URL = 'https://api.0.link/api'

headers = {
    'Authorization': f'Bearer {API_KEY}',
    'Content-Type': 'application/json'
}

# List all domains
domains = requests.get(f'{BASE_URL}/domains', headers=headers).json()

# Register a new domain
new_domain = requests.post(
    f'{BASE_URL}/domains',
    headers=headers,
    json={
        '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'
                }
            }
        }
    }
).json()

# Update nameservers
requests.put(
    f'{BASE_URL}/domains/dom_abc123/nameservers',
    headers=headers,
    json={
        'nameservers': ['ns1.cloudflare.com', 'ns2.cloudflare.com']
    }
)

Next Steps