Kehittäjät → REST API

REST API -dokumentaatio

Verkkotunnukset, DNS, SSL ja sovelluspalvelimet HTTPS:n yli. JSON sisään, JSON ulos, yksi perus-URL.

Perus-URL

https://nameocean.net/api/v1

Todennus

Authorization: Bearer <key> ja avain kohdasta Hallintapaneeli → API-avaimet.

OpenAPI 3.1

/api/v1/openapi.json · tuo se Postmaniin, Insomniaan tai Brunoon tai generoi asiakasohjelma.

Käyttöoikeudet

Jokaisella avaimella on käyttöoikeudet. GET vaatii oikeuden <area>:read, muut metodit oikeuden <area>:write; alla jokaisen päätepisteen kohdalla on lueteltu sen vaatimat oikeudet. Ilman niitä vastaus on 403 koodilla missing_scope ja kentällä required_scopes. Kaikki käyttöoikeudet.

Virheet

Jokaisella virheellä on sama rakenne: ihmisille ja tekoälyagenteille kirjoitettu viesti sekä pysyvä koodi, jonka perusteella voi haarautua. field kertoo virheellisen syötteen, jos sellainen on.

HTTP 400
{"error": "ip: Enter a valid IPv4 or IPv6 address.", "code": "invalid_field", "field": "ip"}

Koodit: invalid_request invalid_field unauthorized forbidden missing_scope not_found conflict already_exists insufficient_credit domain_unavailable premium_not_accepted email_not_confirmed contact_details_missing renewed_recently nameservers_not_nameocean rate_limited idempotency_key_reused idempotency_in_progress upstream_error unavailable limit_reached not_eligible mx_records_exist forwarding_off invalid_code refused not_approved

Pyyntörajoitukset

120 pyyntöä minuutissa tiliä kohden. Jokainen vastaus sisältää otsakkeet X-RateLimit-Limit, X-RateLimit-Remaining ja X-RateLimit-Reset (sekunteja seuraavan vapautuvan paikan aikaan). Rajan ylittyessä vastaus on 429 koodilla rate_limited ja retry_after sekunteina.

Turvallinen uudelleenyritys: Idempotency-Key

Lähetä Idempotency-Key-otsake (UUID) POST-, PUT-, PATCH- ja DELETE-pyyntöjen mukana. Jos yhteys katkeaa, yritä uudelleen samalla avaimella: saat takaisin ensimmäisen vastauksen otsakkeella Idempotent-Replayed: true, eikä verkkotunnusta rekisteröidä tai veloiteta kahdesti. Onnistuneet vastaukset säilytetään 24 tuntia tilikohtaisesti; jos samaa avainta käytetään eri pyynnön kanssa, pyyntö hylätään virheellä 422 idempotency_key_reused. Virheitä ei säilytetä, joten kun olet korjannut syyn (esimerkiksi lisännyt saldoa), samalla avaimella tehty uusi yritys suoritetaan uudelleen.

curl
$ curl -X POST https://nameocean.net/api/v1/domains \
    -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
    -H "Idempotency-Key: $(uuidgen)" \
    -H "Content-Type: application/json" -d '{"name": "example.com", "years": 1}'

Account

Account, credit and the activity log.

GET / #

Describe the API. Endpoints, record types, TTL values and scopes, as JSON.

Käyttöoikeudet: ei mitään

curl
curl -X GET https://nameocean.net/api/v1/ \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

Virheet: 400 · 401 · 404 · 429

GET /account #

Account and credit. Your email and account credit in USD.

Käyttöoikeudet: account:read

curl
curl -X GET https://nameocean.net/api/v1/account \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
emailstring
creditstringUSD amount as a decimal string
currency"USD"
domainsinteger
dns_zonesinteger
add_funds_urlstring

Virheet: 400 · 401 · 403 · 404 · 429

GET /audit #

Activity log. What was done on the account through the API, the CLI and MCP (every write call, refused calls and transfer-code reads) and API key and app changes in the dashboard. Newest first; pass next_cursor as cursor for the next page.

Käyttöoikeudet: account:read

ParametriSijaintiKuvaus
limitquery
cursorquerynext_cursor from the previous page
channelquery
curl
curl -X GET https://nameocean.net/api/v1/audit?limit=1&cursor=1&channel=1 \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
eventsAuditEvent[]
next_cursorstring | null

Virheet: 400 · 401 · 403 · 404 · 429

Domains

Search, register, renew and manage domains.

GET /domains/check #

Check availability and price. Is a domain free to register, and what it costs.

Käyttöoikeudet: domains:read

ParametriSijaintiKuvaus
name *query esim. example.com
yearsquery
curl
curl -X GET https://nameocean.net/api/v1/domains/check?name=example.com&years=1 \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
namestring
availableboolean
reasonstringWhy it is not available.
yearsinteger
premiumboolean
register_pricestringUSD amount as a decimal string
renew_pricestringUSD amount as a decimal string
currency"USD"

Virheet: 400 · 401 · 403 · 404 · 429

GET /domains #

List domains

Käyttöoikeudet: domains:read

curl
curl -X GET https://nameocean.net/api/v1/domains \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
domainsDomain[]

Virheet: 400 · 401 · 403 · 404 · 429

POST /domains #

Register a domain. Paid from account credit; 402 with code insufficient_credit when it is not enough. Premium names need accept_premium: true. Send an Idempotency-Key so a retry never registers twice.

Käyttöoikeudet: domains:write billing:write · Idempotency-Key

RunkokenttäTyyppiKuvaus
name *string
yearsinteger
accept_premiumboolean
curl
curl -X POST https://nameocean.net/api/v1/domains \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "example.com", "years": 1}'

201 Registered; its DNS zone is returned.

VastauskenttäTyyppiKuvaus
namestring
recordsRecord[]
hintstring

