API Reference
Complete API reference for Domains endpoints.
Authentication
All Domains API endpoints require authentication:
Authorization: Bearer YOUR_API_KEYOr use the X-API-Key header:
X-API-Key: YOUR_API_KEYBase URL
https://api.usetransactional.com/domains
Domain Search
Search Domains
GET /domains/searchQuery Parameters:
| Parameter | Type | Description |
|---|---|---|
query | string | Search term |
tlds | string[] | 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/availabilityQuery Parameters:
| Parameter | Type | Description |
|---|---|---|
domain | string | Full domain name |
Domain Registration
Register Domain
POST /domains/registerBody:
{
"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 /domainsQuery Parameters:
| Parameter | Type | Description |
|---|---|---|
count | number | Results per page |
offset | number | Pagination offset |
status | string | Filter by status |
expiringWithinDays | number | Expiring soon filter |
Get Domain
GET /domains/{domainName}Renew Domain
POST /domains/{domainName}/renewBody:
{
"years": 1
}Domain Settings
Update Settings
PATCH /domains/{domainName}/settingsBody:
{
"autoRenew": true,
"whoisPrivacy": true,
"registrarLock": true
}Get Auth Code
GET /domains/{domainName}/auth-codeUpdate Nameservers
PUT /domains/{domainName}/nameserversBody:
{
"nameservers": [
"ns1.example.com",
"ns2.example.com"
]
}Contacts
Get Contacts
GET /domains/{domainName}/contactsUpdate Contact
PUT /domains/{domainName}/contacts/{contactType}Contact types: registrant, admin, tech, billing
DNS Records
List Records
GET /domains/{domainName}/dnsQuery Parameters:
| Parameter | Type | Description |
|---|---|---|
type | string | Filter by record type |
Create Record
POST /domains/{domainName}/dnsBody:
{
"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/presetsBody:
{
"preset": "TRANSACTIONAL_EMAIL"
}DNSSEC
Enable DNSSEC
POST /domains/{domainName}/dnssec/enableDisable DNSSEC
POST /domains/{domainName}/dnssec/disableGet DNSSEC Status
GET /domains/{domainName}/dnssecGet DS Records
GET /domains/{domainName}/dnssec/dsTransfers
Transfer In
POST /domains/transferBody:
{
"domainName": "example.com",
"authCode": "abc123",
"registrant": { ... }
}Get Transfer Status
GET /domains/transfers/{transferId}Cancel Transfer
DELETE /domains/transfers/{transferId}Webhooks
Create Webhook
POST /domains/webhooksBody:
{
"url": "https://yourapp.com/webhooks/domains",
"events": ["domain.registered", "domain.expiring_soon"]
}List Webhooks
GET /domains/webhooksDelete 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 Status | Code | Description |
|---|---|---|
| 400 | INVALID_REQUEST | Invalid request body |
| 401 | UNAUTHORIZED | Invalid or missing API key |
| 403 | FORBIDDEN | Insufficient permissions |
| 404 | NOT_FOUND | Domain not found |
| 409 | CONFLICT | Domain already registered |
| 429 | RATE_LIMITED | Too many requests |
Domain-Specific Errors
| Code | Description |
|---|---|
DOMAIN_UNAVAILABLE | Domain not available for registration |
INVALID_DOMAIN_NAME | Invalid domain format |
TLD_NOT_SUPPORTED | TLD not supported |
TRANSFER_LOCKED | Domain transfer locked |
INVALID_AUTH_CODE | Invalid transfer auth code |
DNS_RECORD_EXISTS | DNS record already exists |
INVALID_DNS_RECORD | Invalid DNS record format |
DNSSEC_ALREADY_ENABLED | DNSSEC already enabled |
Webhook Events
| Event | Description |
|---|---|
domain.registered | Domain registered |
domain.renewed | Domain renewed |
domain.expired | Domain expired |
domain.expiring_soon | Domain expiring within 30 days |
domain.transferred_in | Transfer completed |
domain.transferred_out | Domain transferred away |
dns.changed | DNS records modified |
dnssec.enabled | DNSSEC enabled |
dnssec.disabled | DNSSEC 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"
}
}
}On This Page
- Authentication
- Base URL
- Domain Search
- Search Domains
- Check Availability
- Domain Registration
- Register Domain
- List Domains
- Get Domain
- Renew Domain
- Domain Settings
- Update Settings
- Get Auth Code
- Update Nameservers
- Contacts
- Get Contacts
- Update Contact
- DNS Records
- List Records
- Create Record
- Update Record
- Delete Record
- Apply Preset
- DNSSEC
- Enable DNSSEC
- Disable DNSSEC
- Get DNSSEC Status
- Get DS Records
- Transfers
- Transfer In
- Get Transfer Status
- Cancel Transfer
- Webhooks
- Create Webhook
- List Webhooks
- Delete Webhook
- SDK Reference
- TypeScript SDK
- Python SDK
- Error Codes
- Domain-Specific Errors
- Webhook Events
- Webhook Payload