---
title: "Delete an object the agent created in a chat (session owner only)"
method: DELETE
path: "/agents/sessions/{session_id}/actions/{action_id}"
tags: ["AI", "Agents"]
---

# Delete an object the agent created in a chat (session owner only)

`DELETE /agents/sessions/{session_id}/actions/{action_id}`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/agents/sessions/{session_id}/actions/{action_id}`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

Queues the product's own trash job for the object, as the caller, and returns its job id (read it with job wait; a dependent or a running pipeline refuses inside the job). Only objects the chat created (created=true); dataset, view, empty folder and dashboard. 409 when the object is already gone.

## Path parameters

- `session_id` string, required
- `action_id` integer, required

## Response `202`

Request accepted, processing continues off-line

- AgentActionDeleteResponse
  - `job_id` integer, required
  - `kind` string, required
  - `object_id` integer, required

## Other responses

- `400`: Bad request syntax or unsupported method
- `403`: Request forbidden -- authorization will not help

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/5dfd1c296ded?raw)
