Messages
2 API calls in this section.
List Messages
/messaging/conversations/:conversationId/messages?tenant_id={{tenant_id}}&page=1&limit=20×tamp_range=Retrieves messages from a specific conversation with filtering and pagination options. Authorization: - Requires valid authentication token - Standard conversations: user must be a participant in the conversation OR be system admin - Support ticket conversations: only the ticket customer or a tenant support user allowed by customer portal support settings can list messages Path Parameters: - conversationId: UUID of the conversation Response: - Returns paginated list of messages with sender information - Updates participant's last read message automatically
1curl --request GET "$ONDI_BASE_URL/messaging/conversations/:conversationId/messages?tenant_id={{tenant_id}}&page=1&limit=20×tamp_range=" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json"Path parameters
conversationIdRequireduuid
UUID of the conversation
Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required if not in auth token)
pageOptional1
Page number for pagination (default: 1)
limitOptional20
Number of items per page (default: 20)
timestamp_rangeOptionalFilter by message timestamp range (format: 2023-01-01T00:00:00Z,2023-01-02T00:00:00Z)
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
Send Message
/messaging/conversations/:conversationId/messages?tenant_id={{tenant_id}}Sends a new message to a conversation. Authorization: - Requires valid authentication token - User must be a participant in the conversation - Conversation must be in 'active' status Path Parameters: - conversationId: UUID of the conversation Note: - message_type=html is reserved for server-generated messages (e.g., support acknowledgements) and is rejected if sent by clients.
1curl --request POST "$ONDI_BASE_URL/messaging/conversations/:conversationId/messages?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 "message_type": "text",7 "content": "Hello!",8 "content_url": null,9 "metadata": null,10 "parent_message_id": null11}'1{2 "message_type": "text",3 "content": "Hello!",4 "content_url": null,5 "metadata": null,6 "parent_message_id": null7}Path parameters
conversationIdRequireduuid
UUID of the conversation
Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required if not in auth token)
Request body fields
message_typeExampleExample field from the request body.
contentExampleExample field from the request body.
content_urlExampleExample field from the request body.
metadataExampleExample field from the request body.
parent_message_idExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json