---
title: "Retrieve messages that have been sent in a conversation."
method: GET
path: "/api/v1/projects/{projectId}/conversations/{sessionId}/messages"
tags: ["Conversations"]
---

# Retrieve messages that have been sent in a conversation.

`GET /api/v1/projects/{projectId}/conversations/{sessionId}/messages`

Retrieve all messages sent within a conversation of an agent (formerly known as project) identified by its unique projectId and sessionId. This endpoint allows you to retrieve a collection of messages exchanged in a specific conversation. Messages contain the content, timestamps, and other relevant information shared during the course of the conversation. By providing the projectId and sessionId, you can access all the messages associated with that particular conversation within the agent context.
Here is an example to retrieve messages of a conversation: [API](https://github.com/Poll-The-People/customgpt-cookbook/blob/main/examples/Retrieve_messages_for_a_conversation.ipynb) [SDK](https://github.com/Poll-The-People/customgpt-cookbook/blob/main/examples/SDK_Retrieve_Messages_of_conversation.ipynb).

## Path parameters

- `projectId` integer, required
- `sessionId` string, required

## Query parameters

- `page` integer
- `order` 'asc' | 'desc'

## Response `200`

List all messages in a conversation

- object
  - `status` 'error' | 'success' — The status of the response
  - `data` object
    - `conversation` Conversation
      - `created_at` string, date-time — When was this conversation created?
      - `updated_at` string, date-time — When was this conversation updated?
      - `deleted_at` string, date-time — When was this conversation deleted?
      - `id` integer — Conversation ID
      - `name` string — Conversation name
      - `project_id` string — Agent ID for this conversation
      - `created_by` string — User ID for the user who created this conversation
      - `session_id` string, uuid — Session ID for this conversation
    - `messages` object
      - `current_page` integer — The current page number
      - `data` PromptHistory[]
        - `id` integer — The unique identifier of the prompt history.
        - `user_id` integer — The unique identifier of the user.
        - `user_query` string — The user prompt query.
        - `openai_response` string — The OpenAI response to the user prompt query.
        - `created_at` string, date-time — The date and time the prompt history was created.
        - `updated_at` string, date-time — The date and time the prompt history was last updated.
        - `conversation_id` integer — The unique identifier of the conversation.
        - `citations` integer[] — The citations for the prompt history.
        - `metadata` object
          - `user_ip` string — The IP address of the user.
          - `user_agent` string — The user agent of the user.
          - `external_id` string — The external ID of the prompt history.
          - `request_source` string — The source of the request.
        - `response_feedback` object
          - `created_at` string, date-time — The timestamp when the feedback was created
          - `updated_at` string, date-time — The timestamp when the feedback was last updated
          - `user_id` integer, nullable — The ID of the user who provided the feedback
          - `reaction` string — The reaction provided by the user
      - `first_page_url` string — The first page url
      - `from` integer — The first item number of the current page
      - `last_page` integer — The last page number
      - `last_page_url` string — The last page url
      - `next_page_url` string — The next page url
      - `path` string — The current page url
      - `per_page` integer — The number of items per page
      - `prev_page_url` string — The previous page url
      - `to` integer — The last item number of the current page
      - `total` integer — The total number of items

## Other responses

- `400` — Bad Argument
- `401` — API Token is either missing or invalid
- `404` — Agent not found
- `500` — Internal Server Error

---

[API](https://skmtc.net/poll-the-people/apis/customgpt-ai.md) · [All operations](https://skmtc.net/poll-the-people/apis/customgpt-ai/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/poll-the-people/customgpt-ai/revisions/b80e6dfcf78d/schema)
