> ## 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.

# enqueue • AI Agent SDK

> enqueue: Persist an outbound message for delivery.

# enqueue

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

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

Persist an outbound message for delivery.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async def enqueue(idempotency_key: str, target: str, payload: Dict[str, Any], metadata: Optional[Dict[str, Any]]) -> str
```

## Parameters

<ParamField query="idempotency_key" type="str" required={true}>
  Unique key to prevent duplicate sends
</ParamField>

<ParamField query="target" type="str" required={true}>
  Target channel identifier (e.g., "telegram:12345")
</ParamField>

<ParamField query="payload" type="Dict[str, Any]" required={true}>
  Message payload to deliver
</ParamField>

<ParamField query="metadata" type="Optional" required={false}>
  Optional metadata for tracking/routing
</ParamField>

### Returns

<ResponseField name="Returns" type="str">
  Unique entry key for tracking this message
</ResponseField>

## Source

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