Skip to main content
GET
/
conversations
/
{conversation_id}
/
messages
/
{message_id}
Python
from datagrid_ai import Datagrid

client = Datagrid(
    api_key="My API Key",
)
message = client.conversations.messages.retrieve(
    message_id="message_id",
    conversation_id="conversation_id",
)
print(message.id)
{
  "object": "conversation.message",
  "id": "<string>",
  "agent_id": "<string>",
  "role": "user",
  "content": [
    {
      "type": "text",
      "text": "<string>"
    }
  ],
  "created_at": "2023-11-07T05:31:56Z",
  "conversation_id": "<string>",
  "credits": {
    "consumed": 123
  },
  "citations": [
    {
      "citation": "<string>",
      "knowledges": [
        {
          "type": "image",
          "knowledge_id": "<string>",
          "confirmations": [
            "<string>"
          ]
        }
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

conversation_id
string
required
message_id
string
required

The id of the message to retrieve.

Response

200 - application/json

Retrieved message

The conversation.message object represents a message in a conversation.

object
enum<string>
required

The object type, which is always conversation.message.

Available options:
conversation.message
id
string
required

The message identifier.

agent_id
string
required

The ID of the agent that sent or responded to the message.

role
enum<string>
required

The role of the message sender - either 'user' or 'agent'.

Available options:
user,
agent
content
object[]
required

Contents of the message.

created_at
string<date-time>
required

The ISO string for when the message was created.

conversation_id
string
required

The ID of the conversation the message belongs to.

credits
object
required
citations
object[]
required

Array of citations that provide knowledges for factual statements in the response. Each citation includes the referenced text and its knowledges.

I