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/apiAuthentication
All API requests require authentication using your API key in the Authorization header:
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.0.link/api/domainsAlternatively, you can pass the token as a query parameter:
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/jsonRequest Methods
| Method | Usage |
|---|---|
GET | Retrieve data |
POST | Create new resources |
PUT | Update resources |
DELETE | Remove resources |
Request Body
For POST and PUT requests, send data as 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:
{
"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:
[
{
"id": "dom_abc123",
"name": "example.com",
"status": "active"
},
{
"id": "dom_def456",
"name": "mysite.io",
"status": "active"
}
]Error Response
Error responses include detailed information:
{
"error": {
"code": "VALIDATION_ERROR",
"message": "The request contains invalid parameters",
"details": "The 'name' field is required"
}
}Core Resources
Domains
Register and manage domain names.
| Method | Endpoint | Description |
|---|---|---|
GET | /domains | List all domains |
POST | /domains | Register a new domain |
GET | /domains/{id} | Get domain by ID |
GET | /domains/by-name/{name} | Get domain by name |
POST | /domains/search | Search available domains |
POST | /domains/quote | Get pricing for domains |
PUT | /domains/{id}/nameservers | Update nameservers |
PUT | /domains/{id}/contacts | Update contacts |
PUT | /domains/{id}/autorenew | Update auto-renew setting |
PUT | /domains/{id}/transfer-lock | Update transfer lock |
POST | /domains/{id}/auth-code | Generate auth code |
POST | /domains/{id}/renew | Renew domain |
View Domains API documentation
DNS Records
Manage DNS records for your domains.
| Method | Endpoint | Description |
|---|---|---|
GET | /domains/{id}/dns/records | List DNS records |
POST | /domains/{id}/dns/records | Create 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:
| Scope | Description |
|---|---|
READ | Read-only access to domains and DNS records |
WRITE | Read and write access to all resources |
ADMIN | Full administrative access (default) |
Learn more about API key scopes
HTTP Status Codes
| Code | Description |
|---|---|
200 | OK - Request successful |
201 | Created - Resource created |
204 | No Content - Successful deletion |
400 | Bad Request - Invalid request |
401 | Unauthorized - Invalid API key |
403 | Forbidden - Insufficient scope |
404 | Not Found - Resource doesn't exist |
422 | Unprocessable Entity - Validation error |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error - Server error |
Rate Limiting
API requests are rate limited. When rate limited, you'll receive a 429 response:
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests",
"retry_after": 60
}
}Example Requests
List Your Domains
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.0.link/api/domainsSearch for Available Domains
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/searchRegister a Domain
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/domainsCreate a DNS Record
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/recordsSDK Integration
Use our official SDKs for easier integration:
JavaScript/Node.js
const response = await fetch('https://api.0.link/api/domains', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const domains = await response.json();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
- Support: [email protected]
- Security Issues: [email protected]
Quick Links
- OpenAPI / Swagger - Interactive API explorer
- Authentication Guide
- Error Codes Reference
- Rate Limiting Details
- Domains API
- DNS Records API