Virheet: 400 · 401 · 402 · 403 · 404 · 429

GET /domains/{name} #

Get a domain. Nameservers, lock, auto-renew and SSL status.

Käyttöoikeudet: domains:read

ParametriSijaintiKuvaus
name *pathDomain name esim. example.com
curl
curl -X GET https://nameocean.net/api/v1/domains/example.com \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
namestring
activeboolean
pendingboolean
suspendedboolean
expires_onstring | null
auto_renewboolean
lockedboolean
created_atstring | null
renewal_pricestring | null
nameserversstring[]
custom_nameserversboolean
dns_zoneboolean
sslSsl

Virheet: 400 · 401 · 403 · 404 · 429

PATCH /domains/{name} #

Change auto-renew or lock

Käyttöoikeudet: domains:write · Idempotency-Key

ParametriSijaintiKuvaus
name *pathDomain name esim. example.com
RunkokenttäTyyppiKuvaus
auto_renewboolean
lockedboolean
curl
curl -X PATCH https://nameocean.net/api/v1/domains/example.com \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"auto_renew": true}'

200 OK

VastauskenttäTyyppiKuvaus
namestring
activeboolean
pendingboolean
suspendedboolean
expires_onstring | null
auto_renewboolean
lockedboolean
created_atstring | null
renewal_pricestring | null
nameserversstring[]
custom_nameserversboolean
dns_zoneboolean
sslSsl

Virheet: 400 · 401 · 403 · 404 · 429

PUT /domains/{name}/nameservers #

Set nameservers. Two to four hostnames, or "nameocean" for NameOcean DNS.

Käyttöoikeudet: domains:write · Idempotency-Key

ParametriSijaintiKuvaus
name *pathDomain name esim. example.com
RunkokenttäTyyppiKuvaus
nameservers *array | string
curl
curl -X PUT https://nameocean.net/api/v1/domains/example.com/nameservers \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"nameservers": ["ns1.example.net", "ns2.example.net"]}'

200 OK

VastauskenttäTyyppiKuvaus
namestring
activeboolean
pendingboolean
suspendedboolean
expires_onstring | null
auto_renewboolean
lockedboolean
created_atstring | null
renewal_pricestring | null
nameserversstring[]
custom_nameserversboolean
dns_zoneboolean
sslSsl

Virheet: 400 · 401 · 403 · 404 · 429

POST /domains/{name}/renew #

Renew one year. Paid from account credit, within 60 days of expiry. Send an Idempotency-Key.

Käyttöoikeudet: domains:write billing:write · Idempotency-Key

ParametriSijaintiKuvaus
name *pathDomain name esim. example.com
curl
curl -X POST https://nameocean.net/api/v1/domains/example.com/renew \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
renewedstring
chargedstringUSD amount as a decimal string
creditstringUSD amount as a decimal string

Virheet: 400 · 401 · 402 · 403 · 404 · 429

GET /domains/{name}/auth-code #

Get the transfer code. The EPP code to move the domain away.

Käyttöoikeudet: domains:write

ParametriSijaintiKuvaus
name *pathDomain name esim. example.com
curl
curl -X GET https://nameocean.net/api/v1/domains/example.com/auth-code \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
namestring
auth_codestring

Virheet: 400 · 401 · 403 · 404 · 429

DNS

Zones and records.

GET /dns #

List DNS zones

Käyttöoikeudet: dns:read

curl
curl -X GET https://nameocean.net/api/v1/dns \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
zonesobject[]

Virheet: 400 · 401 · 403 · 404 · 429

POST /dns #

Create a DNS zone. Free. Point the domain's nameservers to ns1-ns4.nameocean.net to use it.

Käyttöoikeudet: dns:write · Idempotency-Key

RunkokenttäTyyppiKuvaus
name *string
curl
curl -X POST https://nameocean.net/api/v1/dns \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "example.com"}'

201 Created

VastauskenttäTyyppiKuvaus
namestring
recordsRecord[]
hintstring

Virheet: 400 · 401 · 403 · 404 · 429

GET /dns/{zone}/records #

List records

Käyttöoikeudet: dns:read

ParametriSijaintiKuvaus
zone *pathDNS zone (domain) name esim. example.com
curl
curl -X GET https://nameocean.net/api/v1/dns/example.com/records \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
zonestring
recordsRecord[]

Virheet: 400 · 401 · 403 · 404 · 429

POST /dns/{zone}/records #

Add a record

Käyttöoikeudet: dns:write · Idempotency-Key

ParametriSijaintiKuvaus
zone *pathDNS zone (domain) name esim. example.com
RunkokenttäTyyppiKuvaus
type *stringOne of: A, CNAME, MX, TXT, SRV, PTR, REDIRECT
hostname *string@ for the zone itself
ipstringA (IPv4 or IPv6)
targetstringCNAME, MX, SRV, PTR, REDIRECT
textstringTXT
priorityintegerMX, SRV
weightintegerSRV
portintegerSRV
save_pathbooleanREDIRECT: keep the path
ttlstringOne of: 5m, 15m, 30m, 1h, 1d
curl
curl -X POST https://nameocean.net/api/v1/dns/example.com/records \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type": "A", "hostname": "@", "ip": "203.0.113.10", "ttl": "1h"}'

201 Created

VastauskenttäTyyppiKuvaus
idinteger
typestringOne of: A, CNAME, MX, TXT, SRV, PTR, REDIRECT
hostnamestring@ for the zone itself
ipstringA (IPv4 or IPv6)
targetstringCNAME, MX, SRV, PTR, REDIRECT
textstringTXT
priorityintegerMX, SRV
weightintegerSRV
portintegerSRV
save_pathbooleanREDIRECT: keep the path
ttlstringOne of: 5m, 15m, 30m, 1h, 1d

