Domains /
Assign service to subdomain
Assigns a service port to the given subdomain
Required permission
Account > Subdomains > General > Update
Path parameters
domain
string requiredName of the domainsubdomain
string requiredName of the subdomain
Request body
- {object}
serviceId
string requiredThe ID of the service to assign the subdomain to.pattern^[A-Za-z0-9-]+$projectId
string requiredThe ID of the project the service belongs to.pattern^[A-Za-z0-9-]+$portName
string requiredThe name of the port that will be assigned to the subdomain.min length1max length8pattern^[a-zA-Z](-?[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)?$
Response body
- {object}Response object.
data
{object} requiredResult data.
API
CLI
JS Client
POST /v1/domains/{domain}/subdomains/{subdomain}/assign
Example request
Request body
curl
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"serviceId":"example-service","projectId":"default-project","portName":"p01"}' \
https://api.northflank.com/v1/domains/{domain}/subdomains/{subdomain}/assign
Example response
200 OK
The operation was performed successfully.
JSON
{
"data": {}
}