Skip to main content

resources

Creates, updates, deletes, gets or lists a resources resource.

Overview​

Nameresources
TypeResource
Idanthropic.sessions.resources

Fields​

The following fields are returned by SELECT queries:

Successful response (OK)

NameDatatypeDescription
idstring
namestringDisplay name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.
file_idstring
memory_store_idstringThe memory store ID (memstore_...). Must belong to the caller's organization and workspace.
accessstringAccess mode for the mounted store. Defaults to `read_write`. `read_only` mounts the store as a read-only filesystem. (read_write, read_only)
▶checkoutobject
created_atstring (date-time)A timestamp in RFC 3339 format
descriptionstringDescription of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.
instructionsstringPer-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.
mount_pathstring
typestring (github_repository)
updated_atstring (date-time)A timestamp in RFC 3339 format
urlstring

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsession_id, resource_idanthropic-workspace-id
listselectsession_idanthropic-workspace-id
updateupdatesession_id, resource_id, authorization_tokenanthropic-workspace-id
deletedeletesession_id, resource_idanthropic-workspace-id
addexecsession_id, type, file_idanthropic-workspace-id

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
resource_idstringPath parameter resource_id (example: sesrsc_011CZkZBJq5dWxk9fVLNcPht)
session_idstringPath parameter session_id (example: sesn_011CZkZAtmR3yMPDzynEDxu7)
anthropic-workspace-idstringOptional 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. (example: wrkspc_011CZkZaBF1tNoB5wlCeusgy)

SELECT examples​

Successful response (OK)

SELECT
id,
name,
file_id,
memory_store_id,
access,
checkout,
created_at,
description,
instructions,
mount_path,
type,
updated_at,
url
FROM anthropic.sessions.resources
WHERE session_id = '{{ session_id }}' -- required
AND resource_id = '{{ resource_id }}' -- required
AND "anthropic-workspace-id" = '{{ anthropic-workspace-id }}'
;

UPDATE examples​

No description available.

UPDATE anthropic.sessions.resources
SET
authorization_token = '{{ authorization_token }}'
WHERE
session_id = '{{ session_id }}' --required
WHERE resource_id = '{{ resource_id }}' --required
AND authorization_token = '{{ authorization_token }}' --required
AND "anthropic-workspace-id" = '{{ anthropic-workspace-id}}'
RETURNING
id,
name,
file_id,
memory_store_id,
access,
checkout,
created_at,
description,
instructions,
mount_path,
type,
updated_at,
url;

DELETE examples​

No description available.

DELETE FROM anthropic.sessions.resources
WHERE session_id = '{{ session_id }}' --required
AND resource_id = '{{ resource_id }}' --required
AND "anthropic-workspace-id" = '{{ anthropic-workspace-id }}'
;

Lifecycle Methods​

Successful response (OK)

EXEC anthropic.sessions.resources.add
@session_id='{{ session_id }}' --required,
@anthropic-workspace-id='{{ anthropic-workspace-id }}'
@@json=
'{
"type": "{{ type }}",
"file_id": "{{ file_id }}",
"mount_path": "{{ mount_path }}"
}'
;