---
title: "CreateVirtualHostMapping"
method: POST
path: "/v1/vhost/mapping/"
tags: ["vhosts"]
---

# CreateVirtualHostMapping

`POST /v1/vhost/mapping/`

Create a new vhost mapping.

## Request body

- DtoCreateMapping
  - `hostname` string
  - `mappingSecurityRuleId` integer
  - `matchPattern` 'begins-with' | 'contains' | 'equals' | 'ends-with'
  - `path` string
  - `shouldUpgradeInsecureRequests` boolean
  - `targetHttpResponseCode` integer
  - `targetType` 'url' | 'service' | 'response-code' | 'inline-html' | 'static-files'
  - `targetValue` string

## Response `201`

MappingCreated

- object

## Changes

- **2025-04-01** `83ebfa3d0c56` — 1 info
  - endpoint added
- **2024-12-04** `d7ced1b11534` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/goinfinite/apis/osapi/changes/v1/vhost/mapping/post.md)

---

[API](https://skmtc.dev/goinfinite/apis/osapi.md) · [All operations](https://skmtc.dev/goinfinite/apis/osapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/goinfinite/osapi/revisions/7320a5d8ef9e/schema)
