Conversations
The store's inbox: conversations on WhatsApp, Instagram, e-mail and the site's chat, their messages, notes and labels.
A conversation is the store's exchange with one person on one channel
(whatsapp, instagram, email, web for the site's chat,
mercado_livre). The store's assistant answers it until it hands it to
the team, or until someone on the team answers.
Statuses
- open: someone should answer.
- pending: the assistant handed it over and nobody took it yet.
- snoozed: hidden until
snooze_ends_at(a new message from the customer wakes it). - resolved: closed (a new message from the customer reopens it).
Endpoints
Paths are relative to https://api.mobiari.com/v1, with the store named
by its key or the Mobiari-Store header, as everywhere in the
API.
| Method | Path | Purpose |
|---|---|---|
GET | /conversations | List, newest activity first. Filters: status, assignee, channel_kind, channel_id, tag, priority, customer_id, unread, team, sla_breached, search. |
GET, PATCH | /conversations/{conversation_id} | Read one (with its notes and reply_window_expires_at); change its status, priority, assignee, team, labels (tags), contact or whether the assistant answers (is_bot_active). |
POST | /conversations/{conversation_id}/handback | Hand it back to the store's assistant. |
GET, POST | /conversations/{conversation_id}/messages | Its messages, newest first (with after or created_after, what came after that point, oldest first); send one on its channel. |
GET | /conversations/{conversation_id}/messages/{message_id}/attachments/{index} | Download a file of a message (the attachment's url). |
POST | /conversations/{conversation_id}/notes | A note only the team sees; DELETE .../notes/{note_id} removes one. |
PUT, DELETE | /conversations/{conversation_id}/block | Block the WhatsApp contact, and lift the block. |
PUT, DELETE | /conversations/{conversation_id}/orders/{order_id} | Say an order was sold in this conversation, and undo it. |
GET, POST | /conversation-labels | The labels conversations can take; PATCH, DELETE .../{label_id}. |
Lists answer a Page.
Send a message
curl -X POST "https://api.mobiari.com/v1/conversations/$CONVERSATION/messages" \
-H "Authorization: Bearer $MOBIARI_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Temos sim! Quer ver as cores?",
"payload": { "quick_replies": ["Sim", "Não"] }
}'It answers the message and the conversation as it now is. Answering
takes the conversation over: the assistant stops, and a pending or snoozed
conversation reopens. Delivery is asynchronous: the message's
delivery_status moves on as the channel reports it. On WhatsApp a free
message can only be sent within 24 hours of the customer's last one
(reply_window_expires_at); after it, the channel refuses it.
payload takes quick_replies (up to three buttons on WhatsApp) or
product_ids (up to five active products, sent as cards with title,
price, image and link).
Webhooks
conversations.started, conversations.message_received,
conversations.handed_over, conversations.handed_back and
conversations.resolved carry the Conversation as
GET /conversations/{conversation_id} answers it, without the team's
notes. conversations.message_received also has the message's text and
sender in details. See Webhooks.
A conversation the store's automatic close resolves (the team answered last
and the customer did not reply within auto_resolve_hours of the inbox
settings) sends no conversations.resolved.
Permission cheatsheet
| Action | Permission |
|---|---|
| Read conversations, messages, attachments and labels | conversations.read |
| Send, change, hand back, notes, link orders | conversations.reply |
| Create, change and delete labels | conversations.manage |
| Block a contact | customers.write |
A key without the permission answers 403 missing_permission.