Conversations
3 API calls in this section.
List Conversations
/messaging/conversations?tenant_id={{tenant_id}}&type=&status=&user_id=&page=1&limit=20Retrieves conversations based on specified filter criteria. Supports pagination and filtering by type, status, and user ID. Authorization: - Requires valid authentication token - Users can view their own conversations - Users with 'view:tenant' or 'manage:messaging:tenant' permission can view all conversations Response: - Returns paginated list of conversations with participants and latest message - Includes unread message count for each conversation
1curl --request GET "$ONDI_BASE_URL/messaging/conversations?tenant_id={{tenant_id}}&type=&status=&user_id=&page=1&limit=20" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json"Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required if not in auth token)
typeOptionalFilter by conversation type (support, order, delivery, team, etc.)
statusOptionalFilter by conversation status
user_idOptionalUUID of the user to filter conversations by (defaults to authenticated user)
pageOptional1
Page number for pagination (default: 1)
limitOptional20
Number of items per page (default: 20)
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
Create Conversation
/messaging/conversations?tenant_id={{tenant_id}}Creates a new conversation. Rules: - If delivery_id is provided, only one conversation per delivery is allowed. If a conversation for that delivery exists, it will be reused and new participants will be added. - For drivers/users/dispatchers, delivery_id is required. - For free (non-delivery) conversations, only dispatcher/admin can create. - For delivery conversations, participants are auto-determined (driver + customer) and optional in request. If provided, they are added as additional participants. - For free conversations, participants are required. - The delivery's customer (user who created the delivery) is auto-added as a participant for delivery conversations. - Creator is automatically added as admin if not in participants list. - All participants must belong to the tenant. - If title is not provided and delivery_id is present, the title will be auto-generated as #<external reference id> - <customer name>. - The type field is always set to 'order' by the backend and is not required in the request.
1curl --request POST "$ONDI_BASE_URL/messaging/conversations?tenant_id={{tenant_id}}" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json" \4 --header "Content-Type: application/json" \5 --data '{6 "delivery_id": "delivery-uuid",7 "metadata": {8 "order_id": "12345",9 "priority": "high"10 }11}'1{2 "delivery_id": "delivery-uuid",3 "metadata": {4 "order_id": "12345",5 "priority": "high"6 }7}Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required if not in auth token)
Request body fields
delivery_idExampleExample field from the request body.
metadataExampleExample field from the request body.
metadata.order_idExampleExample field from the request body.
metadata.priorityExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
Get Conversation
/messaging/conversations/:conversationId?tenant_id={{tenant_id}}Retrieves detailed information about a specific conversation including participants and latest message. Authorization: - Requires valid authentication token - User must be a participant in the conversation OR have 'view:tenant' permission OR be system admin Path Parameters: - conversationId: UUID of the conversation to retrieve Response: - Returns conversation details with participant information and latest message - Includes participant user details (name, email, avatar)
1curl --request GET "$ONDI_BASE_URL/messaging/conversations/:conversationId?tenant_id={{tenant_id}}" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json"Path parameters
conversationIdRequireduuid
UUID of the conversation to retrieve
Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required if not in auth token)
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json