Skip to content
Open Console

Delete a file

1 min readUpdated

DELETE/v1/sessions/{session_id}/files/{file_id}

Delete a file from the session. Available even when the agent version lacks file support.

Generated from the Platform API specification on 2026-09-04.

Parameter Type Description
session_id string The session, as returned by Create a session.
file_id string The file, as returned by Prepare a file.
Header Required Description
Authorization yes Bearer plus a short-lived OAuth access token issued for the Tanomis API audience. Backends obtain tokens with an organization automation client; the CLI’s human login is not an application credential.
X-Organization-ID yes The organization_id from the workspace projection you selected in GET /v1/me/workspaces.
X-Workspace-Tenant-ID yes The nested tenant_id from the same projection. A header cannot widen what the token grants. Some single-workspace or self-hosted environments take X-Tenant-ID instead, as supplied by their administrator.
Status Meaning
204 The file was deleted.
404 No such file, or attachments are disabled.
Terminal
curl -X DELETE "https://api.tanomis.com/v1/sessions/ses_7d4f9c/files/file_b172c9" \
-H "Authorization: Bearer $TANOMIS_TOKEN" \
-H "X-Organization-ID: $TANOMIS_ORG" \
-H "X-Workspace-Tenant-ID: $TANOMIS_WORKSPACE"