Retrieve messages from a conversation
Retrieve messages from a conversation, ordered chronologically from oldest to newest. Supports pagination and filtering by role or status. Only the conversation owner can access their messages.
In: header
Path Parameters
The unique identifier of the conversation to retrieve messages from
uuid
Query Parameters
Maximum number of messages to return (default: all messages, max: 1000)
1 <= value <= 1000
Number of messages to skip for pagination (default: 0)
0 <= value
Filter messages by role (user, assistant, or human_agent)
"user" | "assistant" | "human_agent"
Filter messages by status (complete, streaming, or error)
"complete" | "streaming" | "error"
Response Body
curl -X GET "https://api.siteassist.io/v2/conversations/123e4567-e89b-12d3-a456-426614174000/messages?limit=50&offset=0&role=assistant&status=complete"
{
"object": "list",
"data": [
{
"object": "message",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"createdAt": "string",
"chatId": "f255124e-3419-4f6e-b7ee-17a6577db94d",
"role": "assistant",
"parts": [
{
"type": "text",
"text": "Hello, world!"
}
],
"status": "streaming",
"error": "string",
"feedback": "like",
"feedbackAt": "string",
"metadata": "string",
"humanAgent": null,
"pageUrl": "string",
"pageTitle": "string",
"textSelection": "string"
}
]
}
{
"error": {
"message": "Invalid request body. Content is required.",
"code": "INVALID_REQUEST_BODY",
"details": {
"field": "content"
}
}
}
{
"error": {
"message": "Authentication required",
"code": "UNAUTHORIZED"
}
}
{
"error": {
"message": "A higher pricing plan is required to access this feature",
"code": "PAYMENT_REQUIRED",
"details": {
"currentPlan": "free",
"requiredPlan": "pro",
"feature": "advanced_ai_models"
}
}
}
{
"error": {
"message": "Access denied to this conversation",
"code": "FORBIDDEN"
}
}
{
"error": {
"message": "Conversation not found!",
"code": "CONVERSATION_NOT_FOUND",
"details": {
"conversationId": "123e4567-e89b-12d3-a456-426614174000"
}
}
}
{
"error": {
"message": "Resource already exists",
"code": "CONFLICT",
"details": {
"resource": "conversation",
"conflictingField": "id"
}
}
}
{
"error": {
"message": "Validation failed",
"code": "VALIDATION_ERROR",
"details": {
"field": "content",
"reason": "Content exceeds maximum length of 10000 characters"
}
}
}
{
"error": {
"message": "Rate limit exceeded. Please try again later.",
"code": "RATE_LIMIT_EXCEEDED",
"details": {
"retryAfter": 60
}
}
}
{
"error": {
"message": "An internal server error occurred",
"code": "INTERNAL_SERVER_ERROR"
}
}
{
"error": {
"message": "Service temporarily unavailable",
"code": "BAD_GATEWAY",
"details": {
"service": "ai_model_service"
}
}
}
{
"error": {
"message": "Service temporarily unavailable",
"code": "SERVICE_UNAVAILABLE",
"details": {
"retryAfter": 30
}
}
}
Initialize visitor session POST
Create or fetch an anonymous visitor for the provided publishable API key and device identifier, then return a short-lived session token and visitor profile. Returns 201 on first-time creation and 200 on subsequent calls for the same device.
Submit feedback for a message POST
Submit feedback (like/dislike) for a specific message in a conversation. This endpoint allows users to rate the quality and helpfulness of AI assistant responses. **Use Cases:** - Rate the helpfulness of AI responses - Provide training data for model improvement - Track user satisfaction with AI interactions - Remove existing feedback by setting feedback to null - Update existing feedback by submitting a new value **Authentication Required:** This endpoint requires a valid Bearer token in the Authorization header. The user must have access to the conversation containing the message. **Feedback Types:** - `like`: Positive feedback indicating the response was helpful and accurate - `dislike`: Negative feedback indicating the response was unhelpful or incorrect - `null`: Remove existing feedback **Behavior:** - Feedback is stored with a timestamp (`feedbackAt`) - Submitting new feedback overwrites any existing feedback - Setting feedback to `null` removes the existing feedback - Feedback submissions are published as events for analytics - Only the message owner (visitor) can submit feedback **Event Publishing:** Feedback submissions are automatically published as events for analytics and monitoring purposes.