List Messages

GET /messages

Query parameters

  • conversation_id string

    Id of the conversation to filter the list of messages to only that conversation.

  • includes string

    Extra message attributes to include in the response.

    Value is sources.

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • data array[object]
      Hide data attributes Show data attributes object
      • id string
      • content string Required
      • conversation_id string Required
      • machine boolean

        This is true for all LLM generated messages.

      • failed_responding boolean

        This will be true if the response generation for a message had failed.

      • flagged boolean

        This is true when message is in violation of OpenAI usage policy.

      • created_at integer(int64)

        Unix timestamp in seconds

      • sources object
        Hide sources attribute Show sources attribute object
        • data object

          Any of:
    • meta object
      Hide meta attribute Show meta attribute object
      • pagination object
        Hide pagination attributes Show pagination attributes object
        • count integer
        • total integer
        • per_page integer
        • total_pages integer
        • next_page integer | null
        • previous_page integer | null
GET /messages
curl \
 --request GET 'https://getcody.ai/api/v1/messages' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "data": [
    {
      "id": "string",
      "content": "string",
      "conversation_id": "string",
      "machine": true,
      "failed_responding": true,
      "flagged": true,
      "created_at": 42,
      "sources": {
        "data": {
          "type": "written",
          "created_at": 1693013531,
          "document_id": "Jw31Pv6PMmro",
          "document_url": "https://getcody.ai/directories/1/documents/1",
          "document_name": "How to bake cake"
        }
      }
    }
  ],
  "meta": {
    "pagination": {
      "count": 42,
      "total": 42,
      "per_page": 42,
      "total_pages": 42,
      "next_page": 42,
      "previous_page": 42
    }
  }
}