Skip to main content

Create Domain

This request creates a Domain object.

post /shortener/domains

Sample

A sample POST request to create a domain:

curl -X POST \
'https://api.carrierx.com/core/v2/shortener/domains' \
-H "Content-Type: application/json" \
--data-binary '{"domain_name":"newdomain.com"}' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'

Response

200 status code with a serialized copy of the Domain object:

{
"domain_name": "newdomain.com",
"domain_sid": "a0625551-63de-428e-889d-2d467b4e77a3",
"expired_mode": "redirect_temporary",
"expired_page": null,
"expired_status_code": null,
"minimum_length": 6,
"not_found_mode": "redirect_temporary",
"not_found_page": null,
"not_found_status_code": null,
"partner_sid": "e00430c3-a7d0-4666-ab5c-f7202448382f",
"scope": "children",
"secure": "disabled",
"suffix_pattern": null
}

Required Scopes

To create a Domain object, the partner must have one of the following scopes enabled:

  • shortener.manage
  • shortener.create

To set the expired_mode and not_found_mode fields value to proxy_pass, the partner must additionally have the shortener.allow_domain_mode_proxypass scope enabled.

To set the secure field value to required, the partner must additionally have the shortener.allow_domain_secure_required scope enabled.

Body Arguments

JSON representation of the fields and values of the Domain object to be created.

A required field to create a domain is domain_name.

Refer to this table to view all fields that appear in the Domain object.