Domains /
Add subdomain path
Required permission
Account > SubdomainPaths > General > Create
Path parameters
domain
string requiredName of the domainsubdomain
string requiredName of the subdomain
Request body
- {object}
mode
string requiredMode of the path, determining how the URI will be interpreted.one ofprefix, exact, regexuri
string requiredURI of the subdomain path. Interpreted according to the selected path modeoptions
{object}priority
integerIn case of uri conflicts, the route with the higher priority will take precedencemin0max100ignoreUriCase
booleanAllows case insensitive matching for 'prefix' and 'exact' modesrewrite
(multiple options: oneOf)Settings determining if a path should be rewritten. Either a uri or regex have to be specified.- {object}Rewrite with URI
uri
string requiredpattern^\/([_a-zA-Z0-9-&?=.]*)((\/[_a-zA-Z0-9-&?=.]+)*(\/)?)?$- {object}Rewrite with regex
regex
{object}match
string requiredRegex match for the given pathrewrite
string requiredRegex rewrite for the given matched pathtimeout
stringCustomised request timeout for the given path. By default no timeout is set.pattern^[1-9][0-9]*(s|ms)$headers
{object}Settings allowing addition, re-write and removal of request as well as response headers.request
{object}set
{object}add
{object}remove
[array]- stringpattern^[a-zA-Z0-9_\-%$+]+$
response
{object}set
{object}add
{object}remove
[array]- stringpattern^[a-zA-Z0-9_\-%$+]+$
corsPolicy
{object}Settings allowing for customization of CORS policies.enabled
boolean requiredallowOrigins
[array]- {object}
mode
string requiredMode of the path, determining how the URI will be interpreted.one ofprefix, exact, regexorigin
stringOrigin definition.allowMethods
[array]- stringone ofGET, POST, PUT, PATCH, DELETE, OPTIONS, TRACE, CONNECT, HEAD
allowCredentials
booleanallowHeaders
[array]- string
maxAge
stringpattern^[1-9][0-9]*(s|m|h)$retries
{object}Settings allowing for customization of retries.enabled
boolean requiredattempts
integer requiredmin1max3perTryTimeout
stringTimeout per attempt. By default uses the path level timeout.pattern^[1-9][0-9]*(s|ms)$retryOn
[array]Configure the cases in which the retry should be triggered.- stringone of5xx, gateway-error, reset, connect-failure, envoy-ratelimited, retriable-4xx, refused-stream, retriable-status-codes, retriable-headers, cancelled, deadline-exceeded, internal, resource-exhausted, unavailable
OR
Response body
- {object}Response object.
data
{object} requiredResult data.mode
string requiredMode of the path, determining how the URI will be interpreted.one ofprefix, exact, regexuri
string requiredURI of the subdomain path. Interpreted according to the selected path modeoptions
{object}priority
integerIn case of uri conflicts, the route with the higher priority will take precedencemin0max100ignoreUriCase
booleanAllows case insensitive matching for 'prefix' and 'exact' modesrewrite
(multiple options: oneOf)Settings determining if a path should be rewritten. Either a uri or regex have to be specified.- {object}Rewrite with URI
uri
string requiredpattern^\/([_a-zA-Z0-9-&?=.]*)((\/[_a-zA-Z0-9-&?=.]+)*(\/)?)?$- {object}Rewrite with regex
regex
{object}match
string requiredRegex match for the given pathrewrite
string requiredRegex rewrite for the given matched pathtimeout
stringCustomised request timeout for the given path. By default no timeout is set.pattern^[1-9][0-9]*(s|ms)$headers
{object}Settings allowing addition, re-write and removal of request as well as response headers.request
{object}set
{object}add
{object}remove
[array]- stringpattern^[a-zA-Z0-9_\-%$+]+$
response
{object}set
{object}add
{object}remove
[array]- stringpattern^[a-zA-Z0-9_\-%$+]+$
corsPolicy
{object}Settings allowing for customization of CORS policies.enabled
boolean requiredallowOrigins
[array]- {object}
mode
string requiredMode of the path, determining how the URI will be interpreted.one ofprefix, exact, regexorigin
stringOrigin definition.allowMethods
[array]- stringone ofGET, POST, PUT, PATCH, DELETE, OPTIONS, TRACE, CONNECT, HEAD
allowCredentials
booleanallowHeaders
[array]- string
maxAge
stringpattern^[1-9][0-9]*(s|m|h)$retries
{object}Settings allowing for customization of retries.enabled
boolean requiredattempts
integer requiredmin1max3perTryTimeout
stringTimeout per attempt. By default uses the path level timeout.pattern^[1-9][0-9]*(s|ms)$retryOn
[array]Configure the cases in which the retry should be triggered.- stringone of5xx, gateway-error, reset, connect-failure, envoy-ratelimited, retriable-4xx, refused-stream, retriable-status-codes, retriable-headers, cancelled, deadline-exceeded, internal, resource-exhausted, unavailable
name
stringThe full URL including subdomain and path URI.createdAt
stringtime of creation
OR
POST /v1/domains/{domain}/subdomains/{subdomain}/paths
Example request
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"mode":"prefix","uri":"/","options":{"priority":0,"corsPolicy":{"allowOrigins":[{"mode":"prefix","origin":"https://example.com"}]}}}' \
https://api.northflank.com/v1/domains/{domain}/subdomains/{subdomain}/paths
Example response
200 OK
JSON
{
"data": {
"mode": "prefix",
"uri": "/",
"options": {
"priority": 0,
"corsPolicy": {
"allowOrigins": [
{
"mode": "prefix",
"origin": "https://example.com"
}
]
}
}
}
}
Example response
409 Conflict