# Whatsapp Webhook

Endpoint para tratar mensagens recebidas pelo webhook do Whatsapp.

## POST /whatsapp/webhook

> Receber mensagens do webhook do Whatsapp

```json
{"openapi":"3.1.1","info":{"title":"Componentes","version":"1.0"},"tags":[{"name":"Whatsapp Webhook","description":"Endpoint para tratar mensagens recebidas pelo webhook do Whatsapp."}],"servers":[{"url":"https://localhost/componentes/v10"},{"url":"http://localhost/componentes/v10"}],"security":[{"csw_auth":[]}],"components":{"securitySchemes":{"csw_auth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"Erro":{"type":"object","properties":{"mensagem":{"type":"string"}}},"WebhookWhatsappPayload":{"type":"object","properties":{"messaging_product":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Metadata"},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"}}}},"Metadata":{"type":"object","properties":{"display_phone_number":{"type":"string"},"phone_number_id":{"type":"string"}}},"Contact":{"type":"object","properties":{"profile":{"$ref":"#/components/schemas/Profile"},"wa_id":{"type":"string"}}},"Profile":{"type":"object","properties":{"name":{"type":"string"}}},"Message":{"type":"object","properties":{"from":{"type":"string"},"id":{"type":"string"},"timestamp":{"type":"string"},"text":{"$ref":"#/components/schemas/Text"},"interactive":{"$ref":"#/components/schemas/Interactive"},"reaction":{"$ref":"#/components/schemas/Reaction"},"location":{"$ref":"#/components/schemas/Location"},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/MessageContact"}},"button":{"$ref":"#/components/schemas/Button"},"type":{"type":"string"}}},"Text":{"type":"object","properties":{"body":{"type":"string"}}},"Interactive":{"type":"object","properties":{"list_reply":{"$ref":"#/components/schemas/ListReply"},"button_reply":{"$ref":"#/components/schemas/ButtonReply"},"type":{"type":"string"}}},"ListReply":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"}}},"ButtonReply":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"}}},"Reaction":{"type":"object","properties":{"message_id":{"type":"string"},"emoji":{"type":"string"}}},"Location":{"type":"object","properties":{"latitude":{"type":"number"},"longitude":{"type":"number"},"name":{"type":"string"},"address":{"type":"string"}}},"MessageContact":{"type":"object","properties":{"addresses":{"type":"array","items":{"$ref":"#/components/schemas/Address"}},"birthday":{"type":"string"},"emails":{"type":"array","items":{"$ref":"#/components/schemas/EmailWhatsapp"}},"name":{"$ref":"#/components/schemas/Name"},"org":{"$ref":"#/components/schemas/Org"},"phones":{"type":"array","items":{"$ref":"#/components/schemas/Phone"}},"urls":{"type":"array","items":{"$ref":"#/components/schemas/Url"}}}},"Address":{"type":"object","properties":{"city":{"type":"string"},"country":{"type":"string"},"country_code":{"type":"string"},"state":{"type":"string"},"street":{"type":"string"},"zip":{"type":"string"},"type":{"type":"string"}}},"EmailWhatsapp":{"type":"object","properties":{"email":{"type":"string"},"type":{"type":"string"}}},"Name":{"type":"object","properties":{"formatted_name":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"middle_name":{"type":"string"},"suffix":{"type":"string"},"prefix":{"type":"string"}}},"Org":{"type":"object","properties":{"company":{"type":"string"},"department":{"type":"string"},"title":{"type":"string"}}},"Phone":{"type":"object","properties":{"phone":{"type":"string"},"wa_id":{"type":"string"},"type":{"type":"string"}}},"Url":{"type":"object","properties":{"url":{"type":"string"},"type":{"type":"string"}}},"Button":{"type":"object","properties":{"text":{"type":"string"},"payload":{"type":"string"}}}}},"paths":{"/whatsapp/webhook":{"post":{"tags":["Whatsapp Webhook"],"summary":"Receber mensagens do webhook do Whatsapp","operationId":"ReceberWebhookWhatsapp","responses":{"200":{"description":"OK"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"429":{"description":"Too Many Requests"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookWhatsappPayload"}}},"description":"Payload recebido pelo webhook do Whatsapp.","required":true}}}}}
```
