> ## Documentation Index
> Fetch the complete documentation index at: https://developers.leadwaycrm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get the generation details

> Retrieves detailed information about AI responses including the System Prompt, Conversation history, Knowledge base, website, FAQ chunks, and Rich Text chunks.

Retrieves detailed information about AI responses including the System Prompt, Conversation history, Knowledge base, website, FAQ chunks, and Rich Text chunks.

```http theme={null}
GET https://services.leadconnectorhq.com/conversation-ai/generations
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Query parameters

<ParamField query="messageId" type="string" required default="messageId123">
  Message Id
</ParamField>

<ParamField query="source" type="string" required default="conversation" />

## Respuestas

<Accordion title="200 - Successful response">
  <ResponseField name="prompt" type="string" required default="Personality: Friendly and professional,  Intent: Assist customers with inquiries  Additional Information: Handle basic support queries">
    The complete prompt used for the AI response.
  </ResponseField>

  <ResponseField name="intent" type="string" default="Assist customers with product inquiries and support">
    The intent/goal extracted from account prompt.
  </ResponseField>

  <ResponseField name="responseMessage" type="string" required default="Hello! I understand you're interested in our products. How can I assist you today?">
    The response message generated by the AI.
  </ResponseField>

  <ResponseField name="faqs" type="object[]">
    FAQ chunks used in generating the response from fine-tuned data.
  </ResponseField>

  <ResponseField name="website" type="object[]">
    Website content chunks used in generating the response.
  </ResponseField>

  <ResponseField name="agentId" type="string" default="emp_123">
    ID of the employee/agent that generated the response.
  </ResponseField>

  <ResponseField name="input" type="string" default="What is your return policy?">
    The original input message that triggered this response.
  </ResponseField>

  <ResponseField name="actionLogs" type="object[]" required>
    List of actions taken during this interaction.
  </ResponseField>

  <ResponseField name="history" type="object[]" required>
    Conversation history leading up to this response.
  </ResponseField>

  <ResponseField name="mode" type="string" default="auto-pilot">
    Mode of operation during this interaction.
  </ResponseField>

  ```json theme={null}
  {
    "prompt": "Personality:\nFriendly and professional,\n\nIntent:\nAssist customers with inquiries\n\nAdditional Information:\nHandle basic support queries",
    "intent": "Assist customers with product inquiries and support",
    "responseMessage": "Hello! I understand you're interested in our products. How can I assist you today?",
    "faqs": [
      {
        "id": "chunk_123",
        "content": "Our return policy allows returns within 30 days of purchase.",
        "title": "Return Policy FAQ"
      }
    ],
    "website": [
      {
        "id": "chunk_456",
        "content": "We offer free shipping on orders over $50.",
        "url": "https://example.com/shipping"
      }
    ],
    "agentId": "emp_123",
    "input": "What is your return policy?",
    "actionLogs": [
      {
        "contactUpdateAction": [
          {
            "fieldId": "field_123",
            "value": "John Doe"
          }
        ]
      }
    ],
    "history": [
      {
        "role": "user",
        "content": "Hi, I have a question about returns"
      },
      {
        "role": "assistant",
        "content": "I'll be happy to help you with information about our return policy."
      }
    // truncado: 3 lineas mas
  }
  ```
</Accordion>

<Accordion title="400 - Bad Request">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="422 - Unprocessable Entity">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET 'https://services.leadconnectorhq.com/conversation-ai/generations' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/conversation-ai/generations', {
    method: 'GET',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
    },
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'GET',
      'https://services.leadconnectorhq.com/conversation-ai/generations',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
      },
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/conversation-ai/generations');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'GET',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
      ],
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
