Retrieve messages from a conversation
const url = 'https://api.siteassist.io/v2/conversations/123e4567-e89b-12d3-a456-426614174000/messages?limit=50&offset=0&role=user&status=complete';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.siteassist.io/v2/conversations/123e4567-e89b-12d3-a456-426614174000/messages?limit=50&offset=0&role=user&status=complete' \ --header 'Authorization: Bearer <token>'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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The unique identifier of the conversation to retrieve messages from
Example
123e4567-e89b-12d3-a456-426614174000Query Parameters
Section titled “Query Parameters”Maximum number of messages to return (default: all messages, max: 1000)
Example
50Number of messages to skip for pagination (default: 0)
Example
0Filter messages by role (user, assistant, or human_agent)
Example
assistantFilter messages by status (complete, streaming, or error)
Example
completeResponses
Section titled “Responses”Successfully retrieved all messages from the conversation. Messages are returned in chronological order (oldest first) and include all metadata such as creation time, role, status, and feedback information.
Response containing the list of messages from the conversation, ordered chronologically from oldest to newest
object
object
The parts of the message.
object
Example
{ "object": "list", "data": [ { "object": "message", "role": "assistant", "parts": [ { "type": "text", "text": "Hello, world!" } ], "status": "streaming", "feedback": "like", "humanAgent": null } ]}Bad Request - The request body or parameters are invalid
object
object
Human-readable error message describing what went wrong
Machine-readable error code for programmatic handling
Additional error details and context
object
Example
{ "error": { "message": "Invalid request body. Content is required.", "code": "INVALID_REQUEST_BODY", "details": { "field": "content" } }}Unauthorized - Authentication token is missing or invalid
object
object
Human-readable error message describing what went wrong
Machine-readable error code for programmatic handling
Additional error details and context
object
Example
{ "error": { "message": "Authentication required", "code": "UNAUTHORIZED" }}Payment Required - A higher pricing plan is required to access the resource
object
object
Human-readable error message describing what went wrong
Machine-readable error code for programmatic handling
Additional error details and context
object
Example
{ "error": { "message": "A higher pricing plan is required to access this feature", "code": "PAYMENT_REQUIRED", "details": { "currentPlan": "free", "requiredPlan": "pro", "feature": "advanced_ai_models" } }}Forbidden - Access denied to the requested resource
object
object
Human-readable error message describing what went wrong
Machine-readable error code for programmatic handling
Additional error details and context
object
Example
{ "error": { "message": "Access denied to this conversation", "code": "FORBIDDEN" }}Not Found - The requested resource was not found
object
object
Human-readable error message describing what went wrong
Machine-readable error code for programmatic handling
Additional error details and context
object
Example
{ "error": { "message": "Conversation not found!", "code": "CONVERSATION_NOT_FOUND", "details": { "conversationId": "123e4567-e89b-12d3-a456-426614174000" } }}Conflict - The request could not be completed due to a conflict
object
object
Human-readable error message describing what went wrong
Machine-readable error code for programmatic handling
Additional error details and context
object
Example
{ "error": { "message": "Resource already exists", "code": "CONFLICT", "details": { "resource": "conversation", "conflictingField": "id" } }}Unprocessable Entity - The request was well-formed but contains semantic errors
object
object
Human-readable error message describing what went wrong
Machine-readable error code for programmatic handling
Additional error details and context
object
Example
{ "error": { "message": "Validation failed", "code": "VALIDATION_ERROR", "details": { "field": "content", "reason": "Content exceeds maximum length of 10000 characters" } }}Too Many Requests - Rate limit exceeded or quota reached
object
object
Human-readable error message describing what went wrong
Machine-readable error code for programmatic handling
Additional error details and context
object
Example
{ "error": { "message": "Rate limit exceeded. Please try again later.", "code": "RATE_LIMIT_EXCEEDED", "details": { "retryAfter": 60 } }}Internal Server Error - An unexpected error occurred
object
object
Human-readable error message describing what went wrong
Machine-readable error code for programmatic handling
Additional error details and context
object
Example
{ "error": { "message": "An internal server error occurred", "code": "INTERNAL_SERVER_ERROR" }}Bad Gateway - The server received an invalid response from an upstream server
object
object
Human-readable error message describing what went wrong
Machine-readable error code for programmatic handling
Additional error details and context
object
Example
{ "error": { "message": "Service temporarily unavailable", "code": "BAD_GATEWAY", "details": { "service": "ai_model_service" } }}Service Unavailable - The server is temporarily unable to handle the request
object
object
Human-readable error message describing what went wrong
Machine-readable error code for programmatic handling
Additional error details and context
object
Example
{ "error": { "message": "Service temporarily unavailable", "code": "SERVICE_UNAVAILABLE", "details": { "retryAfter": 30 } }}