delete • AI Agent SDK

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

delete

Async

Method

</div>

This is a method of the OutboundMessengerProtocol class in the 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
async def delete(target: str, message_id: str) -> 'MessageActionResult'

Parameters

ParamField str

Symbolic target token (“origin”, “&lt;platform&gt;”, “&lt;platform&gt;:&lt;chat_id&gt;[:&lt;thread_id&gt;]”, or a friendly alias).

ParamField str

The id of the message to delete.

Returns

ResponseField 'MessageActionResult'

class:MessageActionResult describing the outcome.

Used By

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 3695