Virheet: 400 · 401 · 403 · 404 · 429

GET /dns/{zone}/records/{type}/{id} #

Get a record

Käyttöoikeudet: dns:read

ParametriSijaintiKuvaus
zone *pathDNS zone (domain) name esim. example.com
type *pathRecord type: A, CNAME, MX, TXT, SRV, PTR or REDIRECT esim. A
id *pathNumeric id esim. 42
curl
curl -X GET https://nameocean.net/api/v1/dns/example.com/records/A/42 \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
idinteger
typestringOne of: A, CNAME, MX, TXT, SRV, PTR, REDIRECT
hostnamestring@ for the zone itself
ipstringA (IPv4 or IPv6)
targetstringCNAME, MX, SRV, PTR, REDIRECT
textstringTXT
priorityintegerMX, SRV
weightintegerSRV
portintegerSRV
save_pathbooleanREDIRECT: keep the path
ttlstringOne of: 5m, 15m, 30m, 1h, 1d

Virheet: 400 · 401 · 403 · 404 · 429

PATCH /dns/{zone}/records/{type}/{id} #

Change a record. Send only the fields to change.

Käyttöoikeudet: dns:write · Idempotency-Key

ParametriSijaintiKuvaus
zone *pathDNS zone (domain) name esim. example.com
type *pathRecord type: A, CNAME, MX, TXT, SRV, PTR or REDIRECT esim. A
id *pathNumeric id esim. 42
RunkokenttäTyyppiKuvaus
type *stringOne of: A, CNAME, MX, TXT, SRV, PTR, REDIRECT
hostname *string@ for the zone itself
ipstringA (IPv4 or IPv6)
targetstringCNAME, MX, SRV, PTR, REDIRECT
textstringTXT
priorityintegerMX, SRV
weightintegerSRV
portintegerSRV
save_pathbooleanREDIRECT: keep the path
ttlstringOne of: 5m, 15m, 30m, 1h, 1d
curl
curl -X PATCH https://nameocean.net/api/v1/dns/example.com/records/A/42 \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ip": "203.0.113.20"}'

200 OK

VastauskenttäTyyppiKuvaus
idinteger
typestringOne of: A, CNAME, MX, TXT, SRV, PTR, REDIRECT
hostnamestring@ for the zone itself
ipstringA (IPv4 or IPv6)
targetstringCNAME, MX, SRV, PTR, REDIRECT
textstringTXT
priorityintegerMX, SRV
weightintegerSRV
portintegerSRV
save_pathbooleanREDIRECT: keep the path
ttlstringOne of: 5m, 15m, 30m, 1h, 1d

Virheet: 400 · 401 · 403 · 404 · 429

PUT /dns/{zone}/records/{type}/{id} #

Replace a record. Same as PATCH.

Käyttöoikeudet: dns:write · Idempotency-Key

ParametriSijaintiKuvaus
zone *pathDNS zone (domain) name esim. example.com
type *pathRecord type: A, CNAME, MX, TXT, SRV, PTR or REDIRECT esim. A
id *pathNumeric id esim. 42
RunkokenttäTyyppiKuvaus
type *stringOne of: A, CNAME, MX, TXT, SRV, PTR, REDIRECT
hostname *string@ for the zone itself
ipstringA (IPv4 or IPv6)
targetstringCNAME, MX, SRV, PTR, REDIRECT
textstringTXT
priorityintegerMX, SRV
weightintegerSRV
portintegerSRV
save_pathbooleanREDIRECT: keep the path
ttlstringOne of: 5m, 15m, 30m, 1h, 1d
curl
curl -X PUT https://nameocean.net/api/v1/dns/example.com/records/A/42 \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
idinteger
typestringOne of: A, CNAME, MX, TXT, SRV, PTR, REDIRECT
hostnamestring@ for the zone itself
ipstringA (IPv4 or IPv6)
targetstringCNAME, MX, SRV, PTR, REDIRECT
textstringTXT
priorityintegerMX, SRV
weightintegerSRV
portintegerSRV
save_pathbooleanREDIRECT: keep the path
ttlstringOne of: 5m, 15m, 30m, 1h, 1d

Virheet: 400 · 401 · 403 · 404 · 429

DELETE /dns/{zone}/records/{type}/{id} #

Delete a record

Käyttöoikeudet: dns:write · Idempotency-Key

ParametriSijaintiKuvaus
zone *pathDNS zone (domain) name esim. example.com
type *pathRecord type: A, CNAME, MX, TXT, SRV, PTR or REDIRECT esim. A
id *pathNumeric id esim. 42
curl
curl -X DELETE https://nameocean.net/api/v1/dns/example.com/records/A/42 \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

204 Deleted

Virheet: 400 · 401 · 403 · 404 · 429

SSL

Free wildcard certificates.

GET /ssl/{zone} #

Certificate status

Käyttöoikeudet: ssl:read

ParametriSijaintiKuvaus
zone *pathDNS zone (domain) name esim. example.com
curl
curl -X GET https://nameocean.net/api/v1/ssl/example.com \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
zonestring
statusstringOne of: none, issuing, waiting_for_nameservers, active
auto_renewboolean
expires_onstring | null
download_urlstring | null

Virheet: 400 · 401 · 403 · 404 · 429

POST /ssl/{zone} #

Issue a certificate. Free wildcard Let's Encrypt certificate; the zone must use NameOcean nameservers. Poll GET until active.

Käyttöoikeudet: ssl:write · Idempotency-Key

ParametriSijaintiKuvaus
zone *pathDNS zone (domain) name esim. example.com
curl
curl -X POST https://nameocean.net/api/v1/ssl/example.com \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

202 Issuing

VastauskenttäTyyppiKuvaus
statusstringOne of: none, issuing, waiting_for_nameservers, active
auto_renewboolean
expires_onstring | null
download_urlstring | null

