智能体

删除会话资源

从会话上移除一份附加资源。

先调用「创建会话」,用返回的会话 ID 替换示例 ID。 先调用「添加会话资源」,用返回的资源 ID 替换 sesrsc_123。

DELETE /agent/v1/sessions/{session_id}/resources/{resource_id}◐ 部分支持

请求参数

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • resource_idstring必填

    path: Id of a resource attached to the session, as returned by sessions.resources.add or sessions.resources.list.

  • session_idstring必填

    query: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

返回

200

支持 file 类型资源的持久化、查询和解除关联,单会话最多 500 条。文件须属于当前租户且有效。默认路径为 /mnt/session/uploads/<file_id>,自定义路径归一到该目录,拒绝父目录遍历。不修改文件内容;本批尚不将资源同步到沙箱。

错误按 Anthropic 错误格式返回(type / message / request_id),参见 错误码

响应

HTTP 200

Successful response

application/json

名称类型说明
idstringIdentifier of the object, as returned by the API; pass it in the path of follow-up calls on the same resource.
typestringAlways `session_resource_deleted`. Confirms that a resource was detached from the session.