---
title: "🛡️ Update the UPnP port mapping setting."
method: PUT
path: "/api/v1/port-mapper/settings"
tags: ["Remote Access"]
---

# 🛡️ Update the UPnP port mapping setting.

`PUT /api/v1/port-mapper/settings`

Enables or disables automatic port forwarding. Enabling maps the port immediately when the Remote Access listener is already running.<br /><hr /><h3>🛡️ Requires Capabilities: <code>ServerSettings.Update</code></h3>

## Request body

- UpdatePortMapperSettingsDto
  - `enabled` boolean, required — Whether to automatically forward the Remote Access port with UPnP. Only works with host networking.

## Response `200`

- PortMapperStatusResponse
  - `state` 'disabled' | 'not_attempted' | 'active' | 'failed', required
  - `reason` string — Why the mapping failed. Only present when the state is failed.
  - `externalIp` string, nullable — The router-reported external IP. Only present when the state is active.
  - `externalPort` number — Only present when the state is active.
  - `internalPort` number — Only present when the state is active.
  - `leaseExpiresAt` string — ISO timestamp. Only present when the state is active.
  - `lastAttemptAt` string — ISO timestamp. Only present when the state is failed.

## Other responses

- `401` — Possible reasons: The authorization token is invalid.
- `403` — Possible reasons: The user does not have sufficent capabilities.

## Changes

- **2026-08-14** `c3d02ccf7004` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/cardinalapps/apis/cardinal-media-server-api/changes/api/v1/port-mapper/settings/put.md)

---

[API](https://skmtc.dev/cardinalapps/apis/cardinal-media-server-api.md) · [All operations](https://skmtc.dev/cardinalapps/apis/cardinal-media-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cardinalapps/cardinal-media-server-api/revisions/7b5e4555e84f/schema)
