---
title: "Generate suggestions for a message"
method: POST
path: "/v1/threads/{threadId}/messages/{messageId}/suggestions"
tags: ["v1"]
---

# Generate suggestions for a message

`POST /v1/threads/{threadId}/messages/{messageId}/suggestions`

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.

## Path parameters

- `threadId` string, required
- `messageId` string, required

## Request body

- GenerateSuggestionsRequest
  - `userKey` string — Identifier for a user in your system. Required if no bearer token is provided.
  - `maxSuggestions` number — Maximum number of suggestions to generate (1-10)
  - `availableComponents` V1AvailableComponent[] — Available components that suggestions can reference
    - `name` string, required — Component name (e.g., 'StockChart')
    - `description` string, required — Description of what this component displays
    - `propsSchema` object, required — JSON Schema for component props
    - `stateSchema` object — Optional JSON Schema for component state

## Response `201`

Suggestions generated successfully

- GenerateSuggestionsResponse
  - `suggestions` Suggestion[], required — List of suggestions for the message
    - `id` string, required — Unique identifier for the suggestion
    - `messageId` string, required — ID of the message this suggestion is for
    - `title` string, required — Short title or summary of the suggestion
    - `detailedSuggestion` string, required — Detailed explanation of the suggestion
    - `description` string, required — Detailed explanation of the suggestion (alias for detailedSuggestion)
    - `metadata` object — Additional metadata for the suggestion
  - `nextCursor` string — Cursor for the next page of results
  - `hasMore` boolean, required — Whether there are more results

## Other responses

- `400` — Invalid request parameters
- `404` — Message not found

---

[API](https://skmtc.net/tambo-ai/apis/tambo-api.md) · [All operations](https://skmtc.net/tambo-ai/apis/tambo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tambo-ai/tambo-api/revisions/312691b28f1c/schema)
