API Reference

Complete API reference for Domains endpoints.

Authentication

All Domains API endpoints require authentication:

Authorization: Bearer YOUR_API_KEY

Or use the X-API-Key header:

X-API-Key: YOUR_API_KEY

Base URL

https://api.usetransactional.com/domains

Search Domains

GET /domains/search

Query Parameters:

ParameterTypeDescription
querystringSearch term
tldsstring[]Filter by TLDs

Response:

{
  "available": [
    { "domain": "example.com", "price": 12.99, "isPremium": false },
    { "domain": "example.io", "price": 49.99, "isPremium": false }
  ],
  "unavailable": [
    { "domain": "example.org" }
  ]
}

Check Availability

GET /domains/availability

Query Parameters:

ParameterTypeDescription
domainstringFull domain name

Domain Registration

Register Domain

POST /domains/register

Body:

{
  "domainName": "example.com",
  "years": 1,
  "registrant": {
    "firstName": "John",
    "lastName": "Doe",
    "email": "john@example.com",
    "phone": "+1.4155551234",
    "address": "123 Main St",
    "city": "San Francisco",
    "state": "CA",
    "postalCode": "94102",
    "country": "US"
  },
  "whoisPrivacy": true,
  "autoRenew": true
}

List Domains

GET /domains

Query Parameters:

ParameterTypeDescription
countnumberResults per page
offsetnumberPagination offset
statusstringFilter by status
expiringWithinDaysnumberExpiring soon filter

Get Domain

GET /domains/{domainName}

Renew Domain

POST /domains/{domainName}/renew

Body:

{
  "years": 1
}

Domain Settings

Update Settings

PATCH /domains/{domainName}/settings

Body:

{
  "autoRenew": true,
  "whoisPrivacy": true,
  "registrarLock": true
}

Get Auth Code

GET /domains/{domainName}/auth-code

Update Nameservers

PUT /domains/{domainName}/nameservers

Body:

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

Contacts

Get Contacts

GET /domains/{domainName}/contacts

Update Contact

PUT /domains/{domainName}/contacts/{contactType}

Contact types: registrant, admin, tech, billing


DNS Records

List Records

GET /domains/{domainName}/dns

Query Parameters:

ParameterTypeDescription
typestringFilter by record type

Create Record

POST /domains/{domainName}/dns

Body:

{
  "type": "A",
  "name": "@",
  "value": "203.0.113.1",
  "ttl": 3600
}

Update Record

PATCH /domains/{domainName}/dns/{recordId}

Delete Record

DELETE /domains/{domainName}/dns/{recordId}

Apply Preset

POST /domains/{domainName}/dns/presets

Body:

{
  "preset": "TRANSACTIONAL_EMAIL"
}

DNSSEC

Enable DNSSEC

POST /domains/{domainName}/dnssec/enable

Disable DNSSEC

POST /domains/{domainName}/dnssec/disable

Get DNSSEC Status

GET /domains/{domainName}/dnssec

Get DS Records

GET /domains/{domainName}/dnssec/ds

Transfers

Transfer In

POST /domains/transfer

Body:

{
  "domainName": "example.com",
  "authCode": "abc123",
  "registrant": { ... }
}

Get Transfer Status

GET /domains/transfers/{transferId}

Cancel Transfer

DELETE /domains/transfers/{transferId}

Webhooks

Create Webhook

POST /domains/webhooks

Body:

{
  "url": "https://yourapp.com/webhooks/domains",
  "events": ["domain.registered", "domain.expiring_soon"]
}

List Webhooks

GET /domains/webhooks

Delete Webhook

DELETE /domains/webhooks/{webhookId}

SDK Reference

TypeScript SDK

import { Transactional } from '@usetransactional/node';
 
const client = new Transactional({
  apiKey: process.env.TRANSACTIONAL_API_KEY,
});
 
// Search
const results = await client.domains.search('mycompany');
const availability = await client.domains.checkAvailability('example.com');
 
// Register
const domain = await client.domains.register({
  domainName: 'example.com',
  years: 1,
  registrant: { ... },
});
 
// List & Get
const domains = await client.domains.list();
const domain = await client.domains.get('example.com');
 
// Settings
await client.domains.updateSettings('example.com', { autoRenew: true });
 
// DNS
const records = await client.domains.dns.list('example.com');
await client.domains.dns.create('example.com', { type: 'A', name: '@', value: '...' });
await client.domains.dns.update('example.com', recordId, { value: '...' });
await client.domains.dns.delete('example.com', recordId);
await client.domains.dns.applyPreset('example.com', { preset: 'TRANSACTIONAL_EMAIL' });
 
// DNSSEC
await client.domains.dnssec.enable('example.com');
await client.domains.dnssec.disable('example.com');
const status = await client.domains.dnssec.getStatus('example.com');
 
// Webhooks
const webhook = await client.domains.webhooks.create({ url, events });

Python SDK

from usetransactional import Transactional
 
client = Transactional(api_key="your_api_key")
 
# Search
results = client.domains.search("mycompany")
availability = client.domains.check_availability("example.com")
 
# Register
domain = client.domains.register(
    domain_name="example.com",
    years=1,
    registrant={ ... },
)
 
# List & Get
domains = client.domains.list()
domain = client.domains.get("example.com")
 
# Settings
client.domains.update_settings("example.com", auto_renew=True)
 
# DNS
records = client.domains.dns.list("example.com")
client.domains.dns.create("example.com", type="A", name="@", value="...")
client.domains.dns.update("example.com", record_id, value="...")
client.domains.dns.delete("example.com", record_id)
client.domains.dns.apply_preset("example.com", preset="TRANSACTIONAL_EMAIL")
 
# DNSSEC
client.domains.dnssec.enable("example.com")
client.domains.dnssec.disable("example.com")
status = client.domains.dnssec.get_status("example.com")
 
# Webhooks
webhook = client.domains.webhooks.create(url=url, events=events)

Error Codes

HTTP StatusCodeDescription
400INVALID_REQUESTInvalid request body
401UNAUTHORIZEDInvalid or missing API key
403FORBIDDENInsufficient permissions
404NOT_FOUNDDomain not found
409CONFLICTDomain already registered
429RATE_LIMITEDToo many requests

Domain-Specific Errors

CodeDescription
DOMAIN_UNAVAILABLEDomain not available for registration
INVALID_DOMAIN_NAMEInvalid domain format
TLD_NOT_SUPPORTEDTLD not supported
TRANSFER_LOCKEDDomain transfer locked
INVALID_AUTH_CODEInvalid transfer auth code
DNS_RECORD_EXISTSDNS record already exists
INVALID_DNS_RECORDInvalid DNS record format
DNSSEC_ALREADY_ENABLEDDNSSEC already enabled

Webhook Events

EventDescription
domain.registeredDomain registered
domain.renewedDomain renewed
domain.expiredDomain expired
domain.expiring_soonDomain expiring within 30 days
domain.transferred_inTransfer completed
domain.transferred_outDomain transferred away
dns.changedDNS records modified
dnssec.enabledDNSSEC enabled
dnssec.disabledDNSSEC disabled

Webhook Payload

{
  "id": "evt_xxx",
  "type": "domain.registered",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "data": {
    "domain": {
      "domainName": "example.com",
      "status": "ACTIVE",
      "expiresAt": "2025-01-15T00:00:00.000Z"
    }
  }
}