Domeneshop API Documentation (v0)

Download OpenAPI specification:Download

Overview

Domeneshop offers a simple, REST-based API, which currently supports the following features:

  • List domains
  • List invoices
  • Create, read, update and delete DNS records for domains
  • Create, read, update and delete HTTP forwards ("WWW forwarding") for domains
  • Dynamic DNS (DDNS) update endpoints for use in consumer routers

More features are planned, including:

  • Web hosting administration
  • Email address and email user/account administration

Testing period

The API service is in version 0, which means it is possible that the interface will change rapidly during the testing period. For that reason, the documentation on these pages may sometimes be outdated.

Additionally, we make no guarantees about the stability of the API service during this testing period, and therefore ask customers to be careful with using the service for business critical purposes.

Authentication

The Domeneshop API currently supports only one method of authentication, HTTP Basic Auth. More authentication methods may be added in the future.

To generate credentials, visit this page after logging in to the control panel on our website:

https://www.domeneshop.no/login

Libraries

Domeneshop maintains multiple API libraries to simplify using the API. Please note that these libraries have the same stability guarantees to the API while the API is in version 0.

The libraries may be found in our Github repository.

Domeneshop also maintains a plugin for EFF's Certbot, which automates issuance and renewal of SSL-certificates on your own servers for domains that use Domeneshop's DNS service. This plugin is found in our Github repository here.

basicAuth

With the HTTP Basic Auth authentication method, the token is the username, and the secret is the password.

See above for instructions on how to generate credentials.

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Domains

List domains

Authorizations:
query Parameters
domain
string
Example: domain=.no

Only return domains whose domain field includes this string

Responses

200

Successful operation

get /domains
https://api.infra.domeneshop.no/v0/domains

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Find domain by ID

Authorizations:
path Parameters
domainId
required
integer

ID of the domain

Responses

200

Successful operation

get /domains/{domainId}
https://api.infra.domeneshop.no/v0/domains/{domainId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 1,
  • "domain": "example.com",
  • "expiry_date": "2020-05-29",
  • "registered_date": "2020-05-29",
  • "renew": true,
  • "registrant": "Ola Nordmann",
  • "status": "active",
  • "nameservers":
    [
    ],
  • "services":
    {
    }
}

DNS

These endpoints allow you to list, create and delete DNS records for any domain that has active DNS service.

List DNS records

Authorizations:
path Parameters
domainId
required
integer

ID of the domain

query Parameters
host
string
Example: host=www

Only return records whose host field matches this string

type
string
Example: type=A

Only return records whose type field matches this string

Responses

200

Successful operation

get /domains/{domainId}/dns
https://api.infra.domeneshop.no/v0/domains/{domainId}/dns

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Add DNS record

Authorizations:
path Parameters
domainId
required
integer

ID of the domain

Request Body schema: application/json
One of
  • A
  • AAAA
  • CNAME
  • MX
  • SRV
  • TXT
host
required
string

The host/subdomain the DNS record applies to

ttl
integer <int16> [ 60 .. 604800 ]
Default: 3600

TTL of DNS record in seconds. Must be a multiple of 60.

type
required
string
Value: "A"
data
required
string <ipv4>

IPv4 address

Responses

201

Successful operation

404

Domain domainId does not exist.

post /domains/{domainId}/dns
https://api.infra.domeneshop.no/v0/domains/{domainId}/dns

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "host": "@",
  • "ttl": 3600,
  • "type": "A",
  • "data": "192.168.0.1"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 1
}

Find DNS record by ID

Authorizations:
path Parameters
domainId
required
integer

ID of the domain

recordId
required
integer

ID of DNS record

Responses

200

Success

get /domains/{domainId}/dns/{recordId}
https://api.infra.domeneshop.no/v0/domains/{domainId}/dns/{recordId}

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "id": 1,
  • "host": "@",
  • "ttl": 3600,
  • "type": "A",
  • "data": "192.168.0.1"
}

Update DNS record by ID

Authorizations:
path Parameters
domainId
required
integer

ID of the domain

recordId
required
integer

ID of DNS record

Request Body schema: application/json
One of
  • A
  • AAAA
  • CNAME
  • MX
  • SRV
  • TXT
host
required
string

The host/subdomain the DNS record applies to

ttl
integer <int16> [ 60 .. 604800 ]
Default: 3600

TTL of DNS record in seconds. Must be a multiple of 60.

type
required
string
Value: "A"
data
required
string <ipv4>

IPv4 address

Responses

204

Successful operation

400

DNS record failed validation

404

DNS record does not exist

