v1
latestOpenAPI 3.0.02026-07-174565114.3 KBv1
Generate suggestions for a message
Generate AI-powered suggestions for the next action based on the thread context. Suggestions are persisted and can be retrieved later via the list endpoint. Calling this endpoint replaces any existing suggestions for the message.
post/v1/threads/{threadId}/messages/{messageId}/suggestions
Path parameters
threadIdstring required
Example:thr_abc123xyz
Thread ID
messageIdstring required
Example:msg_xyz789abc
Message ID
Request body
Example request
{
"availableComponents": [
{
"name": "WeatherCard",
"description": "Displays weather information for a location",
"propsSchema": {
"type": "object",
"properties": {
"temperature": {
"type": "number"
},
"location": {
"type": "string"
},
"unit": {
"type": "string",
"enum": [
"celsius",
"fahrenheit"
]
}
},
"required": [
"temperature",
"location"
]
}
}
]
}Response
Suggestions generated successfully
Example response
{
"suggestions": [
{
"id": "sug_123456789",
"messageId": "msg_123456789",
"title": "Add error handling",
"detailedSuggestion": "Add try-catch block to handle potential API errors",
"description": "Add try-catch block to handle potential API errors",
"metadata": {
"category": "error-handling",
"priority": "high"
}
}
]
}