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

# AI Summarize

<Warning>
  Before call make sure that AI Summarize feature enabled on admin dashboard,
  otherwise you will get 405 error.
</Warning>

<Note>
  A summary will be generated using the latest 1,000 messages from the conversation.
</Note>

<Note>
  Please note that if there are no messages in dialog you will receive next response:

  ```json theme={null}
  200
  {
      "summary": "Chat is empty."
  }
  ```
</Note>

#### Body Parameters

<ParamField body="smart_chat_assistant_id" type="string" required>
  Smart Chat Assistant ID.
</ParamField>

<ParamField body="dialog_id" type="string" required>
  ID of the dialog that will be summarized.
</ParamField>

#### Headers

<ParamField header="QB-Token" type="string" required>
  A user or application session token. See [Authentication](/reference/authentication)
  page to learn more about session tokens.
</ParamField>

#### Responses

<AccordionGroup>
  <Accordion title="200">
    A successful response

    <ResponseField name="summary" type="string" />
  </Accordion>

  <Accordion title="400">
    An error response

    <ResponseField name="errors" type="array of strings" />
  </Accordion>

  <Accordion title="404">
    An error response

    <ResponseField name="errors" type="array of strings" />
  </Accordion>

  <Accordion title="405">
    An error response

    <ResponseField name="errors" type="array of strings" />
  </Accordion>
</AccordionGroup>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST \
  -H "Content-Type: application/json" \
  -H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
  -d '{
    "smart_chat_assistant_id": "65d5f3473d5d68095462165d",
    "dialog_id": "65d5f3473d5d68095462166a"
  }' \
  https://api.quickblox.com/ai/ai_extensions/ai_summarize
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "summary": "The user contacted support to clarify a billing discrepancy they noticed in their latest invoice. They explained that they were charged for a premium subscription despite downgrading to the free plan last month. The assistant verified the account details, confirmed the downgrade request had not been processed, and issued a refund. The conversation then shifted to questions about using the mobile app’s new features, particularly exporting reports and setting up daily usage notifications. The assistant provided step-by-step guidance and shared relevant help center links. The user confirmed the issues were resolved and expressed satisfaction with the support received."
  }
  ```

  ```json 400 theme={null}
  {
    "errors": [
      "Validation Error: dialog_id: Dialog id can't be empty, must be a string"
    ]
  }
  ```

  ```json 404 theme={null}
  {
    "errors": [
      "The resource wasn't found"
    ]
  }
  ```

  ```json 405 theme={null}
  {
    "errors": [
      "AI Summarize is disabled"
    ]
  }
  ```
</ResponseExample>