put /domains/{domainId}/dns/{recordId}
https://api.infra.domeneshop.no/v0/domains/{domainId}/dns/{recordId}

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "host": "@",
  • "ttl": 3600,
  • "type": "A",
  • "data": "192.168.0.1"
}

Delete DNS record by ID

Authorizations:
path Parameters
domainId
required
integer

ID of the domain

recordId
required
integer

ID of DNS record

Responses

204

DNS record is deleted

404

DNS record does not exist

delete /domains/{domainId}/dns/{recordId}
https://api.infra.domeneshop.no/v0/domains/{domainId}/dns/{recordId}

Dynamic DDNS (DDNS)

This group exposes endpoints that can be used by certain Dynamic DNS implementations found in consumer routers appliances.

Update

Update DNS using the "IP update protocol".

A DNS record for the given hostname will be created if it does not exist, or updated if it does. The record type (A or AAAA will automatically be detected).

If the DDNS implementation does not allow you to specify authentication, it can usually be specified inline in the URL:

  https://{token}:{secret}@api.domeneshop.no/v0/dyndns/update?hostname=example.com&myip=127.0.0.1
Authorizations:
query Parameters
hostname
required
string <hostname>
Example: hostname=www.example.com

The fully qualified domain (FQDN) to be updated, without trailing dot.

myip
string <ipv4|ipv6>

The new IPv4 or IPv6 address to set. If not provided, the IP of the client making the API request will be used.

Responses

204

Successful operation

404

Domain not found

get /dyndns/update
https://api.infra.domeneshop.no/v0/dyndns/update

HTTP Forwards

These endpoints allow you to list, create and delete HTTP forwards ("WWW forwarding") for any domain that has active DNS service.

While frame forwards (an <iframe> embed) are supported through setting the frame field, we strongly discourage the use of these. Use DNS records instead.

List forwards

List all forwards for the specified domain.

Authorizations:
path Parameters
domainId
required
integer

ID of the domain

Responses

200

Successful operation

get /domains/{domainId}/forwards/
https://api.infra.domeneshop.no/v0/domains/{domainId}/forwards/

Response samples

Content type
application/json
Copy
Expand all Collapse all
[]

Add forward

Create a forwarding for the specified domain, to a given URL.

The forward must not collide with any existing forwarding or DNS record of types A, AAAA, ANAME or CNAME.

Authorizations:
path Parameters
domainId
required
integer

ID of the domain

Responses

201

Successful operation

400

Invalid forward

409

The forward collides with an existing forwarding or DNS record

post /domains/{domainId}/forwards/
https://api.infra.domeneshop.no/v0/domains/{domainId}/forwards/

Find forward by host

Authorizations:
path Parameters
domainId
required
integer

ID of the domain

host
required
string
Example: www

Subdomain of the forward, @ for the root domain

Responses

200

Successful operation

404

Forward or domain not found

get /domains/{domainId}/forwards/{host}
https://api.infra.domeneshop.no/v0/domains/{domainId}/forwards/{host}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{}

Update forward by host

Update a forwarding for the specified domain, to a given URL.

The host field must not be changed. In that case, delete the existing forwarding and recreate it for the new host/subdomain.

Authorizations:
path Parameters
domainId
required
integer

ID of the domain

host
required
string
Example: www

Subdomain of the forward, @ for the root domain

Request Body schema: application/json
host
string

The subdomain this forward applies to, without the domain part.

For instance, www in the context of the example.com domain signifies a forward for www.example.com.

frame
boolean

Whether to enable frame forwarding using an iframe embed. NOT recommended for a variety of reasons.

url
string

The URL to forward to. Must include scheme, e.g. https:// or ftp://.

Responses

200

Successful operation

400

Invalid forward

404

Forward or domain not found

412

Forward host was modified

put /domains/{domainId}/forwards/{host}
https://api.infra.domeneshop.no/v0/domains/{domainId}/forwards/{host}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{}

Invoices

List invoices

List invoices for your account. Only invoices from the past 3 years are returned.

Authorizations:
query Parameters
status
string
Enum: "unpaid" "paid" "settled"
Example: status=paid

Only return invoices with this status

Responses

200

Successful operation

get /invoices
https://api.infra.domeneshop.no/v0/invoices

Response samples

Content type
application/json
Copy
Expand all Collapse all
[]

Find invoice by invoice number

Authorizations:
path Parameters
invoiceId
required
integer

An invoice number

Responses

200

Successful operation

404

Invoice not found

get /invoices/{invoiceId}
https://api.infra.domeneshop.no/v0/invoices/{invoiceId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 1,
  • "type": "invoice",
  • "amount": 120,
  • "currency": "NOK",