API v2.0

Unregistry REST API Documentation

Complete reference for integrating with the Unregistry subdomain registry platform

Quick Navigation

Getting Started

Base URL

https://com.store/api/v2

Authentication

All API requests require authentication using an API key. Include your API key in the request headers:

X-API-Key: your_api_key_here

Alternative: Use Authorization header with Bearer token:

Authorization: Bearer your_api_key_here

Rate Limiting

API requests are limited to 1000 requests per hour per API key. Rate limit information is included in response headers:

  • X-RateLimit-Limit: 1000
  • X-RateLimit-Remaining: 999
  • X-RateLimit-Reset: 1640995200

Authentication Endpoints

POST /auth/register

Register a new registrant account and receive an API key.

Request Body

Parameter Type Required Description
email string required Valid email address
password string required Minimum 8 characters
organization string required Organization name
contact_name string required Primary contact name
curl -X POST https://com.store/api/v2/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "securePassword123",
    "organization": "Example Corp",
    "contact_name": "John Doe"
  }'
const response = await fetch('https://com.store/api/v2/auth/register', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    email: '[email protected]',
    password: 'securePassword123',
    organization: 'Example Corp',
    contact_name: 'John Doe'
  })
});

const data = await response.json();
import requests

response = requests.post(
    'https://com.store/api/v2/auth/register',
    json={
        'email': '[email protected]',
        'password': 'securePassword123',
        'organization': 'Example Corp',
        'contact_name': 'John Doe'
    }
)

data = response.json()

Response

{
  "success": true,
  "message": "Registration successful",
  "data": {
    "registrant_id": 123,
    "api_key": "sk_live_a1b2c3d4e5f6g7h8i9j0",
    "organization": "Example Corp"
  }
}
POST /auth/token

Generate a new API token using email and password credentials.

Request Body

Parameter Type Required Description
email string required Registered email address
password string required Account password

Subdomain Management

GET /subdomains/{name}

Check if a subdomain is available for registration.

Path Parameters

Parameter Type Description
name string Subdomain name to check (e.g., "shop", "api")
curl -X GET https://com.store/api/v2/subdomains/shop \
  -H "X-API-Key: your_api_key"

Response

{
  "success": true,
  "data": {
    "subdomain": "shop",
    "available": true,
    "premium": false,
    "price": {
      "registration": 29.99,
      "renewal": 29.99,
      "currency": "USD"
    }
  }
}
POST /subdomains

Register a new subdomain.

Request Body

Parameter Type Required Description
subdomain string required Subdomain name (3-63 characters)
domain string required Base domain (e.g., "com.store")
period integer optional Registration period in years (1-10, default: 1)
auto_renew boolean optional Enable auto-renewal (default: false)
dns_records array optional Initial DNS records to configure
curl -X POST https://com.store/api/v2/subdomains \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "subdomain": "shop",
    "domain": "com.store",
    "period": 2,
    "auto_renew": true,
    "dns_records": [
      {
        "type": "A",
        "value": "192.168.1.1"
      }
    ]
  }'
PUT /subdomains/{name}

Update subdomain settings and configuration.

DELETE /subdomains/{name}

Delete a subdomain (requires confirmation).

GET /registrant/subdomains

List all subdomains owned by the authenticated registrant.

Query Parameters

Parameter Type Description
page integer Page number (default: 1)
limit integer Results per page (default: 50, max: 100)
status string Filter by status: active, expired, suspended
sort string Sort by: name, created, expires (default: name)

DNS Management

GET /dns/{subdomain}/records

Get all DNS records for a subdomain.

POST /dns/{subdomain}/records

Add a new DNS record.

Request Body

Parameter Type Required Description
type string required Record type: A, AAAA, CNAME, MX, TXT, NS, SRV
name string required Record name (@ for root)
value string required Record value
ttl integer optional TTL in seconds (default: 3600)
priority integer optional Priority (for MX and SRV records)
PUT /dns/{subdomain}/records/{id}

Update an existing DNS record.

DELETE /dns/{subdomain}/records/{id}

Delete a DNS record.

Webhook Events

POST /webhooks

Register a webhook endpoint to receive real-time notifications.

Available Events

Event Description Payload
subdomain.registered New subdomain registration Subdomain details, registrant info
subdomain.renewed Subdomain renewal completed Subdomain, new expiry date
subdomain.expired Subdomain has expired Subdomain details
subdomain.transferred Subdomain transfer completed Subdomain, old/new registrant
dns.updated DNS records modified Subdomain, changed records
ssl.issued SSL certificate issued Subdomain, certificate details
ssl.renewed SSL certificate renewed Subdomain, new expiry
payment.completed Payment processed successfully Invoice details, amount
payment.failed Payment failed Invoice, error reason

Webhook Payload Example

{
  "event": "subdomain.registered",
  "timestamp": "2025-01-08T12:00:00Z",
  "data": {
    "subdomain": "shop.com.store",
    "registrant_id": 123,
    "registered_at": "2025-01-08T12:00:00Z",
    "expires_at": "2026-01-08T12:00:00Z",
    "auto_renew": true
  },
  "signature": "sha256=abcdef1234567890..."
}

Error Codes

Code Status Description
400 Bad Request Invalid request parameters or malformed JSON
401 Unauthorized Missing or invalid API key
403 Forbidden Access denied to resource
404 Not Found Resource not found
409 Conflict Subdomain already registered
422 Unprocessable Entity Valid JSON but semantic errors
429 Too Many Requests Rate limit exceeded
500 Internal Server Error Server error, please retry
503 Service Unavailable Temporary maintenance

Error Response Format

{
  "success": false,
  "error": {
    "code": "SUBDOMAIN_UNAVAILABLE",
    "message": "The subdomain 'shop' is already registered",
    "details": {
      "subdomain": "shop",
      "available": false,
      "expires": "2026-01-08T12:00:00Z"
    }
  }
}

SDKs & Libraries

Node.js

Official Node.js SDK

Python

Official Python SDK

PHP

Official PHP SDK

Go

Community Go client