Virheet: 400 · 401 · 403 · 404 · 429

PATCH /ssl/{zone} #

Change auto-renew

Käyttöoikeudet: ssl:write · Idempotency-Key

ParametriSijaintiKuvaus
zone *pathDNS zone (domain) name esim. example.com
RunkokenttäTyyppiKuvaus
auto_renew *boolean
curl
curl -X PATCH https://nameocean.net/api/v1/ssl/example.com \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"auto_renew": true}'

200 OK

VastauskenttäTyyppiKuvaus
zonestring
statusstringOne of: none, issuing, waiting_for_nameservers, active
auto_renewboolean
expires_onstring | null
download_urlstring | null

Virheet: 400 · 401 · 403 · 404 · 429

Servers

App servers: ports and domain bindings.

GET /servers #

List app servers

Käyttöoikeudet: servers:read

curl
curl -X GET https://nameocean.net/api/v1/servers \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
serversServer[]

Virheet: 400 · 401 · 403 · 404 · 429

GET /servers/{server} #

Get a server. SSH, git remote, ports and domains.

Käyttöoikeudet: servers:read

ParametriSijaintiKuvaus
server *pathServer id, or its default domain such as 3f9a1c2e.nameocean.org esim. 3f9a1c2e
curl
curl -X GET https://nameocean.net/api/v1/servers/3f9a1c2e \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
idinteger
namestring
statusstring
planstring | null
default_domainstring
cpuinteger
memory_mbinteger
disk_gbinteger
private_ipstring | null
ipv6string | null
sshobject
git_remotestring | null
backupsboolean
portsPort[]
domainsBinding[]

Virheet: 400 · 401 · 403 · 404 · 429

GET /servers/{server}/ports #

List open ports

Käyttöoikeudet: servers:read

ParametriSijaintiKuvaus
server *pathServer id, or its default domain such as 3f9a1c2e.nameocean.org esim. 3f9a1c2e
curl
curl -X GET https://nameocean.net/api/v1/servers/3f9a1c2e/ports \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
serverstring
portsPort[]

Virheet: 400 · 401 · 403 · 404 · 429

POST /servers/{server}/ports #

Open a port. The external port is assigned.

Käyttöoikeudet: servers:write · Idempotency-Key

ParametriSijaintiKuvaus
server *pathServer id, or its default domain such as 3f9a1c2e.nameocean.org esim. 3f9a1c2e
RunkokenttäTyyppiKuvaus
port *integer
protocolstringOne of: tcp, udp
curl
curl -X POST https://nameocean.net/api/v1/servers/3f9a1c2e/ports \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"port": 25565, "protocol": "tcp"}'

201 Opened

VastauskenttäTyyppiKuvaus
idinteger
protocolstringOne of: tcp, udp
internal_portinteger
external_portinteger
connect_tostringOnly when the port was just opened.

Virheet: 400 · 401 · 403 · 404 · 429

DELETE /servers/{server}/ports/{id} #

Close a port

Käyttöoikeudet: servers:write · Idempotency-Key

ParametriSijaintiKuvaus
server *pathServer id, or its default domain such as 3f9a1c2e.nameocean.org esim. 3f9a1c2e
id *pathNumeric id esim. 42
curl
curl -X DELETE https://nameocean.net/api/v1/servers/3f9a1c2e/ports/42 \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

204 Closed

Virheet: 400 · 401 · 403 · 404 · 429

GET /servers/{server}/domains #

List bound domains

Käyttöoikeudet: servers:read

ParametriSijaintiKuvaus
server *pathServer id, or its default domain such as 3f9a1c2e.nameocean.org esim. 3f9a1c2e
curl
curl -X GET https://nameocean.net/api/v1/servers/3f9a1c2e/domains \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
serverstring
domainsBinding[]

Virheet: 400 · 401 · 403 · 404 · 429

POST /servers/{server}/domains #

Bind a domain. Serves a domain or subdomain from the server: DNS records, SSL and the load balancer. Poll GET until status is active.

Käyttöoikeudet: servers:write dns:write · Idempotency-Key

ParametriSijaintiKuvaus
server *pathServer id, or its default domain such as 3f9a1c2e.nameocean.org esim. 3f9a1c2e
RunkokenttäTyyppiKuvaus
domain *string
subdomainstring
curl
curl -X POST https://nameocean.net/api/v1/servers/3f9a1c2e/domains \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"domain": "app.example.com"}'

201 Setting up

VastauskenttäTyyppiKuvaus
idinteger
domainstring
statusstringOne of: setting_up, active
urlstring

Virheet: 400 · 401 · 403 · 404 · 429

DELETE /servers/{server}/domains/{id} #

Unbind a domain

Käyttöoikeudet: servers:write dns:write · Idempotency-Key

ParametriSijaintiKuvaus
server *pathServer id, or its default domain such as 3f9a1c2e.nameocean.org esim. 3f9a1c2e
id *pathNumeric id esim. 42
curl
curl -X DELETE https://nameocean.net/api/v1/servers/3f9a1c2e/domains/42 \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

204 Unbound

Virheet: 400 · 401 · 403 · 404 · 429

Email hosting

Mailboxes, aliases and mailing lists on your paid mail domains (Mox).

GET /email/domains #

List mail domains. Domains with paid email hosting. Buying, upgrading and reactivating a plan is done in the dashboard.

Käyttöoikeudet: email:read

curl
curl -X GET https://nameocean.net/api/v1/email/domains \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
domainsMailDomain[]

Virheet: 400 · 401 · 403 · 404 · 429

GET /email/domains/{domain} #

Get a mail domain. With its mailboxes, aliases, mailing lists and the IMAP/SMTP settings.

