取得工作階段資源
anthropic-beta: managed-agents-2026-04-01. Learn how to send beta headers.取得工作階段資源
Parameters
params BetaSessionResourceGetParams
Betas []AnthropicBeta OptionalHeader parameterThis endpoint is in beta: requests must send managed-agents-2026-04-01 in this header.
This endpoint is in beta: requests must send managed-agents-2026-04-01 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 BetaSessionResourceGetResponseUnion interface{…}The requested session resource.
The requested session resource.
type BetaManagedAgentsGitHubRepositoryResource struct { Type: "github_repository"; ID; CreatedAt; /* 4 more */ }
type BetaManagedAgentsFileResource struct { Type: "file"; ID; CreatedAt; /* 3 more */ }
CreatedAt TimeA timestamp in RFC 3339 format
A timestamp in RFC 3339 format
UpdatedAt TimeA timestamp in RFC 3339 format
A timestamp in RFC 3339 format
type BetaManagedAgentsMemoryStoreResource struct { Type: "memory_store"; MemoryStoreID; Access; /* 4 more */ }A memory store attached to an agent session.
A memory store attached to an agent session.
MemoryStoreID stringThe memory store ID (memstore_...). Must belong to the caller's organization and workspace.
The memory store ID (memstore_...). Must belong to the caller's organization and workspace.
Access BetaManagedAgentsMemoryStoreResourceAccess OptionalAccess mode for the mounted store. Defaults to read_write. read_only mounts the store as a read-only filesystem.
Access mode for the mounted store. Defaults to read_write. read_only mounts the store as a read-only filesystem.
Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.
Instructions string OptionalPer-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.
Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.
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.
Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.
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"),
)
resource, err := client.Beta.Sessions.Resources.Get(
context.TODO(),
"sesrsc_011CZkZBJq5dWxk9fVLNcPht",
anthropic.BetaSessionResourceGetParams{
SessionID: "sesn_011CZkZAtmR3yMPDzynEDxu7",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", resource)
}{
"id": "sesrsc_011CZkZCKr6eXym1gWMPdQiu",
"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"
}
}Returns Examples
{
"id": "sesrsc_011CZkZCKr6eXym1gWMPdQiu",
"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"
}
}