MobiariDocs
Admin APIConversations

Send a reply

POST
/stores/{store_id}/conversations/{conversation_id}/messages

Posts a team message and delivers it on the conversation's channel (WhatsApp, e-mail, or the widget live). Answering takes the conversation over: the bot stops, the sender becomes the assignee if there is none, and a pending or snoozed conversation reopens.

Delivery is asynchronous: the message comes back with delivery_status sent, and message:updated events on the WebSocket report delivered, read or failed (with delivery_error).

WhatsApp 24-hour rule. Meta accepts free-form messages only within 24 hours of the contact's last message. Outside that window this call answers 422 whatsapp_window_closed and nothing is stored; the conversation's reply_window_expires_at says when the window closes.

Send an Idempotency-Key header: a retry after a lost response then returns the first message instead of sending it twice.

Authorization

bearer_auth
AuthorizationBearer <token>

Authorization: Bearer <token>. Either a session access token from POST /auth/login (refresh it with POST /auth/refresh) or a store API token (mobi_st_…). A store API token works only for the store it was issued in, and can do at most what its issuing user can there, narrowed to the scopes it was issued with.

In: header

Path Parameters

store_id*string

Store id

Formatuuid
conversation_id*string

Conversation id

Formatuuid

Header Parameters

Idempotency-Key?string

A unique value (e.g. a UUID) per logical request. Retrying with the same key within 24 hours replays the first response instead of repeating the side effect; the replay carries Idempotent-Replayed: true. Reusing a key for a different request is a 422 idempotency_key_reused; retrying while the first is still running is a 409 idempotency_request_in_progress. JSON bodies up to 1 MB.

Lengthlength <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/stores/497f6eca-6276-4993-bfeb-53cbbbba6f08/conversations/497f6eca-6276-4993-bfeb-53cbbbba6f08/messages" \  -H "Content-Type: application/json" \  -d '{}'
{
  "conversation": {
    "assignee_user_id": "e942d24d-8cee-4fa2-bf68-164509e32e2f",
    "attributes": {},
    "bot_active": true,
    "channel_id": "bbe8aa76-a4bb-46f6-a785-df8e831cc459",
    "channel_kind": "web",
    "contact_email": "string",
    "contact_name": "string",
    "contact_phone": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "csat_comment": "string",
    "csat_score": 0,
    "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
    "external_id": "string",
    "handed_over_at": "2019-08-24T14:15:22Z",
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "last_message_at": "2019-08-24T14:15:22Z",
    "last_message_preview": "string",
    "last_message_sender": null,
    "priority": "low",
    "resolved_at": "2019-08-24T14:15:22Z",
    "snoozed_until": "2019-08-24T14:15:22Z",
    "status": "open",
    "store_id": "7fe87115-950c-4ae8-bd7e-970406bc9ac0",
    "tags": [
      "string"
    ],
    "unread_for_agents": 0,
    "unread_for_visitor": 0,
    "updated_at": "2019-08-24T14:15:22Z",
    "visitor_id": "string"
  },
  "message": {
    "agent_user_id": "10fd0551-5cc1-4920-817b-63bd803087a9",
    "attachments": [
      {
        "index": 0,
        "kind": "string",
        "mime_type": "string",
        "name": "string",
        "path": "string",
        "size": 0,
        "url": "string"
      }
    ],
    "conversation_id": "cc71b11a-25cd-4c2d-9950-df2cc38e3407",
    "created_at": "2019-08-24T14:15:22Z",
    "delivery_error": "string",
    "delivery_status": "sent",
    "external_id": "string",
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "payload": {
      "assignee_user_id": "e942d24d-8cee-4fa2-bf68-164509e32e2f",
      "attachments": [
        {}
      ],
      "cart": null,
      "email": {},
      "interactive": true,
      "kind": "string",
      "location": {},
      "paid_order_id": "string",
      "pix": null,
      "pix_code": true,
      "products": [
        {
          "compare_at": "string",
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "image": "string",
          "price": "string",
          "title": "string",
          "url": "string"
        }
      ],
      "quick_replies": [
        "string"
      ],
      "reason": "string"
    },
    "read_at": "2019-08-24T14:15:22Z",
    "sender": "visitor",
    "store_id": "7fe87115-950c-4ae8-bd7e-970406bc9ac0",
    "text": "string"
  }
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}