Käyttöoikeudet: email:read

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
curl
curl -X GET https://nameocean.net/api/v1/email/domains/example.com \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
domainstring
activeboolean
suspended_reasonstring | nullOne of: unpaid, ended, admin, None
planstring | null
storage_gbinteger
used_gbstringDecimal GB, as of the last refresh
assigned_gbintegerSum of the mailboxes' quotas (at most storage_gb)
max_mailboxesinteger | null
mailbox_countinteger
expires_atstring | null
auto_renewboolean
dashboardstring
mailboxesMailbox[]Only on GET /email/domains/{domain}
aliasesMailAlias[]
listsMailingList[]
settingsobjectIMAP, SMTP and webmail for mail clients

Virheet: 400 · 401 · 403 · 404 · 429

PATCH /email/domains/{domain} #

Change mail auto-renew

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
RunkokenttäTyyppiKuvaus
auto_renew *boolean
curl
curl -X PATCH https://nameocean.net/api/v1/email/domains/example.com \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"auto_renew": true}'

200 OK

VastauskenttäTyyppiKuvaus
domainstring
activeboolean
suspended_reasonstring | nullOne of: unpaid, ended, admin, None
planstring | null
storage_gbinteger
used_gbstringDecimal GB, as of the last refresh
assigned_gbintegerSum of the mailboxes' quotas (at most storage_gb)
max_mailboxesinteger | null
mailbox_countinteger
expires_atstring | null
auto_renewboolean
dashboardstring
mailboxesMailbox[]Only on GET /email/domains/{domain}
aliasesMailAlias[]
listsMailingList[]
settingsobjectIMAP, SMTP and webmail for mail clients

Virheet: 400 · 401 · 403 · 404 · 429

GET /email/domains/{domain}/dns-check #

Check mail DNS. Looks up NS, MX, SPF, DKIM and DMARC now and compares them with what NameOcean mail needs.

Käyttöoikeudet: email:read

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
curl
curl -X GET https://nameocean.net/api/v1/email/domains/example.com/dns-check \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
domainstring
okboolean
checksobjectns, mx, spf, dkim, dmarc

Virheet: 400 · 401 · 403 · 404 · 429

GET /email/domains/{domain}/mailboxes #

List mailboxes

Käyttöoikeudet: email:read

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
curl
curl -X GET https://nameocean.net/api/v1/email/domains/example.com/mailboxes \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
domainstring
mailboxesMailbox[]

Virheet: 400 · 401 · 403 · 404 · 429

POST /email/domains/{domain}/mailboxes #

Create a mailbox. Without a password one is generated. The answer is the only time the password is returned. quota_gb comes out of the plan's storage (default 1).

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
RunkokenttäTyyppiKuvaus
username *string
full_namestring
passwordstring
quota_gbinteger
curl
curl -X POST https://nameocean.net/api/v1/email/domains/example.com/mailboxes \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"username": "info", "full_name": "Info"}'

201 Created

VastauskenttäTyyppiKuvaus
addressstring
usernamestring
full_namestring
quota_gbinteger
used_gbstring
aliasesstring[]
passwordstringOnly in the answer that set it

Virheet: 400 · 401 · 403 · 404 · 429

GET /email/domains/{domain}/mailboxes/{username} #

Get a mailbox

Käyttöoikeudet: email:read

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
username *pathMailbox name, the part before @ (or the full address) esim. info
curl
curl -X GET https://nameocean.net/api/v1/email/domains/example.com/mailboxes/info \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
addressstring
usernamestring
full_namestring
quota_gbinteger
used_gbstring
aliasesstring[]
passwordstringOnly in the answer that set it

Virheet: 400 · 401 · 403 · 404 · 429

PATCH /email/domains/{domain}/mailboxes/{username} #

Change a mailbox. Send only what changes.

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
username *pathMailbox name, the part before @ (or the full address) esim. info
RunkokenttäTyyppiKuvaus
full_namestring
quota_gbinteger
curl
curl -X PATCH https://nameocean.net/api/v1/email/domains/example.com/mailboxes/info \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"quota_gb": 5}'

200 OK

VastauskenttäTyyppiKuvaus
addressstring
usernamestring
full_namestring
quota_gbinteger
used_gbstring
aliasesstring[]
passwordstringOnly in the answer that set it

Virheet: 400 · 401 · 403 · 404 · 429

DELETE /email/domains/{domain}/mailboxes/{username} #

Delete a mailbox. Deletes the mailbox, all its mail and its aliases. This can't be undone.

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
username *pathMailbox name, the part before @ (or the full address) esim. info
curl
curl -X DELETE https://nameocean.net/api/v1/email/domains/example.com/mailboxes/info \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

204 Deleted

Virheet: 400 · 401 · 403 · 404 · 429

POST /email/domains/{domain}/mailboxes/{username}/password #

Set a mailbox password. Sets the password you send, or generates one when you send none, and returns it.

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
username *pathMailbox name, the part before @ (or the full address) esim. info
RunkokenttäTyyppiKuvaus
passwordstring
curl
curl -X POST https://nameocean.net/api/v1/email/domains/example.com/mailboxes/info/password \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

200 OK

VastauskenttäTyyppiKuvaus
addressstring
usernamestring
full_namestring
quota_gbinteger
used_gbstring
aliasesstring[]
passwordstringOnly in the answer that set it

Virheet: 400 · 401 · 403 · 404 · 429

GET /email/domains/{domain}/aliases #

List mail aliases

Käyttöoikeudet: email:read

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
curl
curl -X GET https://nameocean.net/api/v1/email/domains/example.com/aliases \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
domainstring
aliasesMailAlias[]

Virheet: 400 · 401 · 403 · 404 · 429

POST /email/domains/{domain}/aliases #

