> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# delete • AI Agent SDK

> delete: Delete/unsend a prior message this agent/session sent (Issue #5054).

# delete

<div className="flex items-center gap-2">
  <Badge color="blue">Async</Badge>
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**OutboundMessengerProtocol**](../classes/OutboundMessengerProtocol) class in the [**protocols**](../modules/protocols) module.

Delete/unsend a prior message this agent/session sent (Issue #5054).

Lets an agent retract a message it should not have sent. Gated on the
channel's `PlatformCapabilities.supports_delete`; a channel that
cannot delete returns a typed `unsupported` outcome instead of raising.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async def delete(target: str, message_id: str) -> 'MessageActionResult'
```

## Parameters

<ParamField query="target" type="str" required={true}>
  Symbolic target token ("origin", "\<platform>", "\<platform>:\<chat\_id>\[:\<thread\_id>]", or a friendly alias).
</ParamField>

<ParamField query="message_id" type="str" required={true}>
  The id of the message to delete.
</ParamField>

### Returns

<ResponseField name="Returns" type="'MessageActionResult'">
  class:`MessageActionResult` describing the outcome.
</ResponseField>

## Used By

* [`Knowledge.delete`](../functions/Knowledge-delete)
* [`Memory.delete_long_term`](../functions/Memory-delete_long_term)

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L3337">
  `praisonaiagents/gateway/protocols.py` at line 3337
</Card>
