Order Chat
The Order Chat object
idstringoptionalPublic identifier of the chat.
channelstringoptionalSocketCluster channel to subscribe to for live messages.
orderstringoptionalPublic identifier of the order.
statusenumoptionalclosed once the order is completed, canceled or expired; messages can still be read. One of open, closed.
mestringoptionalThe requesting customer's participant ID.
participantsarray of objectsoptionalid, role (customer or driver), name, avatar_url and is_online.
messagesarray of objectsoptionalThe latest messages, oldest first.
unread_countintegeroptionalMessages from the driver the customer has not read.
{
"id": "chat_5Nq8vR2",
"channel": "chat.chat_5Nq8vR2",
"order": "order_9Ks2mP1",
"status": "open",
"me": "chat_participant_2Lm4kQ7",
"participants": [
{
"id": "chat_participant_2Lm4kQ7",
"role": "customer",
"name": "Ada Buyer",
"avatar_url": null,
"is_online": true
},
{
"id": "chat_participant_7Rt3pW9",
"role": "driver",
"name": "Ravi Kumar",
"avatar_url": "https://files.example.com/ravi.png",
"is_online": true
}
],
"messages": [
{
"id": "chat_message_3Hk9mL2",
"content": "Picked up your order, about 8 minutes away.",
"sender": {
"id": "chat_participant_7Rt3pW9",
"role": "driver",
"name": "Ravi Kumar"
},
"is_mine": false,
"attachments": [],
"read": true,
"created_at": "2026-10-07T13:52:00Z"
}
],
"unread_count": 0
}/v1/orders/chatGet Order Chat
Returns the order's chat (see the Order Chat object) with its latest 50 messages, oldest first, opening it when a driver is assigned. unread_count counts messages from others the customer hasn't read. Subscribe to channel for live messages.
Refusals: 401 without a customer token, 404 for an order not placed through this storefront, 403 for another customer's order, and 409 with "reason": "driver_not_assigned" when no driver is assigned yet (or the order finished without ever having a chat).
/v1/orders/chatcurl https://api.fleetbase.io/v1/orders/chat \
-H "Authorization: Bearer flb_live_…" \
-H "Customer-Token: {{customer_token}}"/v1/orders/chat/messagesList Order Chat Messages
Older messages of the order's chat, oldest first, as { "messages": [...] }. Pass the oldest message you have as before to page back. A before that isn't in this chat returns 404.
Refusals: 401 without a customer token, 404 for an order not placed through this storefront, 403 for another customer's order, and 409 with "reason": "driver_not_assigned" when no driver is assigned yet (or the order finished without ever having a chat).
beforestringoptionalMessage ID; only messages sent before it are returned.
limitintegeroptionalMaximum number of messages. Defaults to 50; values above 100 are treated as 100.
/v1/orders/chat/messagescurl https://api.fleetbase.io/v1/orders/chat/messages?before=&limit=50 \
-H "Authorization: Bearer flb_live_…" \
-H "Customer-Token: {{customer_token}}"/v1/orders/chat/messagesSend Order Chat Message
Sends a message to the driver and returns { "message": Message }. Send content, files (photos), or both. The driver is notified and the message is broadcast on the chat channel. Once the order is finished the chat is read-only and sending returns 423 with "reason": "chat_closed".
Refusals: 401 without a customer token, 404 for an order not placed through this storefront, 403 for another customer's order, and 409 with "reason": "driver_not_assigned" before a driver is assigned.
contentstringoptionalMessage text, up to 2000 characters. Required without files.
filesarray of objectsoptionalUp to 4 photos, each \{ "data": base64, "type": "image/jpeg" \}. data and type are required for each file, and type must be an image type (image/…). Required without content. Invalid input returns 422.
/v1/orders/chat/messagescurl -X POST https://api.fleetbase.io/v1/orders/chat/messages \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-H "Customer-Token: {{customer_token}}" \
-d '{
"content": "I'\''m in tower B, unit 08-112."
}'/v1/orders/chat/readMark Order Chat as Read
Marks the driver's messages as read for the customer and returns { "read": n }, the number of messages marked. The driver sees the read receipts on the chat channel.
Refusals: 401 without a customer token, 404 for an order not placed through this storefront, 403 for another customer's order, and 409 with "reason": "driver_not_assigned" before a driver is assigned.
/v1/orders/chat/readcurl -X POST https://api.fleetbase.io/v1/orders/chat/read \
-H "Authorization: Bearer flb_live_…" \
-H "Customer-Token: {{customer_token}}"