Add a mail alias. Mail to alias is delivered to the mailbox. Both are on the same domain; send the full address or the part before @.

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
RunkokenttäTyyppiKuvaus
alias *string
mailbox *string
curl
curl -X POST https://nameocean.net/api/v1/email/domains/example.com/aliases \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"alias": "sales", "mailbox": "info"}'

201 Created

VastauskenttäTyyppiKuvaus
addressstring
mailboxstringThe mailbox that receives it

Virheet: 400 · 401 · 403 · 404 · 429

DELETE /email/domains/{domain}/aliases/{alias} #

Delete a mail alias

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
alias *pathAlias address, or the part before @ esim. sales
curl
curl -X DELETE https://nameocean.net/api/v1/email/domains/example.com/aliases/sales \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

204 Deleted

Virheet: 400 · 401 · 403 · 404 · 429

GET /email/domains/{domain}/lists #

List mailing lists

Käyttöoikeudet: email:read

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
curl
curl -X GET https://nameocean.net/api/v1/email/domains/example.com/lists \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
domainstring
listsMailingList[]

Virheet: 400 · 401 · 403 · 404 · 429

POST /email/domains/{domain}/lists #

Create a mailing list. Mail to the list's address goes to every member (mailboxes of the domain).

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
RunkokenttäTyyppiKuvaus
address *string
namestring
membersstring[]
curl
curl -X POST https://nameocean.net/api/v1/email/domains/example.com/lists \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"address": "team", "members": ["info", "sales"]}'

201 Created

VastauskenttäTyyppiKuvaus
addressstring
namestring
membersstring[]

Virheet: 400 · 401 · 403 · 404 · 429

GET /email/domains/{domain}/lists/{address} #

Get a mailing list

Käyttöoikeudet: email:read

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
address *pathMailing list address, or the part before @ esim. team
curl
curl -X GET https://nameocean.net/api/v1/email/domains/example.com/lists/team \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
addressstring
namestring
membersstring[]

Virheet: 400 · 401 · 403 · 404 · 429

PATCH /email/domains/{domain}/lists/{address} #

Change a mailing list. members replaces the whole member list.

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
address *pathMailing list address, or the part before @ esim. team
RunkokenttäTyyppiKuvaus
namestring
membersstring[]
curl
curl -X PATCH https://nameocean.net/api/v1/email/domains/example.com/lists/team \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"members": ["info"]}'

200 OK

VastauskenttäTyyppiKuvaus
addressstring
namestring
membersstring[]

Virheet: 400 · 401 · 403 · 404 · 429

DELETE /email/domains/{domain}/lists/{address} #

Delete a mailing list

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
address *pathMailing list address, or the part before @ esim. team
curl
curl -X DELETE https://nameocean.net/api/v1/email/domains/example.com/lists/team \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

204 Deleted

Virheet: 400 · 401 · 403 · 404 · 429

Email forwarding

Free forwarding and mail-to-webhook for domains registered at NameOcean.

GET /email/forwarding #

List forwarding domains. Every active domain registered in your account, with whether forwarding is on and, when off, why it can't be.

Käyttöoikeudet: email:read

curl
curl -X GET https://nameocean.net/api/v1/email/forwarding \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
domainsForwarding[]

Virheet: 400 · 401 · 403 · 404 · 429

GET /email/forwarding/{domain} #

Get forwarding. Aliases and mail webhooks.

Käyttöoikeudet: email:read

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
curl
curl -X GET https://nameocean.net/api/v1/email/forwarding/example.com \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
domainstring
activeboolean
disabled_reasonstring | null
problemsstring[]Why it can't be turned on, when it is off
alias_countinteger
webhook_countinteger
mxstringThe MX host forwarding writes into the zone
max_aliasesinteger
max_webhooksinteger
daily_limitintegerMails forwarded per domain and day
aliasesForwardAlias[]
webhooksMailWebhook[]

Virheet: 400 · 401 · 403 · 404 · 429

POST /email/forwarding/{domain} #

Turn forwarding on. Free for domains registered at NameOcean that use NameOcean nameservers. Writes the MX record; other MX records are removed only with replace_mx: true (otherwise 409 mx_records_exist).

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
RunkokenttäTyyppiKuvaus
replace_mxboolean
curl
curl -X POST https://nameocean.net/api/v1/email/forwarding/example.com \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"replace_mx": false}'

200 OK

VastauskenttäTyyppiKuvaus
domainstring
activeboolean
disabled_reasonstring | null
problemsstring[]Why it can't be turned on, when it is off
alias_countinteger
webhook_countinteger
mxstringThe MX host forwarding writes into the zone
max_aliasesinteger
max_webhooksinteger
daily_limitintegerMails forwarded per domain and day
aliasesForwardAlias[]
webhooksMailWebhook[]

Virheet: 400 · 401 · 403 · 404 · 429

DELETE /email/forwarding/{domain} #

Turn forwarding off. Removes the MX record; aliases are kept for when it is turned on again.

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
curl
curl -X DELETE https://nameocean.net/api/v1/email/forwarding/example.com \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

204 Turned off

Virheet: 400 · 401 · 403 · 404 · 429

GET /email/forwarding/{domain}/aliases #

List forwarding aliases

Käyttöoikeudet: email:read

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
curl
curl -X GET https://nameocean.net/api/v1/email/forwarding/example.com/aliases \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
domainstring
aliasesForwardAlias[]

Virheet: 400 · 401 · 403 · 404 · 429

POST /email/forwarding/{domain}/aliases #

Add a forwarding alias. localpart@domain forwards to `to`; * forwards every address without its own alias. An address not confirmed yet gets a mail with a link and a code; mail is forwarded once it is confirmed.

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
RunkokenttäTyyppiKuvaus
localpart *string
to *string
curl
curl -X POST https://nameocean.net/api/v1/email/forwarding/example.com/aliases \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"localpart": "hello", "to": "me@gmail.com"}'

