---
title: "Assign service to subdomain"
method: POST
path: "/v1/domains/{domain}/subdomains/{subdomain}/assign"
tags: ["Domains"]
---

# Assign service to subdomain

`POST /v1/domains/{domain}/subdomains/{subdomain}/assign`

## Request

- Base URL: `https://placeholder/v1`
- URL: `https://placeholder/v1/v1/domains/{domain}/subdomains/{subdomain}/assign`
- Auth: none required
- TypeScript: <https://skmtc.dev/northflank/apis/northflank-api/docs/v1/domains/:domain/subdomains/:subdomain/assign/post.ts> (a function with typed inputs; its response is checked against the schema)

Assigns a service port to the given subdomain

## Path parameters

- `domain` string, required: Name of the domain
- `subdomain` string, required: Name of the subdomain

## Request body

- object
  - `serviceId` string, required: The ID of the service to assign the subdomain to.
  - `projectId` string, required: The ID of the project the service belongs to.
  - `portName` string, required: The name of the port that will be assigned to the subdomain.

## Response `200`

The operation was performed successfully.

---

[API](https://skmtc.dev/northflank/apis/northflank-api.md) - [All operations](https://skmtc.dev/northflank/apis/northflank-api/llms.txt) - [OpenAPI document](https://skmtc.dev/northflank/apis/northflank-api/revisions/6511db980148?raw)
