Zum Hauptinhalt springen

Get one chat of the authenticated user

GET/v2/aissistant-chats/{chatId}
API-Version
v2
Request-Methode
GET
Operation-ID
aissistant-get-chat

Request​

  • chatIdstring (uuid)required

    The chat's AG-UI threadId, a UUID the client creates.

    Beispiel:"7f0c6a52-3a8e-4b8f-9d1e-2c4b5a6d7e8f"

Responses​

Format
application/json
Beschreibung

The chat as last saved.

  • idstring (uuid)required
  • messagesArray von objectrequired
    • Array[

      An AG-UI message. The full shape follows the AG-UI message schema; this schema names only the fields every message has. A message may nest at most 64 levels, the message object counting as level 1.

      • *object

        An AG-UI message. The full shape follows the AG-UI message schema; this schema names only the fields every message has. A message may nest at most 64 levels, the message object counting as level 1.

        • idstringrequired
        • rolestringrequired
        • *
      ]
  • revisioninteger (≥ 1)required
  • titlestringrequired

    At most 200 UTF-16 code units on save. Some titles were stored before that limit existed and can be longer; they are still returned.

  • turnMarksobjectrequired

    The marks of the turns that did not finish, keyed by the id of the message that shows the mark. Every key is the id of a message of the same chat; {} when every turn finished.

    • *string (einer von: stopped, incomplete)

      How a turn ended when it did not finish: stopped when the user stopped it, incomplete when the run failed or ended without answer text.

  • updatedAtstring (date-time)required
A chat with one question and its answer
Content-Type: application/json

{
"id": "7f0c6a52-3a8e-4b8f-9d1e-2c4b5a6d7e8f",
"messages": [
{
"content": "How do I add a domain to project p-XXXXXX?",
"id": "msg-user-1",
"role": "user"
},
{
"content": "Open the project, then Domains, then Add domain.",
"id": "msg-assistant-1",
"role": "assistant"
}
],
"revision": 3,
"title": "Set up a domain for my project",
"turnMarks": {},
"updatedAt": "2026-10-29T10:15:00.000Z"
}
A chat whose answer the user stopped
Content-Type: application/json

{
"id": "7f0c6a52-3a8e-4b8f-9d1e-2c4b5a6d7e8f",
"messages": [
{
"content": "How do I add a domain to project p-XXXXXX?",
"id": "msg-user-1",
"role": "user"
},
{
"content": "Open the project, then",
"id": "msg-assistant-1",
"role": "assistant"
}
],
"revision": 2,
"title": "Set up a domain for my project",
"turnMarks": {
"msg-assistant-1": "stopped"
},
"updatedAt": "2026-10-29T10:15:00.000Z"
}
{
"additionalProperties": false,
"example": {
"id": "7f0c6a52-3a8e-4b8f-9d1e-2c4b5a6d7e8f",
"messages": [
{
"content": "How do I add a domain to project p-XXXXXX?",
"id": "msg-user-1",
"role": "user"
}
],
"revision": 3,
"title": "Set up a domain for my project",
"turnMarks": {},
"updatedAt": "2026-10-29T10:15:00.000Z"
},
"properties": {
"id": {
"format": "uuid",
"type": "string"
},
"messages": {
"items": {
"additionalProperties": true,
"description": "An AG-UI message. The full shape follows the AG-UI message schema; this schema names only the fields every message has. A message may nest at most 64 levels, the message object counting as level 1.",
"example": {
"content": "How do I add a domain to project p-XXXXXX?",
"id": "msg-user-1",
"role": "user"
},
"properties": {
"id": {
"type": "string"
},
"role": {
"type": "string"
}
},
"required": [
"id",
"role"
],
"type": "object"
},
"type": "array"
},
"revision": {
"minimum": 1,
"type": "integer"
},
"title": {
"description": "At most 200 UTF-16 code units on save. Some titles were stored before that limit existed and can be longer; they are still returned.",
"type": "string"
},
"turnMarks": {
"additionalProperties": {
"description": "How a turn ended when it did not finish: `stopped` when the user stopped it, `incomplete` when the run failed or ended without answer text.",
"enum": [
"stopped",
"incomplete"
],
"example": "stopped",
"type": "string"
},
"description": "The marks of the turns that did not finish, keyed by the `id` of the message that shows the mark. Every key is the id of a message of the same chat; `{}` when every turn finished.",
"example": {
"msg-assistant-1": "stopped",
"msg-assistant-2": "incomplete"
},
"type": "object"
},
"updatedAt": {
"format": "date-time",
"type": "string"
}
},
"required": [
"id",
"title",
"revision",
"updatedAt",
"messages",
"turnMarks"
],
"type": "object"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/aissistant-chats/f0f86186-0a5a-45b2-aa33-502777496347
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.aissistant.getChat({
"chatId": "f0f86186-0a5a-45b2-aa33-502777496347"
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\AIssistant\GetChat\GetChatRequest;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

$request = (new GetChatRequest(
chatId: "f0f86186-0a5a-45b2-aa33-502777496347"
));
$response = $client->aissistant()->getChat($request);

var_dump($response->getBody();

Auf dieser Seite