トンネルトークンをローテーション
anthropic-beta: mcp-tunnels-2026-06-22. Learn how to send beta headers.Tunnels API はリサーチプレビュー段階です。anthropic-beta: mcp-tunnels-2026-06-22 ヘッダーが必要であり、非推奨期間を設けずに変更される可能性があります。この API は /v1/organizations/tunnels の Admin API エンドポイントに代わるものですが、移行期間中は従来のエンドポイントも引き続き利用できます。
トンネルのコネクタートークンをローテーションします。ローテーションにより、現在のトークンは新規接続に対して無効化され、新しい値が返されます。確立済みの接続は切断されません。ローテーション後に再起動されたコネクターは新しい値を使用する必要があります。
Parameters
ID of the tunnel (tnl_...).
params BetaTunnelRotateTokenParams
Reason param.Opt[string] OptionalOptional free-text reason for the rotation, recorded for audit.
Optional free-text reason for the rotation, recorded for audit.
Betas []AnthropicBeta OptionalHeader parameterThis endpoint is in beta: requests must send mcp-tunnels-2026-06-22 in this header.
This endpoint is in beta: requests must send mcp-tunnels-2026-06-22 in this header.
const AnthropicBetaMessageBatches2024_09_24 AnthropicBeta = "message-batches-2024-09-24"Deprecated
const AnthropicBetaPromptCaching2024_07_31 AnthropicBeta = "prompt-caching-2024-07-31"Deprecated
const AnthropicBetaPDFs2024_09_25 AnthropicBeta = "pdfs-2024-09-25"Deprecated
const AnthropicBetaTokenCounting2024_11_01 AnthropicBeta = "token-counting-2024-11-01"Deprecated
const AnthropicBetaTokenEfficientTools2025_02_19 AnthropicBeta = "token-efficient-tools-2025-02-19"Deprecated
const AnthropicBetaFilesAPI2025_04_14 AnthropicBeta = "files-api-2025-04-14"Deprecated
const AnthropicBetaExtendedCacheTTL2025_04_11 AnthropicBeta = "extended-cache-ttl-2025-04-11"Deprecated
const AnthropicBetaSkills2025_10_02 AnthropicBeta = "skills-2025-10-02"Deprecated
const AnthropicBetaCacheDiagnosis2026_04_07 AnthropicBeta = "cache-diagnosis-2026-04-07"Deprecated
const AnthropicBetaCEUserManagement2026_07_13 AnthropicBeta = "ce-user-management-2026-07-13"Deprecated
WorkspaceID param.Opt[string] OptionalHeader parameterOptional header to select the Workspace for this request. The value is a Workspace ID (for example, wrkspc_011CZkZaBF1tNoB5wlCeusgy).
Optional header to select the Workspace for this request. The value is a Workspace ID (for example, wrkspc_011CZkZaBF1tNoB5wlCeusgy).
Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.
Returns
type BetaTunnelToken struct { Type: "tunnel_token"; ID; TunnelToken }A tunnel's connector token.
A tunnel's connector token.
Stable identifier for the current token value. Changes when the token is rotated.
The connector token used to run the tunnel. Treat as a credential.
package main
import (
"context"
"fmt"
"github.com/anthropics/anthropic-sdk-go/v2"
"github.com/anthropics/anthropic-sdk-go/v2/option"
)
func main() {
client := anthropic.NewClient(
option.WithAPIKey("my-anthropic-api-key"),
)
betaTunnelToken, err := client.Beta.Tunnels.RotateToken(
context.TODO(),
"tunnel_id",
anthropic.BetaTunnelRotateTokenParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", betaTunnelToken.ID)
}{
"id": "id",
"tunnel_token": "tunnel_token",
"type": "tunnel_token"
}Returns Examples
{
"id": "id",
"tunnel_token": "tunnel_token",
"type": "tunnel_token"
}