201 Created

VastauskenttäTyyppiKuvaus
localpartstring* = every address without its own alias
addressstring
catch_allboolean
tostring
to_statusstringOne of: pending, confirmed, refused
activeboolean
notestringOnly when just added: what happens next

Virheet: 400 · 401 · 403 · 404 · 429

DELETE /email/forwarding/{domain}/aliases/{localpart} #

Delete a forwarding alias. Use * (%2A) for the catch-all.

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
localpart *pathThe part before @, or * (%2A) for the catch-all esim. hello
curl
curl -X DELETE https://nameocean.net/api/v1/email/forwarding/example.com/aliases/hello \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

204 Deleted

Virheet: 400 · 401 · 403 · 404 · 429

GET /email/forwarding/targets #

List forwarding targets. Addresses you forward to and whether they confirmed.

Käyttöoikeudet: email:read

curl
curl -X GET https://nameocean.net/api/v1/email/forwarding/targets \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
targetsForwardTarget[]

Virheet: 400 · 401 · 403 · 404 · 429

POST /email/forwarding/targets/{id}/verify #

Confirm a forwarding target. The 6-digit code from the confirmation mail.

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
id *pathNumeric id esim. 42
RunkokenttäTyyppiKuvaus
code *string
curl
curl -X POST https://nameocean.net/api/v1/email/forwarding/targets/42/verify \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code": "123456"}'

200 OK

VastauskenttäTyyppiKuvaus
idinteger
emailstring
statusstringOne of: pending, confirmed, refused
confirmed_atstring | null

Virheet: 400 · 401 · 403 · 404 · 429

POST /email/forwarding/targets/{id}/resend #

Resend a confirmation code. At most 3 a day per address.

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
id *pathNumeric id esim. 42
curl
curl -X POST https://nameocean.net/api/v1/email/forwarding/targets/42/resend \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
idinteger
emailstring
statusstringOne of: pending, confirmed, refused
confirmed_atstring | null

Virheet: 400 · 401 · 403 · 404 · 429

GET /email/forwarding/{domain}/messages #

List forwarded mail. The last 30 days, newest first: headers and what happened, never the body.

Käyttöoikeudet: email:read

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
limitquery
cursorquery
statusquery
curl
curl -X GET https://nameocean.net/api/v1/email/forwarding/example.com/messages?limit=1&cursor=1&status=1 \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
domainstring
messagesForwardedMessage[]
next_cursorstring | null

Virheet: 400 · 401 · 403 · 404 · 429

POST /email/forwarding/{domain}/messages/{message_id}/release #

Forward held mail. Forwards a message held as spam, over the daily limit or failed (releasable: true).

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
message_id *pathMessage id (uuid) esim. 6f1c2a4e-8b3d-4f5a-9c7e-1d2b3a4c5e6f
curl
curl -X POST https://nameocean.net/api/v1/email/forwarding/example.com/messages/6f1c2a4e-8b3d-4f5a-9c7e-1d2b3a4c5e6f/release \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

202 Forwarding

VastauskenttäTyyppiKuvaus
idstring
received_atstring | null
tostring
forwarded_tostring | null
fromstring | null
subjectstring | null
sizeinteger
statusstringOne of: forwarded, spam, quota, release_requested, released, bounced, loop, failed
spam_scorenumber | null
releasableboolean
smtp_responsestring | null

Virheet: 400 · 401 · 403 · 404 · 429

GET /email/forwarding/{domain}/webhooks #

List mail webhooks. Addresses whose mail is posted to your URL as JSON, with their signing secrets.

Käyttöoikeudet: email:read

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
curl
curl -X GET https://nameocean.net/api/v1/email/forwarding/example.com/webhooks \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
domainstring
webhooksMailWebhook[]

Virheet: 400 · 401 · 403 · 404 · 429

POST /email/forwarding/{domain}/webhooks #

Add a mail webhook. Mail to localpart@domain is posted to url as JSON (an email.received event). Open after a short review (403 not_approved until then); ask for it in the dashboard.

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
RunkokenttäTyyppiKuvaus
localpart *string
url *string
curl
curl -X POST https://nameocean.net/api/v1/email/forwarding/example.com/webhooks \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"localpart": "inbound", "url": "https://example.com/hooks/mail"}'

201 Created

VastauskenttäTyyppiKuvaus
localpartstring
addressstring
catch_allboolean
urlstring
activeboolean
created_atstring | null
secretstringwhsec_...; signs X-NameOcean-Signature

Virheet: 400 · 401 · 403 · 404 · 429

DELETE /email/forwarding/{domain}/webhooks/{localpart} #

Delete a mail webhook

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
localpart *pathThe part before @, or * (%2A) for the catch-all esim. hello
curl
curl -X DELETE https://nameocean.net/api/v1/email/forwarding/example.com/webhooks/hello \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

204 Deleted

Virheet: 400 · 401 · 403 · 404 · 429

POST /email/forwarding/{domain}/webhooks/{localpart}/rotate-secret #

Rotate a mail webhook secret. The old secret stops working at once.

Käyttöoikeudet: email:write · Idempotency-Key

ParametriSijaintiKuvaus
domain *pathDomain name esim. example.com
localpart *pathThe part before @, or * (%2A) for the catch-all esim. hello
curl
curl -X POST https://nameocean.net/api/v1/email/forwarding/example.com/webhooks/hello/rotate-secret \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
localpartstring
addressstring
catch_allboolean
urlstring
activeboolean
created_atstring | null
secretstringwhsec_...; signs X-NameOcean-Signature

Virheet: 400 · 401 · 403 · 404 · 429

Webhooks

Endpoints that receive account events: https://nameocean.net/developers/webhooks/

