Claude Platform Docs

取得工作階段資源

$client->beta->sessions->resources->retrieve(string resourceID, string sessionID, ?list<AnthropicBeta> betas, ?string workspaceID): ResourceGetResponse
GET/v1/sessions/{session_id}/resources/{resource_id}

取得工作階段資源

Parameters
sessionID: string
resourceID: string
betas?:optional list<AnthropicBeta>

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

workspaceID?:optional string
Returns
One of the following:
class ManagedAgentsGitHubRepositoryResource { $type; $id; $createdAt; /* 4 more */ }
Type type
string id
\Datetime createdAt

A timestamp in RFC 3339 format

string mountPath
\Datetime updatedAt

A timestamp in RFC 3339 format

string url
?Checkout checkout
class ManagedAgentsFileResource { $type; $id; $createdAt; /* 3 more */ }
Type type
string id
\Datetime createdAt

A timestamp in RFC 3339 format

string fileID
string mountPath
\Datetime updatedAt

A timestamp in RFC 3339 format

class ManagedAgentsMemoryStoreResource { $type; $memoryStoreID; $access; /* 4 more */ }
Type type
string memoryStoreID

The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

?Access access

Access mode for an attached memory store.

?string description

Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.

?string instructions

Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

?string mountPath

Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only.

?string name

Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.

取得工作階段資源
<?php

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

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

$resource = $client->beta->sessions->resources->retrieve(
  'sesrsc_011CZkZBJq5dWxk9fVLNcPht',
  sessionID: 'sesn_011CZkZAtmR3yMPDzynEDxu7',
  betas: [AnthropicBeta::MESSAGE_BATCHES_2024_09_24],
  workspaceID: 'wrkspc_011CZkZaBF1tNoB5wlCeusgy',
);

var_dump($resource);
Returns Examples
Response 200
{
  "id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu",
  "created_at": "2026-03-15T10:00:00Z",
  "mount_path": "/workspace/example-repo",
  "type": "github_repository",
  "updated_at": "2026-03-15T10:00:00Z",
  "url": "https://github.com/example-org/example-repo",
  "checkout": {
    "name": "main",
    "type": "branch"
  }
}