Skip to content
StudyFetch API

Performance Insights

Push messages to conversation

Persists messages to a conversation. Creates the conversation if it does not exist. Image data is stripped before storage.

OpenAPI specification
PUT/api/v1/performance-insights/session/{sessionId}/messages

Authentication

x-api-key

Request

curl --globoff --request PUT \
  --url 'https://api.example.com/api/v1/performance-insights/session/%3CsessionId%3E/messages' \
  --header 'x-api-key: <API_KEY>' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "messages": [
    {}
  ]
}'

Replace credential and <field> placeholders with your own values. URL placeholders appear as %3Cfield%3E. Review the example values before sending your request.

Replace https://api.example.com with the API server URL.

Use the sample JSON body as your starting point, and enter values that match the endpoint's schema.

Parameters

sessionIdpath · string · required

Conversation / session ID

Request body schema or example

{
  "type": "object",
  "properties": {
    "messages": {
      "description": "Array of AI SDK UIMessage objects to persist",
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "title": {
      "type": "string",
      "description": "Update the conversation title"
    },
    "suggestionContext": {
      "type": "string",
      "description": "Stamp suggestionContext onto the conversation if it does not already have one. Ignored when the session already stores a value (including an explicit empty New Chat)."
    }
  },
  "required": [
    "messages"
  ]
}

Responses

200Messages saved
{
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Whether the operation succeeded",
      "example": true
    },
    "messageCount": {
      "type": "number",
      "description": "Number of messages saved (only on push)"
    }
  },
  "required": [
    "success"
  ]
}