Claude Platform Docs

Archiver un tunnel

$client->beta->tunnels->archive(string tunnelID, ?list<AnthropicBeta> betas, ?string workspaceID): BetaTunnel
POST/v1/tunnels/{tunnel_id}/archive

L'API Tunnels est en « research preview » (aperçu de recherche). Elle nécessite l'en-tête anthropic-beta: mcp-tunnels-2026-06-22 et peut changer sans période de dépréciation. Elle remplace les points de terminaison de l'Admin API situés sous /v1/organizations/tunnels, qui restent disponibles pendant une fenêtre de migration.

Archive un tunnel. L'archivage est irréversible : chaque certificat non archivé du tunnel est archivé au cours de la même opération, le nom d'hôte est retiré et n'est jamais réalloué, et le jeton du tunnel est invalidé. Une nouvelle tentative sur un tunnel déjà archivé renvoie l'enregistrement existant sans modification.

Parameters
tunnelID: string
betas?:optional list<AnthropicBeta>

Optional header to specify the beta version(s) you want to use.

workspaceID?:optional string
Returns
class BetaTunnel { $type = 'tunnel'; $id; $archivedAt; /* 3 more */ }
"tunnel" type
string id

Unique identifier for the tunnel, prefixed with tnl_.

?\Datetime archivedAt

A timestamp in RFC 3339 format

\Datetime createdAt

A timestamp in RFC 3339 format

?string displayName

Human-readable name for the tunnel (1-255 characters). Null if unset.

string domain

Anthropic-assigned hostname for the tunnel. MCP server URLs whose host is a subdomain of this value are routed through the tunnel. Globally unique and never reused, even after the tunnel is archived.

Archiver un tunnel
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(apiKey: 'my-anthropic-api-key');

$betaTunnel = $client->beta->tunnels->archive(
  'tunnel_id',
  betas: [AnthropicBeta::MESSAGE_BATCHES_2024_09_24],
  workspaceID: 'wrkspc_011CZkZaBF1tNoB5wlCeusgy',
);

var_dump($betaTunnel);
Returns Examples
Response 200
{
  "id": "id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "display_name": "display_name",
  "domain": "domain",
  "type": "tunnel"
}