{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mantic/json-schema/mantic-conversation-messages-response-schema.json",
  "title": "ConversationMessagesResponse",
  "description": "Cursor-paginated chunk of message history (newest-first).",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mantic-conversations-api-openapi.yml#/components/schemas/ConversationMessagesResponse",
  "properties": {
    "items": {
      "items": {
        "$ref": "#/$defs/ConversationMessageView"
      },
      "type": "array",
      "title": "Items"
    },
    "next_before": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Next Before",
      "description": "Cursor for the next-older page in `<created_at_iso>_<id>` form. Null when there are no further pages."
    },
    "server_time": {
      "type": "string",
      "format": "date-time",
      "title": "Server Time",
      "description": "Server clock at response time. The client measures how long a turn has been unanswered against this, not the browser clock, which can be skewed by minutes."
    }
  },
  "type": "object",
  "required": [
    "items"
  ],
  "$defs": {
    "ConversationMessageView": {
      "properties": {
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "conversation_id": {
          "type": "integer",
          "title": "Conversation Id"
        },
        "role": {
          "type": "string",
          "enum": [
            "user",
            "assistant",
            "system",
            "tool"
          ],
          "title": "Role"
        },
        "parts": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array",
          "title": "Parts"
        },
        "schema_version": {
          "type": "integer",
          "title": "Schema Version"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        }
      },
      "type": "object",
      "required": [
        "id",
        "conversation_id",
        "role",
        "parts",
        "schema_version",
        "created_at"
      ],
      "title": "ConversationMessageView",
      "description": "One message row served to the client.\n\n``parts`` is the Vercel AI SDK v6 ``UIMessage.parts`` array, untruncated\non the wire (the stream-side truncation applies only to the SSE frame)."
    }
  }
}