Skip to main content
Mintlify
current

Search documentation

Type to search this documentation.

On this pageOverview

Get assistant conversation thread

Returns the full message transcript for a single assistant conversation thread. The thread ID is available from the assistant conversations endpoint, or as the threadId query parameter appended to assistant link-mode deflection support URLs.

Authenticate with an admin API key.

Use this endpoint to fetch the full message transcript of a single assistant conversation as JSON. The response includes the ordered list of user and assistant messages, each with an ID, role, content, and timestamp.

Common uses:

  • Attach the conversation transcript to a support ticket when a user reaches out from the assistant.
  • Reconstruct a specific conversation for review, quality assurance, or offline analysis.

You can obtain a threadId from either of the following sources:

  • The id field of any row returned by Get assistant conversations.
  • The threadId query parameter that Mintlify appends to the support URL when the assistant deflects to your support platform using link deflection.

This endpoint allows 100 requests per organization per hour. All analytics endpoints share this limit.

OpenAPI

Related topics

GET/v1/analytics/{projectId}/assistant/threads/{threadId}

Get an assistant conversation thread

2 parameters
  • projectIdstringpathrequired
  • threadIdstringpathrequired
cURL
curl --request GET \
  --url https://api.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId} \
  --header 'Authorization: Bearer <token>'
Python
import requests

url = "https://api.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId}"

headers = {
    "Authorization": "Bearer <token>"
}

response = requests.get(url, headers=headers)

print(response.text)
JavaScript
const options = {method: "GET", headers: {"Authorization": "Bearer <token>"}};

fetch("https://api.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId}", options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
PHP
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
Go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
Java
HttpResponse<String> response = Unirest.get("https://api.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId}")
  .header("Authorization", "Bearer <token>")
  .asString();
Ruby
require 'uri'
require 'net/http'

url = URI("https://api.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
200
{
  "threadId": "<string>",
  "createdAt": "<string>",
  "messages": [
    {
      "id": "<string>",
      "role": "user",
      "content": "<string>",
      "createdAt": "<string>"
    }
  ]
}
400
{
  "error": "<string>",
  "details": [
    {
      "message": "<string>"
    }
  ]
}
404
{
  "error": "<string>",
  "details": [
    {
      "message": "<string>"
    }
  ]
}
500
{
  "error": "<string>",
  "details": [
    {
      "message": "<string>"
    }
  ]
}
Authorizationstringrequired

The Authorization header expects a Bearer token. Use an admin API key. This is a server-side secret key. Generate one on the API keys page in your dashboard.

projectIdstringrequired
threadIdstringrequired

200 — The conversation transcript

threadIdstringrequired

Assistant conversation thread identifier (ULID).

Typestring
createdAtstringrequired

Timestamp when the thread was created.

Typestring
messagesobject[]required

Ordered list of messages exchanged in the thread.

Typeobject[]
Show child attributes
idstringrequired

Unique message identifier.

Typestring
roleenum<string>required

Whether the message was sent by the user or the assistant.

Available options: user, assistant

Typeenum<string>
contentstringrequired

The text content of the message.

Typestring
createdAtstringrequired

Timestamp when the message was sent.

Typestring
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu