Delete Session Resource
Call Create session first and replace the example session ID with its returned ID. Call Add session resource first and replace sesrsc_123 with its returned ID.
/agent/v1/sessions/{session_id}/resources/{resource_id}◐ PartialRequest parameters
session_idstringrequiredpath: 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_idstringrequiredpath: Id of a resource attached to the session, as returned by sessions.resources.add or sessions.resources.list.
session_idstringrequiredquery: 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.
Returns
200
Supports persistence, retrieval and removal of file resource references, up to 500 per session. Files must be live and owned by the current tenant. Paths default to /mnt/session/uploads/<file_id>; custom paths are rooted there and parent traversal is rejected. File content is immutable through this API. Sandbox synchronization is not implemented in this batch.
Errors follow the Anthropic error format (type / message / request_id) — see error codes
Request
curl
# Call Create session first and replace the example session ID with its returned ID. Call Add session resource first and replace sesrsc_123 with its returned ID.
curl -X DELETE https://api.deepraxis.com/agent/v1/sessions/sesn_123/resources/sesrsc_123 \
-H "Authorization: Bearer $PRAXIS_API_KEY"Python
# Call Create session first and replace the example session ID with its returned ID. Call Add session resource first and replace sesrsc_123 with its returned ID.
import requests
opts = dict(
base_url="https://api.deepraxis.com/agent",
api_key="$PRAXIS_API_KEY",
)
# /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
resp = requests.delete(
f"{opts['base_url']}/v1/sessions/sesn_123/resources/sesrsc_123",
headers={"Authorization": f"Bearer {opts['api_key']}"},
)
print(resp.status_code, resp.json())TypeScript
// Call Create session first and replace the example session ID with its returned ID. Call Add session resource first and replace sesrsc_123 with its returned ID.
const opts = {
baseURL: "https://api.deepraxis.com/agent",
apiKey: "$PRAXIS_API_KEY",
};
// /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
const resp = await fetch(`${opts.baseURL}/v1/sessions/sesn_123/resources/sesrsc_123`, {
method: "DELETE",
headers: { Authorization: `Bearer ${opts.apiKey}`, "Content-Type": "application/json" },
});
console.log(resp.status, await resp.json());Response 200
{
"id": "sesrsc_2ba1961e-e890-496b-a5e5-b20328a33faf",
"type": "session_resource_deleted"
}Response
HTTP 200
Successful response
application/json
| Name | Type | Description |
|---|---|---|
| id | string | Identifier of the object, as returned by the API; pass it in the path of follow-up calls on the same resource. |
| type | string | Always session_resource_deleted. Confirms that a resource was detached from the session. |