Adding a Domain

This method adds a domain to your account

The instruction below shows how to add a domain to your account


Information below might be outdated - please visit our recently updated API Reference


Parameter nameTypeConstraintsDescription
hostnamestringrequiredhostname of your new domain (e.g.
linkTypestringrequiredlink generation algorithm (random/increment/secure)
caseSensitivebooleanoptionaltrue if links on this domain should by case-sensitive
hideRefererbooleanoptionaltrue if you don't want to show original referrers to destination URL
httpsLinksbooleanoptionalSet to true if you want short links to be generated with https. As soon as domain becomes configured we try to issue SSL certificate. If we succeed, we enable this option automatically
redirect404stringoptionalURL to redirect customers on non-existing short link
rootredirectstringoptionalURL to redirect customers on main page visit

  • Click "Create API key".
  • Add a Secret key.

2) Install prerequisites for requests.

pip install requests
npm install --save axios

Now everything is ready to run the following snippet. It will add a domain.

3) Create a file: .js/ .rb. Use the code snippet below.


Please, replace hostname with appropriate value.

import requests
url = ""
import json
payload = json.dumps({"hideReferer":False,"httpsLinks":False,"hostname":"","linkType":"random"})
headers = {
    'accept': "application/json",
    'content-type': "application/json",
    'authorization': "<<apiKey>>"
response = requests.request("POST", url, data=payload, headers=headers)
const axios = require('axios');
const data = {
const options = {
  headers: {
    accept: 'application/json',
    'content-type': 'application/json',
    authorization: '<<apiKey>>'
};'', data, options)
.then(function (response) {
.catch(function (response) {
require 'uri'
require 'net/http'
require 'openssl'
require 'json'
url = URI("")
http =, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request =
request["accept"] = 'application/json'
request["content-type"] = 'application/json'
request["authorization"] = '<<apiKey>>'
request.body = JSON.generate({"hideReferer":false,"httpsLinks":false,"hostname":"","linkType":"random"})
response = http.request(request)
puts response.read_body

4) Launch the file.

node filename.js
ruby filename.rb

5) JSON Response (the domain will be added).

Once you run the code, you will see the response.

  linkType: 'random',
  state: 'configured',(or not_configured)
  cloaking: false,
  setupType: 'dns',
  httpsLinks: false,
  id: 91576,
  hostname: '',
  UserId: 9346,
  updatedAt: '2020-04-23T10:22:47.010Z',
  createdAt: '2020-04-23T10:22:46.649Z',
  provider: null,
  unicodeHostname: '',
  clientStorage: null