from line 1
1---
2title: Rotate Tunnel Token
3url: https://platform.claude.com/docs/en/api/beta/tunnels/rotate_token
4---
1# Rotate Tunnel Token
52
6## Rotate Tunnel Token
3**POST** `/v1/tunnels/{tunnel_id}/rotate_token`
74
8**post** `/v1/tunnels/{tunnel_id}/rotate_token`
9
105The Tunnels API is in research preview. It requires the `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.
116
127Rotates a tunnel's connector token. Rotation invalidates the current token for new connections and returns a fresh value; established connections are not severed. A connector restarted after rotation must use the new value.
138
14### Path Parameters
9## Path parameters
1510
1611- `tunnel_id: string`
1712
18### Header Parameters
13## Headers
1914
2015- `"anthropic-beta": optional array of AnthropicBeta`
2116
from line 88
9388
9489 - `"mid-conversation-tool-changes-2026-07-01"`
9590
96### Body Parameters
91## Body parameters
9792
9893- `reason: optional string or null`
9994
10095 Optional free-text reason for the rotation, recorded for audit.
10196
102### Returns
97 maxLength: 1024
10398
104- `BetaTunnelToken object { id, tunnel_token, type }`
99## Returns
105100
101- `BetaTunnelToken object`
102
106103 A tunnel's connector token.
107104
108105 - `id: string`
from line 112
115112
116113 - `type: "tunnel_token"`
117114
118 - `"tunnel_token"`
115## Example
119116
120### Example
121
122```http
117```bash
123118curl https://api.anthropic.com/v1/tunnels/$TUNNEL_ID/rotate_token \
124119 -H 'Content-Type: application/json' \
125120 -H 'anthropic-version: 2023-06-01' \
from line 123
128123 -d '{}'
129124```
130125
131#### Response
126### Response (200)
132127
133128```json
134129{
No line in this hunk matches that.