API Quickstart

Get up and running with the OpusDNS API in under five minutes. By the end of this guide you'll have made your first authenticated request and confirmed that your credentials work.

1. Create your account

If you don't have an account yet, sign up at app.opusdns.com/signup. For testing, create a separate sandbox account at app.sandbox.opusdns.com — the sandbox is free and completely isolated from production.

2. Generate an API key

Open the dashboard and navigate to API Credentials. Create a new credential, then copy and store the API key securely.

Your API key and client secret are only displayed once at creation time. Copy them immediately — they cannot be retrieved later.

3. Set up your environment

Export your API key and base URL so the examples below work out of the box:

export OPUSDNS_API_BASE="https://sandbox.opusdns.com"
export OPUSDNS_API_KEY="opk_your_api_key_here"

4. Make your first request

Verify your credentials by listing domains on your account:

curl "$OPUSDNS_API_BASE/v1/domains?page=1&page_size=10" \
  --header "X-Api-Key: $OPUSDNS_API_KEY"

A successful response returns a JSON array of domains (or an empty array if your account is new):

{
  "items": [],
  "total": 0,
  "page": 1,
  "page_size": 10
}

5. Check domain availability

Now try checking whether a domain is available for registration:

curl --get "$OPUSDNS_API_BASE/v1/domains/check" \
  --header "X-Api-Key: $OPUSDNS_API_KEY" \
  --data-urlencode "domains=example.com" \
  --data-urlencode "domains=example.net"

The response contains one result per domain with available, reason, is_premium, and optional claims_key or premium_pricing fields.

6. Register a domain

Once you've found an available domain, register it:

curl "$OPUSDNS_API_BASE/v1/domains" \
  --request POST \
  --header "X-Api-Key: $OPUSDNS_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "my-new-domain.com",
    "contacts": {
      "registrant": "contact_01jxe1z8atfxpabknqbzhkvr3s",
      "admin": "contact_01jxe1z8atfxpabknqbzhkvr3s",
      "tech": "contact_01jxe1z8atfxpabknqbzhkvr3s",
      "billing": "contact_01jxe1z8atfxpabknqbzhkvr3s"
    },
    "renewal_mode": "renew",
    "period": {
      "unit": "y",
      "value": 1
    },
    "nameservers": [
      { "hostname": "ns1.opusdns.com" },
      { "hostname": "ns2.opusdns.net" }
    ],
    "create_zone": true
  }'

In the sandbox, domain registrations are simulated — no real domains are created and no charges apply.

Next steps