SPB Git

Repository Public

update.md 5.4 KB 263 lines markdown

1---2title: Update Session Resource3url: https://platform.claude.com/docs/en/api/beta/sessions/resources/update4---56# Update Session Resource78**POST** `/v1/sessions/{session_id}/resources/{resource_id}`910Update Session Resource1112## Path parameters1314- `session_id: string`1516- `resource_id: string`1718## Headers1920- `"anthropic-beta": optional array of AnthropicBeta`2122  Optional header to specify the beta version(s) you want to use.2324  - `string`2526  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`2728    - `"message-batches-2024-09-24"`2930    - `"prompt-caching-2024-07-31"`3132    - `"computer-use-2024-10-22"`3334    - `"computer-use-2025-01-24"`3536    - `"pdfs-2024-09-25"`3738    - `"token-counting-2024-11-01"`3940    - `"token-efficient-tools-2025-02-19"`4142    - `"output-128k-2025-02-19"`4344    - `"files-api-2025-04-14"`4546    - `"mcp-client-2025-04-04"`4748    - `"mcp-client-2025-11-20"`4950    - `"dev-full-thinking-2025-05-14"`5152    - `"interleaved-thinking-2025-05-14"`5354    - `"code-execution-2025-05-22"`5556    - `"extended-cache-ttl-2025-04-11"`5758    - `"context-1m-2025-08-07"`5960    - `"context-management-2025-06-27"`6162    - `"model-context-window-exceeded-2025-08-26"`6364    - `"skills-2025-10-02"`6566    - `"fast-mode-2026-02-01"`6768    - `"output-300k-2026-03-24"`6970    - `"user-profiles-2026-03-24"`7172    - `"user-profiles-2026-08-18"`7374    - `"user-profiles-2026-09-04"`7576    - `"advisor-tool-2026-03-01"`7778    - `"managed-agents-2026-04-01"`7980    - `"cache-diagnosis-2026-04-07"`8182    - `"dreaming-2026-04-21"`8384    - `"thinking-token-count-2026-05-13"`8586    - `"server-side-fallback-2026-06-01"`8788    - `"server-side-fallback-2026-07-01"`8990    - `"fallback-credit-2026-06-01"`9192    - `"fallback-credit-2026-07-01"`9394    - `"agent-memory-2026-07-22"`9596    - `"mid-conversation-tool-changes-2026-07-01"`9798    - `"compact-2026-01-12"`99100    - `"computer-use-2025-11-24"`101102    - `"mcp-tunnels-2026-06-22"`103104    - `"structured-outputs-2025-11-13"`105106    - `"task-budgets-2026-03-13"`107108    - `"thinking-display-updates-2026-08-18"`109110    - `"ce-user-management-2026-07-13"`111112    - `"mid-conversation-output-config-2026-07-01"`113114    - `"thinking-binding-controls-2026-08-01"`115116    - `"mid-conversation-system-clear-at-2026-08-21"`117118    - `"compact-2026-09-04"`119120- `"anthropic-workspace-id": optional string`121122## Body parameters123124- `authorization_token: string`125126  New authorization token for the resource. Currently only `github_repository` resources support token rotation.127128  minLength: 1, maxLength: 4096129130## Returns131132- `BetaManagedAgentsGitHubRepositoryResource object`133134  - `type: "github_repository"`135136  - `id: string`137138  - `created_at: string`139140    A timestamp in RFC 3339 format141142    format: date-time143144  - `mount_path: string`145146  - `updated_at: string`147148    A timestamp in RFC 3339 format149150    format: date-time151152  - `url: string`153154  - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout or null`155156    - `BetaManagedAgentsBranchCheckout object`157158      - `type: "branch"`159160      - `name: string`161162        Branch name to check out.163164        minLength: 1, maxLength: 255165166    - `BetaManagedAgentsCommitCheckout object`167168      - `type: "commit"`169170      - `sha: string`171172        Full commit SHA to check out.173174        minLength: 7, maxLength: 64175176- `BetaManagedAgentsFileResource object`177178  - `type: "file"`179180  - `id: string`181182  - `created_at: string`183184    A timestamp in RFC 3339 format185186    format: date-time187188  - `file_id: string`189190  - `mount_path: string`191192  - `updated_at: string`193194    A timestamp in RFC 3339 format195196    format: date-time197198- `BetaManagedAgentsMemoryStoreResource object`199200  A memory store attached to an agent session.201202  - `type: "memory_store"`203204  - `memory_store_id: string`205206    The memory store ID (memstore_...). Must belong to the caller's organization and workspace.207208  - `access: optional "read_write" or "read_only" or null`209210    Access mode for an attached memory store.211212    - `"read_write"`213214    - `"read_only"`215216  - `description: optional string`217218    Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.219220  - `instructions: optional string or null`221222    Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.223224    maxLength: 4096225226  - `mount_path: optional string or null`227228    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.229230  - `name: optional string or null`231232    Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.233234## Example235236```bash237curl https://api.anthropic.com/v1/sessions/$SESSION_ID/resources/$RESOURCE_ID \238    -H 'Content-Type: application/json' \239    -H 'anthropic-version: 2023-06-01' \240    -H 'anthropic-beta: managed-agents-2026-04-01' \241    -H "X-Api-Key: $ANTHROPIC_API_KEY" \242    -d '{243          "authorization_token": "ghp_exampletoken"244        }'245```246247### Response (200)248249```json250{251  "id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu",252  "created_at": "2026-03-15T10:00:00Z",253  "mount_path": "/workspace/example-repo",254  "type": "github_repository",255  "updated_at": "2026-03-15T10:00:00Z",256  "url": "https://github.com/example-org/example-repo",257  "checkout": {258    "name": "main",259    "type": "branch"260  }261}262```263
Files main
Menu

Theme