MobiariDocs
Storefront APIEngagement

Send a chat message

POST
/widget/{key}/conversations/{conversation_id}/messages

At most 20 messages per minute per conversation. A resolved or snoozed conversation reopens; the bot answers when it is on.

Path Parameters

key*string

The chat channel's public key (data-key of the embed script)

conversation_id*string

Conversation id

Formatuuid

Query Parameters

token?string

The token POST /widget/{key}/conversations returned. Prefer the X-Visitor-Token header; the query parameter is for clients that cannot set headers.

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/widget/string/conversations/497f6eca-6276-4993-bfeb-53cbbbba6f08/messages" \  -H "Content-Type: application/json" \  -d '{    "text": "string"  }'
{
  "conversation": {
    "assigned": true,
    "bot_active": true,
    "contact_email": "string",
    "contact_name": "string",
    "contact_phone": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "csat_score": 0,
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "status": "open",
    "unread_for_visitor": 0
  },
  "message": {
    "created_at": "2019-08-24T14:15:22Z",
    "delivery_status": "sent",
    "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",
    "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"
}