Skip to main content

forwards_v2

GoDaddy Domains v2 API, scoped to a customer: customer_id is resolved from the GODADDY_CUSTOMER_ID environment variable when set, otherwise it is a required parameter (a WHERE value always wins). Accepts a Personal Access Token (Bearer) or a classic sso-key credential.

Overview

Nameforwards_v2
TypeResource
Idgodaddy.dns.forwards_v2

Fields

The following fields are returned by SELECT queries:

Request was successful

NameDatatypeDescription
fqdnstringThe fqdn (domain or sub domain) to forward (ex somedomain.com or sub.somedomain.com)
maskobject
typestringThe type of forwarding to implement - MASKED — Prevents the forwarded domain or subdomain URL from displaying in the browser's address bar. - REDIRECT_PERMANENT (default) — Redirects to the url specified in the forwardTo field using a 301 Moved Permanently HTTP response. Tells user-agents (including search engines) that the location has permanently moved. - REDIRECT_TEMPORARY — Redirects to the url specified in the forwardTo field using a 302 Found HTTP response. Tells user-agents (including search engines) that the location has temporarily moved. (MASKED, REDIRECT_PERMANENT, REDIRECT_TEMPORARY) (default: REDIRECT_PERMANENT)
urlstring (url)Forwards http(s) traffic to this destination url (ex. http://www.somedomain.com/)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectfqdn, customer_idinclude_subsReturns the forwarding configuration for the FQDN including destination URL and redirect type. Returns 404 if no forwarding rule exists.
createinsertfqdn, type, url, customer_idCreates or replaces the forwarding configuration for the FQDN. Idempotent - replaying the same request produces the same rule. Returns 204 No Content.
replaceupdatefqdn, type, url, customer_idUpdates the forwarding configuration for the FQDN. Only fields included in the request are modified. Returns 204 No Content.
deletedeletefqdn, customer_idRemoves the forwarding configuration for the FQDN. Returns 204 No Content.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
customer_idstring (uuid)GoDaddy customer identifier (UUID, not the numeric shopper number). Resolved from the GODADDY_CUSTOMER_ID environment variable when it is set (server variable, x-stackQL-envVar); otherwise required on every method of this resource. A WHERE value always takes precedence over the environment. API resellers acting on behalf of a subaccount pass the subaccount customer identifier.
fqdnstringThe fully qualified domain name whose forwarding details are to be deleted.
include_subsbooleanOptionally include all sub domains if the fqdn specified is a domain and not a sub domain. (wire: includeSubs)

SELECT examples

Returns the forwarding configuration for the FQDN including destination URL and redirect type. Returns 404 if no forwarding rule exists.

SELECT
fqdn,
mask,
type,
url
FROM godaddy.dns.forwards_v2
WHERE fqdn = '{{ fqdn }}' -- required
AND customer_id = '{{ customer_id }}' -- required unless GODADDY_CUSTOMER_ID is set
AND include_subs = '{{ include_subs }}'
;

INSERT examples

Creates or replaces the forwarding configuration for the FQDN. Idempotent - replaying the same request produces the same rule. Returns 204 No Content.

INSERT INTO godaddy.dns.forwards_v2 (
type,
url,
mask,
fqdn
)
SELECT
'{{ type }}' /* required */,
'{{ url }}' /* required */,
'{{ mask }}',
'{{ fqdn }}'
;

UPDATE examples

Updates the forwarding configuration for the FQDN. Only fields included in the request are modified. Returns 204 No Content.

UPDATE godaddy.dns.forwards_v2
SET
type = '{{ type }}',
url = '{{ url }}',
mask = '{{ mask }}'
WHERE
fqdn = '{{ fqdn }}' --required
AND type = '{{ type }}' --required
AND url = '{{ url }}' --required;

DELETE examples

Removes the forwarding configuration for the FQDN. Returns 204 No Content.

DELETE FROM godaddy.dns.forwards_v2
WHERE fqdn = '{{ fqdn }}' --required
AND customer_id = '{{ customer_id }}' -- required unless GODADDY_CUSTOMER_ID is set
;