Claude Platform Docs

Delete Session

$client->beta->sessions->delete(string sessionID, ?list<AnthropicBeta> betas, ?string workspaceID): BetaManagedAgentsDeletedSession
DELETE/v1/sessions/{session_id}
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers

Delete Session

Parameters
sessionID: string⁠Path parameter
betas?: optional list<AnthropicBeta>⁠Header parameter

This endpoint is in beta: requests must send managed-agents-2026-04-01 in this header.

workspaceID?: optional string⁠Header parameter

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
class BetaManagedAgentsDeletedSession { $type = 'session_deleted'; $id; }
"session_deleted" type
string id
Delete Session
<?php

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

use Anthropic\Client;
use Anthropic\Beta\AnthropicBeta;

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

$betaManagedAgentsDeletedSession = $client->beta->sessions->delete(
  'sesn_011CZkZAtmR3yMPDzynEDxu7',
  betas: [AnthropicBeta::MESSAGE_BATCHES_2024_09_24],
  workspaceID: 'wrkspc_011CZkZaBF1tNoB5wlCeusgy',
);

var_dump($betaManagedAgentsDeletedSession);
Returns Examples
Response 200
{
  "id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
  "type": "session_deleted"
}