Skip to main content
There is no endpoint to permanently delete a chat artifact from a session — artifacts are retained for the lifetime of the session that owns them. This endpoint does something narrower: it reverses a copy-to-platform call, removing an AI-generated artifact’s copy from the platform’s persistent file storage (Knowledge Base). The original chat artifact is unaffected and remains in the session.
string
required
The session ID the artifact belongs to
string
required
The artifact ID to remove from the Knowledge Base
Only artifacts with origin: "ai_generated" (files the agent produced during the conversation) can be managed this way — artifacts a user uploaded cannot be copied to or removed from the platform through this route.

Response

200 OK on success:

Error responses

object
Returned as {"error": "Only AI-generated artifacts can be managed"} when the artifact’s origin is not ai_generated.
object
Returned as {"error": "Artifact not found."} when no matching artifact exists, or {"error": "not_found_on_platform", "message": "Artifact is not saved to Knowledge Base"} when the artifact was never copied to the platform (or was already removed).

Copying an artifact to the Knowledge Base

This endpoint undoes POST /api/v1/sessions/{session_id}/artifacts/{artifact_id}/copy-to-platform/, which copies an AI-generated artifact into the platform’s persistent file storage so it survives beyond the session (optionally into a specific workspace via a version/workspace body field). That route isn’t covered in depth in this reference — see the Artifacts overview for the full endpoint table.