> For the complete documentation index, see [llms.txt](https://docs.patagon.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.patagon.ai/en/api-reference/agents.md).

# Agents

Manage your agents.

## Send an outbound message

> Send an outbound message through a specified channel (WhatsApp, SMS, etc.)

```json
{"openapi":"3.0.0","info":{"title":"PatagonAI API v1","version":"1.0"},"tags":[{"name":"Agents","description":"Manage your agents."}],"servers":[{"url":"https://api.patagon.ai"}],"paths":{"/v1/organizations/{organizationId}/agents/{agentId}/outbound":{"post":{"summary":"Send an outbound message","operationId":"sendOutboundMessage","tags":["Agents"],"description":"Send an outbound message through a specified channel (WhatsApp, SMS, etc.)","parameters":[{"in":"path","name":"organizationId","required":true,"schema":{"type":"string"},"description":"The public ID of the organization"},{"in":"path","name":"agentId","required":true,"schema":{"type":"string"},"description":"The public ID of the agent"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["lead","template","communicationPolicy"],"properties":{"lead":{"type":"object","required":["firstName","lastName","phone","email","permissions"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string","format":"email"},"permissions":{"type":"string"},"preferences":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}}},"template":{"type":"object","required":["data"],"description":"Either id or name must be present","properties":{"id":{"type":"string"},"name":{"type":"string"},"languageCode":{"type":"string","description":"The language code of the template. It will try to get it from the template if not provided."},"data":{"type":"array","items":{"type":"object","required":["name","example","index"],"properties":{"name":{"type":"string","description":"The name of the variable. Must be unique."},"value":{"type":"string"},"property":{"type":"string"},"contentLocation":{"type":"string","enum":["body","header","footer"],"default":"body"},"index":{"type":"number"}}}}}},"communicationPolicy":{"type":"object","properties":{"contactMethod":{"type":"string","enum":["whatsapp"],"default":"whatsapp"},"outboundMessageLimit":{"type":"number"},"contactWindow":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}}},"timezone":{"type":"string"}}}}}}}},"responses":{"200":{"description":"Message sent successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"message":{"type":"string"},"sessionId":{"type":"string"}}}}}},"400":{"description":"Bad request or unable to send message","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Organization or agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.patagon.ai/en/api-reference/agents.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
