Skip to main content

Messages

2 API calls in this section.

List Messages

Communications & Feedback / Messaging / Messages
GET/messaging/conversations/:conversationId/messages?tenant_id={{tenant_id}}&page=1&limit=20&timestamp_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

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/messaging/conversations/:conversationId/messages?tenant_id={{tenant_id}}&page=1&limit=20&timestamp_range=" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json"

Path parameters

conversationIdRequired
path string

uuid

UUID of the conversation

Query parameters

tenant_idOptional
query string

{{tenant_id}}

UUID of the tenant (required if not in auth token)

pageOptional
query string

1

Page number for pagination (default: 1)

limitOptional
query string

20

Number of items per page (default: 20)

timestamp_rangeOptional
query string

Filter by message timestamp range (format: 2023-01-01T00:00:00Z,2023-01-02T00:00:00Z)

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response200OK
Error - Not Participant403Forbidden

Send Message

Communications & Feedback / Messaging / Messages
POST/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.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
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}'
Request body
json
1{2  "message_type": "text",3  "content": "Hello!",4  "content_url": null,5  "metadata": null,6  "parent_message_id": null7}

Path parameters

conversationIdRequired
path string

uuid

UUID of the conversation

Query parameters

tenant_idOptional
query string

{{tenant_id}}

UUID of the tenant (required if not in auth token)

Request body fields

message_typeExample
string

Example field from the request body.

contentExample
string

Example field from the request body.

content_urlExample
null

Example field from the request body.

metadataExample
null

Example field from the request body.

parent_message_idExample
null

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response201Created
Error - Missing Content400Bad Request
Error - Conversation Not Active403Forbidden