Skip to main content

Update Domain

This request updates a domain, targeted by secure ID.

patch /shortener/domains/{domain_sid}
put /shortener/domains/{domain_sid}

Sample

A sample PATCH request to update the Domain object, targeted by secure ID, with the values in the request body:

curl -X PATCH \
'https://api.carrierx.com/core/v2/shortener/domains/a0625551-63de-428e-889d-2d467b4e77a3' \
-H 'Content-Type: application/json' \
--data-binary '{"domain_name":"mywebsite.com"}' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'

Response

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

{
"domain_name": "mywebsite.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
}

A Domain object can be updated using either a PATCH or PUT request.

  • A PATCH request can be used to update one or more attribute values. When using a PATCH request, only the attributes specified in the request payload will be updated, all other attributes and values will remain the same. The domain secure ID is passed in the query URL, and the values to be modified are passed in the request body.

  • A PUT request can be used to update an entire Domain object. The domain secure ID is passed in the query URL, and the entire Domain object is passed in the request body.

note

Note, while all the fields must be present in a PUT request, not all the attribute values may be modified after the initial creation, because when created, some of them become read-only.

Required Scopes

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

  • shortener.manage
  • shortener.update

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.

Path Arguments

ParameterData TypeDescription
domain_sid requiredstringThe domain secure ID.

Body Arguments

JSON representation of the fields and values to be updated.

Fields that can be modified are:

  • domain_name
  • expired_mode
  • expired_page
  • expired_status_code
  • minimum_length
  • not_found_mode
  • not_found_page
  • not_found_status_code
  • scope
  • secure
  • suffix_pattern

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