GET /webhooks/events #

List event types. Every event type and group you can subscribe to.

Käyttöoikeudet: webhooks:read

curl
curl -X GET https://nameocean.net/api/v1/webhooks/events \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
eventsobject[]
groupsstring[]

Virheet: 400 · 401 · 403 · 404 · 429

GET /webhooks #

List webhook endpoints

Käyttöoikeudet: webhooks:read

curl
curl -X GET https://nameocean.net/api/v1/webhooks \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
webhooksWebhookEndpoint[]

Virheet: 400 · 401 · 403 · 404 · 429

POST /webhooks #

Add a webhook endpoint. An https URL on a public server. The answer includes the signing secret. Up to 10 endpoints.

Käyttöoikeudet: webhooks:write · Idempotency-Key

RunkokenttäTyyppiKuvaus
url *string
events *string[]
descriptionstring
curl
curl -X POST https://nameocean.net/api/v1/webhooks \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/hooks/nameocean", "events": ["dns.*", "ssl.issued"]}'

201 Created

VastauskenttäTyyppiKuvaus
idinteger
urlstring
descriptionstring
eventsstring[]Event types, groups like "dns.*", or ["*"]
activeboolean
disabled_reasonstring | nullWhy NameOcean turned it off
secretstringwhsec_...: verify X-NameOcean-Signature with it. Not in list answers.
created_atstring | null
last_success_atstring | null
last_failure_atstring | null

Virheet: 400 · 401 · 403 · 404 · 429

GET /webhooks/{id} #

Get a webhook endpoint. With its signing secret.

Käyttöoikeudet: webhooks:read

ParametriSijaintiKuvaus
id *pathNumeric id esim. 42
curl
curl -X GET https://nameocean.net/api/v1/webhooks/42 \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
idinteger
urlstring
descriptionstring
eventsstring[]Event types, groups like "dns.*", or ["*"]
activeboolean
disabled_reasonstring | nullWhy NameOcean turned it off
secretstringwhsec_...: verify X-NameOcean-Signature with it. Not in list answers.
created_atstring | null
last_success_atstring | null
last_failure_atstring | null

Virheet: 400 · 401 · 403 · 404 · 429

PATCH /webhooks/{id} #

Change a webhook endpoint. Send only what changes. active: true turns a disabled endpoint back on.

Käyttöoikeudet: webhooks:write · Idempotency-Key

ParametriSijaintiKuvaus
id *pathNumeric id esim. 42
RunkokenttäTyyppiKuvaus
urlstring
eventsstring[]
descriptionstring
activeboolean
curl
curl -X PATCH https://nameocean.net/api/v1/webhooks/42 \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"active": true}'

200 OK

VastauskenttäTyyppiKuvaus
idinteger
urlstring
descriptionstring
eventsstring[]Event types, groups like "dns.*", or ["*"]
activeboolean
disabled_reasonstring | nullWhy NameOcean turned it off
secretstringwhsec_...: verify X-NameOcean-Signature with it. Not in list answers.
created_atstring | null
last_success_atstring | null
last_failure_atstring | null

Virheet: 400 · 401 · 403 · 404 · 429

DELETE /webhooks/{id} #

Delete a webhook endpoint

Käyttöoikeudet: webhooks:write · Idempotency-Key

ParametriSijaintiKuvaus
id *pathNumeric id esim. 42
curl
curl -X DELETE https://nameocean.net/api/v1/webhooks/42 \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

204 Deleted

Virheet: 400 · 401 · 403 · 404 · 429

POST /webhooks/{id}/test #

Send a test event. Posts a webhook.test event now, whatever the endpoint's event filter, and returns the delivery.

Käyttöoikeudet: webhooks:write · Idempotency-Key

ParametriSijaintiKuvaus
id *pathNumeric id esim. 42
curl
curl -X POST https://nameocean.net/api/v1/webhooks/42/test \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
idstringwhd_..., also sent as X-NameOcean-Delivery
eventobject
statusstringOne of: pending, succeeded, failed
attemptsinteger
next_attempt_atstring | null
last_attempt_atstring | null
response_statusinteger | null
response_bodystring | nullFirst 500 characters
errorstring | null

Virheet: 400 · 401 · 403 · 404 · 429

GET /webhooks/{id}/deliveries #

List deliveries. Newest first; pass next_cursor as cursor for the next page.

Käyttöoikeudet: webhooks:read

ParametriSijaintiKuvaus
id *pathNumeric id esim. 42
limitquery
cursorquery
statusquery
curl
curl -X GET https://nameocean.net/api/v1/webhooks/42/deliveries?limit=1&cursor=1&status=1 \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
deliveriesWebhookDelivery[]
next_cursorstring | null

Virheet: 400 · 401 · 403 · 404 · 429

POST /webhooks/{id}/deliveries/{delivery_id}/resend #

Resend a delivery. Posts the same event (same id) again now.

Käyttöoikeudet: webhooks:write · Idempotency-Key

ParametriSijaintiKuvaus
id *pathNumeric id esim. 42
delivery_id *pathDelivery id (whd_...) esim. whd_3f9a1c2e4b5d6a7c8e9f0a1b
curl
curl -X POST https://nameocean.net/api/v1/webhooks/42/deliveries/whd_3f9a1c2e4b5d6a7c8e9f0a1b/resend \
  -H "Authorization: Bearer $NAMEOCEAN_API_KEY"

200 OK

VastauskenttäTyyppiKuvaus
idstringwhd_..., also sent as X-NameOcean-Delivery
eventobject
statusstringOne of: pending, succeeded, failed
attemptsinteger
next_attempt_atstring | null
last_attempt_atstring | null
response_statusinteger | null
response_bodystring | nullFirst 500 characters
errorstring | null

Virheet: 400 · 401 · 403 · 404 · 429