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

# Messages

Endpoints for sending and managing messages

## Send Message

> Send a message via the messaging API. Supports text, media, and template messages with automatic routing to marketing messages endpoint when applicable. Supports MM API fallback mechanism, more info: <https://docs.360dialog.com/partner/messaging-and-calling/sending-marketing-messages/technical-details-for-mm-api>.

```json
{"openapi":"3.1.0","info":{"title":"Messaging API","version":"1.46.8"},"tags":[{"name":"Messages","description":"Endpoints for sending and managing messages"}],"servers":[{"description":"Production server","url":"https://waba-v2.360dialog.io"}],"security":[{"D360-API-KEY":[]}],"components":{"securitySchemes":{"D360-API-KEY":{"description":"API Key for Messaging API authentication. Send your API key in the D360-API-KEY header.","in":"header","name":"D360-API-KEY","type":"apiKey"}},"schemas":{"messages.Message":{"properties":{"audio":{"$ref":"#/components/schemas/messages.MediaObject"},"context":{"$ref":"#/components/schemas/messages.MessageContext"},"document":{"$ref":"#/components/schemas/messages.MediaObject"},"image":{"$ref":"#/components/schemas/messages.MediaObject"},"interactive":{"$ref":"#/components/schemas/messages.InteractiveObject"},"location":{"$ref":"#/components/schemas/messages.LocationMessage"},"messaging_product":{"type":"string"},"reaction":{"$ref":"#/components/schemas/messages.ReactionMessage"},"recipient_type":{"enum":["individual","group"],"type":"string"},"sticker":{"$ref":"#/components/schemas/messages.MediaObject"},"template":{"$ref":"#/components/schemas/messages.TemplateMessage"},"text":{"$ref":"#/components/schemas/messages.TextMessage"},"to":{"type":"string"},"type":{"enum":["text","image","audio","video","document","sticker","location","contacts","interactive","template","reaction"],"type":"string"},"video":{"$ref":"#/components/schemas/messages.MediaObject"}},"required":["messaging_product","recipient_type","to","type"],"type":"object"},"messages.MediaObject":{"properties":{"id":{"type":"string"},"link":{"type":"string"}},"type":"object"},"messages.MessageContext":{"properties":{"message_id":{"type":"string"}},"type":"object"},"messages.InteractiveObject":{"properties":{"action":{"$ref":"#/components/schemas/messages.ActionObject"},"body":{"$ref":"#/components/schemas/messages.BodyObject"},"footer":{"$ref":"#/components/schemas/messages.FooterObject"},"header":{"$ref":"#/components/schemas/messages.HeaderObject"},"type":{"enum":["button","call_permission_request","catalog_message","list","product","product_list","flow"],"type":"string"}},"type":"object"},"messages.ActionObject":{"additionalProperties":{},"type":"object"},"messages.BodyObject":{"properties":{"text":{"type":"string"}},"type":"object"},"messages.FooterObject":{"properties":{"text":{"type":"string"}},"type":"object"},"messages.HeaderObject":{"properties":{"document":{"$ref":"#/components/schemas/messages.MediaObject"},"image":{"$ref":"#/components/schemas/messages.MediaObject"},"text":{"type":"string"},"type":{"enum":["text","video","image","document"],"type":"string"},"video":{"$ref":"#/components/schemas/messages.MediaObject"}},"type":"object"},"messages.LocationMessage":{"properties":{"address":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"name":{"type":"string"}},"type":"object"},"messages.ReactionMessage":{"properties":{"emoji":{"type":"string"},"message_id":{"type":"string"}},"type":"object"},"messages.TemplateMessage":{"properties":{"components":{"items":{"$ref":"#/components/schemas/messages.TemplateComponent"},"type":"array","uniqueItems":false},"language":{"$ref":"#/components/schemas/messages.LanguageObject"},"name":{"type":"string"}},"required":["language","name"],"type":"object"},"messages.TemplateComponent":{"properties":{"index":{"type":"integer"},"parameters":{"items":{"$ref":"#/components/schemas/messages.TemplateParameter"},"type":"array","uniqueItems":false},"sub_type":{"enum":["quick_reply","url"],"type":"string"},"type":{"enum":["header","body","button"],"type":"string"}},"required":["type"],"type":"object"},"messages.TemplateParameter":{"properties":{"currency":{"$ref":"#/components/schemas/messages.Currency"},"date_time":{"$ref":"#/components/schemas/messages.DateTime"},"document":{"$ref":"#/components/schemas/messages.MediaObject"},"image":{"$ref":"#/components/schemas/messages.MediaObject"},"location":{"$ref":"#/components/schemas/messages.LocationMessage"},"text":{"type":"string"},"type":{"enum":["text","currency","date_time","image","document","video","location"],"type":"string"},"video":{"$ref":"#/components/schemas/messages.MediaObject"}},"type":"object"},"messages.Currency":{"properties":{"amount_1000":{"type":"integer"},"code":{"type":"string"},"fallback_value":{"type":"string"}},"type":"object"},"messages.DateTime":{"properties":{"fallback_value":{"type":"string"}},"type":"object"},"messages.LanguageObject":{"properties":{"code":{"type":"string"}},"required":["code"],"type":"object"},"messages.TextMessage":{"properties":{"body":{"type":"string"},"preview_url":{"type":"boolean"}},"type":"object"},"messages.MessageResponsePayload":{"properties":{"contacts":{"items":{"$ref":"#/components/schemas/messages.ResponseContact"},"type":"array","uniqueItems":false},"messages":{"items":{"$ref":"#/components/schemas/messages.ResponseMessage"},"type":"array","uniqueItems":false},"messaging_product":{"type":"string"}},"type":"object"},"messages.ResponseContact":{"properties":{"input":{"type":"string"},"wa_id":{"type":"string"}},"type":"object"},"messages.ResponseMessage":{"properties":{"id":{"type":"string"},"message_status":{"enum":["accepted","held_for_quality_assessment","paused"],"type":"string"}},"type":"object"},"utils.ErrorResp":{"properties":{"error":{"type":"string"}},"type":"object"}}},"paths":{"/messages":{"post":{"description":"Send a message via the messaging API. Supports text, media, and template messages with automatic routing to marketing messages endpoint when applicable. Supports MM API fallback mechanism, more info: https://docs.360dialog.com/partner/messaging-and-calling/sending-marketing-messages/technical-details-for-mm-api.","operationId":"send-message","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/messages.Message","summary":"requestBody","description":"Message Payload"}}},"description":"Message Payload","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/messages.MessageResponsePayload"}}},"description":"Message sent successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/utils.ErrorResp"}}},"description":"Internal server error"}},"summary":"Send Message","tags":["Messages"]}}}}
```


---

# 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.360dialog.com/docs/messaging-api/api-reference/messages.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.
