# List conversation messages GET https://api.moveworks.ai/rest/v1beta1/conversations/{conversation_id}/messages Retrieves all messages (both user and assistant) in a conversation in descending order by creation time (most recent first). Reference: https://help.moveworks.com/api-reference/beta-conversations-api/messages/list-conversation-messages ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: conversations-api version: 1.0.0 paths: /conversations/{conversation_id}/messages: get: operationId: list-conversation-messages summary: List conversation messages description: >- Retrieves all messages (both user and assistant) in a conversation in descending order by creation time (most recent first). tags: - subpackage_messages parameters: - name: conversation_id in: path description: 'Unique conversation identifier (format: conv_)' required: true schema: type: string - name: cursor in: query description: Opaque cursor for pagination required: false schema: type: string - name: limit in: query description: Maximum number of messages to return (1-100) required: false schema: type: integer default: 20 - name: Authorization in: header description: >- JWT bearer token authentication. Obtain an access token from the Moveworks auth endpoint and include it in the Authorization header as 'Bearer '. required: true schema: type: string - name: Assistant-Name in: header description: >- The Moveworks assistant identifier that was configured for your organization. required: true schema: type: string responses: '200': description: List of messages content: application/json: schema: $ref: '#/components/schemas/ListConversationMessagesResponse' '400': description: Bad request - Invalid input parameters content: application/json: schema: $ref: '#/components/schemas/InvalidCursorErrorResponse' '401': description: Unauthorized - Invalid or missing authentication content: application/json: schema: $ref: '#/components/schemas/UnauthorizedErrorResponse' '404': description: Not found - Resource does not exist content: application/json: schema: $ref: '#/components/schemas/NotFoundErrorResponse' '429': description: Rate limit exceeded content: application/json: schema: $ref: '#/components/schemas/RateLimitExceededErrorResponse' '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/InternalErrorResponse' servers: - url: https://api.moveworks.ai/rest/v1beta1 components: schemas: ActorType: type: string enum: - USER - ASSISTANT description: Message actor type title: ActorType PlainTextContent: type: object properties: text: type: string description: Plain text content required: - text title: PlainTextContent Content0: type: object properties: plain_text: $ref: '#/components/schemas/PlainTextContent' required: - plain_text title: Content0 CommonmarkTextContent: type: object properties: text: type: string description: Commonmark-formatted text content required: - text title: CommonmarkTextContent Content1: type: object properties: commonmark_text: $ref: '#/components/schemas/CommonmarkTextContent' required: - commonmark_text title: Content1 MarkdownTextContent: type: object properties: text: type: string description: >- Raw markdown text content. Used when Minerva's chat response `is_commonmark` is not set. required: - text title: MarkdownTextContent Content2: type: object properties: markdown_text: $ref: '#/components/schemas/MarkdownTextContent' required: - markdown_text title: Content2 Content: oneOf: - $ref: '#/components/schemas/Content0' - $ref: '#/components/schemas/Content1' - $ref: '#/components/schemas/Content2' description: Message content with type discriminator title: Content CitationLocation: type: object properties: offset: type: integer description: >- Zero-based character position in the assistant message where the citation should be inserted required: - offset title: CitationLocation Display: type: object properties: title: $ref: '#/components/schemas/Content' description: Primary heading/identifier with type discriminator body: $ref: '#/components/schemas/Content' description: Body/description content with type discriminator title: Display Citation: type: object properties: location: $ref: '#/components/schemas/CitationLocation' url: type: string format: uri description: URL to the entity display: $ref: '#/components/schemas/Display' required: - location title: Citation Message: type: object properties: message_id: type: string description: Unique message identifier conversation_id: type: string description: Parent conversation identifier response_id: type: string description: Associated response identifier actor: $ref: '#/components/schemas/ActorType' content: $ref: '#/components/schemas/Content' citations: type: array items: $ref: '#/components/schemas/Citation' description: Entity citations (assistant messages only) created_at: type: string format: date-time description: Creation timestamp (ISO 8601) required: - message_id - conversation_id - response_id - actor - content - citations - created_at title: Message Metadata: type: object properties: next_cursor: type: - string - 'null' description: Opaque cursor for next page (null if no more results) title: Metadata ListConversationMessagesResponse: type: object properties: messages: type: array items: $ref: '#/components/schemas/Message' description: Array of messages metadata: $ref: '#/components/schemas/Metadata' description: Metadata (pagination) required: - messages title: ListConversationMessagesResponse InvalidCursorErrorResponseErrorCode: type: string enum: - INVALID_CURSOR title: InvalidCursorErrorResponseErrorCode InvalidCursorErrorResponseError: type: object properties: code: $ref: '#/components/schemas/InvalidCursorErrorResponseErrorCode' message: type: string required: - code - message title: InvalidCursorErrorResponseError InvalidCursorErrorResponse: type: object properties: error: $ref: '#/components/schemas/InvalidCursorErrorResponseError' required: - error description: Error response for invalid pagination cursor title: InvalidCursorErrorResponse UnauthorizedErrorResponseErrorCode: type: string enum: - UNAUTHORIZED title: UnauthorizedErrorResponseErrorCode UnauthorizedErrorResponseError: type: object properties: code: $ref: '#/components/schemas/UnauthorizedErrorResponseErrorCode' message: type: string required: - code - message title: UnauthorizedErrorResponseError UnauthorizedErrorResponse: type: object properties: error: $ref: '#/components/schemas/UnauthorizedErrorResponseError' required: - error description: Error response for unauthorized access title: UnauthorizedErrorResponse NotFoundErrorResponseErrorCode: type: string enum: - NOT_FOUND title: NotFoundErrorResponseErrorCode NotFoundErrorResponseError: type: object properties: code: $ref: '#/components/schemas/NotFoundErrorResponseErrorCode' message: type: string required: - code - message title: NotFoundErrorResponseError NotFoundErrorResponse: type: object properties: error: $ref: '#/components/schemas/NotFoundErrorResponseError' required: - error description: Error response for resource not found title: NotFoundErrorResponse RateLimitExceededErrorResponseErrorCode: type: string enum: - RATE_LIMIT_EXCEEDED title: RateLimitExceededErrorResponseErrorCode RateLimitExceededErrorResponseError: type: object properties: code: $ref: '#/components/schemas/RateLimitExceededErrorResponseErrorCode' message: type: string required: - code - message title: RateLimitExceededErrorResponseError RateLimitExceededErrorResponse: type: object properties: error: $ref: '#/components/schemas/RateLimitExceededErrorResponseError' required: - error description: Error response for rate limit exceeded title: RateLimitExceededErrorResponse InternalErrorResponseErrorCode: type: string enum: - INTERNAL_ERROR title: InternalErrorResponseErrorCode InternalErrorResponseError: type: object properties: code: $ref: '#/components/schemas/InternalErrorResponseErrorCode' message: type: string required: - code - message title: InternalErrorResponseError InternalErrorResponse: type: object properties: error: $ref: '#/components/schemas/InternalErrorResponseError' required: - error description: Error response for internal server error title: InternalErrorResponse securitySchemes: BearerAuth: type: http scheme: bearer description: >- JWT bearer token authentication. Obtain an access token from the Moveworks auth endpoint and include it in the Authorization header as 'Bearer '. ``` ## SDK Code Examples ```python import requests url = "https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV/messages" headers = { "Assistant-Name": "acmecorp-conversations-rest-api", "Authorization": "Bearer " } response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV/messages'; const options = { method: 'GET', headers: { 'Assistant-Name': 'acmecorp-conversations-rest-api', Authorization: 'Bearer ' } }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV/messages" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Assistant-Name", "acmecorp-conversations-rest-api") req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV/messages") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Assistant-Name"] = 'acmecorp-conversations-rest-api' request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV/messages") .header("Assistant-Name", "acmecorp-conversations-rest-api") .header("Authorization", "Bearer ") .asString(); ``` ```php request('GET', 'https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV/messages', [ 'headers' => [ 'Assistant-Name' => 'acmecorp-conversations-rest-api', 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV/messages"); var request = new RestRequest(Method.GET); request.AddHeader("Assistant-Name", "acmecorp-conversations-rest-api"); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Assistant-Name": "acmecorp-conversations-rest-api", "Authorization": "Bearer " ] let request = NSMutableURLRequest(url: NSURL(string: "https://api.moveworks.ai/rest/v1beta1/conversations/conv_01ARZ3NDEKTSV4RRFFQ69G5FAV/messages")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```