# Messages

## Get Conversation Messages

> Get all messages for a specific conversation branch.\
> \
> The branch is determined by the conversation's last\_message\_id.

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"APIKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","description":"API Key. [Learn how to get it](/docs/api-reference/how-to-get-credentials).","in":"header","name":"X-API-Key"}},"schemas":{"InfinitePagination_Union_UserMessage__AssistantMessage__":{"properties":{"data":{"items":{"anyOf":[{"$ref":"#/components/schemas/UserMessage-Output"},{"$ref":"#/components/schemas/AssistantMessage-Output"}]},"type":"array","title":"Data"},"has_more":{"type":"boolean","title":"Has More"},"first_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Id"},"last_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Id"}},"type":"object","required":["data","has_more"],"title":"InfinitePagination[Union[UserMessage, AssistantMessage]]"},"UserMessage-Output":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type","default":"message"},"created_at":{"type":"integer","title":"Created At"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"role":{"type":"string","title":"Role","default":"user"},"content":{"items":{"anyOf":[{"$ref":"#/components/schemas/TextContentPart"},{"$ref":"#/components/schemas/ImageContentPart"},{"$ref":"#/components/schemas/FileContentPart"}]},"type":"array","title":"Content"},"attachments":{"items":{"$ref":"#/components/schemas/Attachment"},"type":"array","title":"Attachments","default":[]}},"type":"object","required":["id","created_at","content"],"title":"UserMessage"},"TextContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"text"},"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"TextContentPart"},"ImageContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"image"},"image":{"type":"string","title":"Image"}},"type":"object","required":["image"],"title":"ImageContentPart"},"FileContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"file"},"file":{"type":"string","title":"File"}},"type":"object","required":["file"],"title":"FileContentPart"},"Attachment":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","enum":["image","document","file"],"title":"Type"},"name":{"type":"string","title":"Name"},"content_type":{"type":"string","title":"Content Type"},"url":{"type":"string","title":"Url"}},"type":"object","required":["id","type","name","content_type","url"],"title":"Attachment"},"AssistantMessage-Output":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type","default":"message"},"created_at":{"type":"integer","title":"Created At"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"role":{"type":"string","title":"Role","default":"assistant"},"content":{"items":{"anyOf":[{"$ref":"#/components/schemas/TextContentPart"},{"$ref":"#/components/schemas/ToolCallContentPart-Output"},{"$ref":"#/components/schemas/ToolRenderContentPart"},{"$ref":"#/components/schemas/ButtonContentPart"},{"$ref":"#/components/schemas/ConnectionRequiredContentPart"}]},"type":"array","title":"Content"},"status":{"$ref":"#/components/schemas/MessageStatusType"},"error":{"anyOf":[{},{"type":"null"}],"title":"Error"},"citations":{"anyOf":[{"items":{"$ref":"#/components/schemas/Citation-Output"},"type":"array"},{"type":"null"}],"title":"Citations"},"feedback":{"anyOf":[{"$ref":"#/components/schemas/FeedbackMessage"},{"type":"null"}]},"run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"}},"type":"object","required":["id","created_at","content","status"],"title":"AssistantMessage"},"ToolCallContentPart-Output":{"properties":{"type":{"type":"string","title":"Type","default":"tool_call"},"status":{"$ref":"#/components/schemas/ToolCallContentPartStatus"},"tool_call":{"$ref":"#/components/schemas/ToolCall"}},"type":"object","required":["status","tool_call"],"title":"ToolCallContentPart"},"ToolCallContentPartStatus":{"properties":{"type":{"$ref":"#/components/schemas/MessageStatusType"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"error":{"anyOf":[{},{"type":"null"}],"title":"Error"}},"type":"object","required":["type"],"title":"ToolCallContentPartStatus"},"MessageStatusType":{"type":"string","enum":["running","complete","incomplete","requires-action"],"title":"MessageStatusType"},"ToolCall":{"properties":{"tool_call_id":{"type":"string","title":"Tool Call Id"},"action_id":{"type":"string","title":"Action Id"},"action_name":{"type":"string","title":"Action Name"},"provider_id":{"type":"string","title":"Provider Id"},"description":{"type":"string","title":"Description"},"inputs":{"additionalProperties":true,"type":"object","title":"Inputs"},"outputs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Outputs"}},"type":"object","required":["action_id","action_name","provider_id","description","inputs","outputs"],"title":"ToolCall","description":"Model representing a tool call that is streamed by a tool action.\n\nThis model contains real-time information about the tool call execution,\nincluding its inputs, outputs and status. It is not meant for tracking\npurposes but rather for streaming the current state of the tool call."},"ToolRenderContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"tool_render"},"status":{"$ref":"#/components/schemas/MessageStatusType"},"title":{"type":"string","title":"Title"},"icon_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon Url"}},"type":"object","required":["status","title"],"title":"ToolRenderContentPart"},"ButtonContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"button"},"button_id":{"type":"string","title":"Button Id"},"label":{"type":"string","title":"Label"},"is_disabled":{"type":"boolean","title":"Is Disabled","default":false},"resume_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resume Token"},"button_style":{"type":"string","enum":["primary","secondary","danger"],"title":"Button Style","default":"primary"}},"type":"object","required":["button_id","label"],"title":"ButtonContentPart","description":"Content part for buttons in messages."},"ConnectionRequiredContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"connection_required"},"provider_id":{"type":"string","title":"Provider Id"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"connection_setup_url":{"type":"string","title":"Connection Setup Url"},"error_message":{"type":"string","title":"Error Message"},"action_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Id"},"use_end_user_connection":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use End User Connection"}},"type":"object","required":["provider_id","connection_setup_url","error_message"],"title":"ConnectionRequiredContentPart"},"Citation-Output":{"properties":{"id":{"type":"string","title":"Id","description":"An unique identifier for the citation."},"source_id":{"type":"string","title":"Source Id","description":"The id of the source document/website/kb file. Multiple citations may share the same source_id but reference different pages/chunks of that document."},"title":{"type":"string","title":"Title","description":"The title of the source of the citation."},"text":{"type":"string","title":"Text","description":"The text of the citation."},"citation_source_type":{"$ref":"#/components/schemas/CitationSourceType","description":"The type of source of the citation.","default":"other"},"source_is_website":{"type":"boolean","title":"Source Is Website","description":"Whether the source is a website.","default":false},"source_mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Mime Type","description":"The MIME type of the source of the citation."},"external_source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Source Url","description":"A URL link to the source of the citation in gdrive/a website/etc."},"supabase_signed_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supabase Signed Url","description":"A signed URL to download/preview the file coming from StackAI document storage."},"position":{"anyOf":[{"$ref":"#/components/schemas/PositionInDocument"},{"type":"null"}],"description":"Indicates the specific location within the source document where the citation is located."},"knowledge_base_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Knowledge Base Id","description":"The ID of the knowledge base this citation comes from."},"inode_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inode Id","description":"The inode ID of the file in the knowledge base."}},"type":"object","required":["id","source_id","title","text"],"title":"Citation"},"CitationSourceType":{"type":"string","enum":["old_knowledge_bases","knowledge_bases","url_knowledge_bases","exposed_document_node","indexed_document_node","user_uploaded_document_url","other"],"title":"CitationSourceType"},"PositionInDocument":{"properties":{"page_idx":{"type":"string","title":"Page Idx"},"chunk_idx":{"type":"string","title":"Chunk Idx"}},"type":"object","required":["page_idx","chunk_idx"],"title":"PositionInDocument"},"FeedbackMessage":{"properties":{"type":{"type":"string","enum":["positive","negative"],"title":"Type"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"}},"type":"object","required":["type"],"title":"FeedbackMessage"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/projects/{project_id}/conversations/{conversation_id}/messages":{"get":{"tags":["messages"],"summary":"Get Conversation Messages","description":"Get all messages for a specific conversation branch.\n\nThe branch is determined by the conversation's last_message_id.","operationId":"get_conversation_messages_projects__project_id__conversations__conversation_id__messages_get","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InfinitePagination_Union_UserMessage__AssistantMessage__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Append Messages Sso

> Append multiple messages to a given conversation.\
> \
> If the conversation does not exist, it will be created with the first messages.\
> \
> Args:\
> &#x20;   conversation\_id: ID of the conversation to append messages to\
> &#x20;   project\_id: ID of the project the conversation belongs to\
> &#x20;   body: AppendMessagesBody\
> &#x20;   message\_service: Message service dependency\
> &#x20;   conversation\_service: Conversation service dependency\
> \
> Returns:\
> &#x20;   The list of appended messages

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"APIKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","description":"API Key. [Learn how to get it](/docs/api-reference/how-to-get-credentials).","in":"header","name":"X-API-Key"}},"schemas":{"AppendMessagesBody":{"properties":{"messages":{"items":{"anyOf":[{"$ref":"#/components/schemas/UserMessage-Input"},{"$ref":"#/components/schemas/AssistantMessage-Input"}]},"type":"array","title":"Messages"},"user_id":{"type":"string","title":"User Id"}},"type":"object","required":["messages","user_id"],"title":"AppendMessagesBody"},"UserMessage-Input":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type","default":"message"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"role":{"type":"string","title":"Role","default":"user"},"content":{"items":{"anyOf":[{"$ref":"#/components/schemas/TextContentPart"},{"$ref":"#/components/schemas/ImageContentPart"},{"$ref":"#/components/schemas/FileContentPart"}]},"type":"array","title":"Content"},"attachments":{"items":{"$ref":"#/components/schemas/Attachment"},"type":"array","title":"Attachments","default":[]}},"type":"object","required":["id","created_at","content"],"title":"UserMessage"},"TextContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"text"},"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"TextContentPart"},"ImageContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"image"},"image":{"type":"string","title":"Image"}},"type":"object","required":["image"],"title":"ImageContentPart"},"FileContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"file"},"file":{"type":"string","title":"File"}},"type":"object","required":["file"],"title":"FileContentPart"},"Attachment":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","enum":["image","document","file"],"title":"Type"},"name":{"type":"string","title":"Name"},"content_type":{"type":"string","title":"Content Type"},"url":{"type":"string","title":"Url"}},"type":"object","required":["id","type","name","content_type","url"],"title":"Attachment"},"AssistantMessage-Input":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type","default":"message"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"role":{"type":"string","title":"Role","default":"assistant"},"content":{"items":{"anyOf":[{"$ref":"#/components/schemas/TextContentPart"},{"$ref":"#/components/schemas/ToolCallContentPart-Input"},{"$ref":"#/components/schemas/ToolRenderContentPart"},{"$ref":"#/components/schemas/ButtonContentPart"},{"$ref":"#/components/schemas/ConnectionRequiredContentPart"}]},"type":"array","title":"Content"},"status":{"$ref":"#/components/schemas/MessageStatusType"},"error":{"anyOf":[{},{"type":"null"}],"title":"Error"},"citations":{"anyOf":[{"items":{"$ref":"#/components/schemas/Citation-Input"},"type":"array"},{"type":"null"}],"title":"Citations"},"feedback":{"anyOf":[{"$ref":"#/components/schemas/FeedbackMessage"},{"type":"null"}]},"run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"}},"type":"object","required":["id","created_at","content","status"],"title":"AssistantMessage"},"ToolCallContentPart-Input":{"properties":{"type":{"type":"string","title":"Type","default":"tool_call"},"status":{"$ref":"#/components/schemas/ToolCallContentPartStatus"},"tool_call":{"$ref":"#/components/schemas/ToolCall"}},"type":"object","required":["status","tool_call"],"title":"ToolCallContentPart"},"ToolCallContentPartStatus":{"properties":{"type":{"$ref":"#/components/schemas/MessageStatusType"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"error":{"anyOf":[{},{"type":"null"}],"title":"Error"}},"type":"object","required":["type"],"title":"ToolCallContentPartStatus"},"MessageStatusType":{"type":"string","enum":["running","complete","incomplete","requires-action"],"title":"MessageStatusType"},"ToolCall":{"properties":{"tool_call_id":{"type":"string","title":"Tool Call Id"},"action_id":{"type":"string","title":"Action Id"},"action_name":{"type":"string","title":"Action Name"},"provider_id":{"type":"string","title":"Provider Id"},"description":{"type":"string","title":"Description"},"inputs":{"additionalProperties":true,"type":"object","title":"Inputs"},"outputs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Outputs"}},"type":"object","required":["action_id","action_name","provider_id","description","inputs","outputs"],"title":"ToolCall","description":"Model representing a tool call that is streamed by a tool action.\n\nThis model contains real-time information about the tool call execution,\nincluding its inputs, outputs and status. It is not meant for tracking\npurposes but rather for streaming the current state of the tool call."},"ToolRenderContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"tool_render"},"status":{"$ref":"#/components/schemas/MessageStatusType"},"title":{"type":"string","title":"Title"},"icon_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon Url"}},"type":"object","required":["status","title"],"title":"ToolRenderContentPart"},"ButtonContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"button"},"button_id":{"type":"string","title":"Button Id"},"label":{"type":"string","title":"Label"},"is_disabled":{"type":"boolean","title":"Is Disabled","default":false},"resume_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resume Token"},"button_style":{"type":"string","enum":["primary","secondary","danger"],"title":"Button Style","default":"primary"}},"type":"object","required":["button_id","label"],"title":"ButtonContentPart","description":"Content part for buttons in messages."},"ConnectionRequiredContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"connection_required"},"provider_id":{"type":"string","title":"Provider Id"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"connection_setup_url":{"type":"string","title":"Connection Setup Url"},"error_message":{"type":"string","title":"Error Message"},"action_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Id"},"use_end_user_connection":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use End User Connection"}},"type":"object","required":["provider_id","connection_setup_url","error_message"],"title":"ConnectionRequiredContentPart"},"Citation-Input":{"properties":{"id":{"type":"string","title":"Id","description":"An unique identifier for the citation."},"source_id":{"type":"string","title":"Source Id","description":"The id of the source document/website/kb file. Multiple citations may share the same source_id but reference different pages/chunks of that document."},"title":{"type":"string","title":"Title","description":"The title of the source of the citation."},"text":{"type":"string","title":"Text","description":"The text of the citation."},"citation_source_type":{"$ref":"#/components/schemas/CitationSourceType","description":"The type of source of the citation.","default":"other"},"source_is_website":{"type":"boolean","title":"Source Is Website","description":"Whether the source is a website.","default":false},"source_mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Mime Type","description":"The MIME type of the source of the citation."},"external_source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Source Url","description":"A URL link to the source of the citation in gdrive/a website/etc."},"supabase_signed_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supabase Signed Url","description":"A signed URL to download/preview the file coming from StackAI document storage."},"position":{"anyOf":[{"$ref":"#/components/schemas/PositionInDocument"},{"type":"null"}],"description":"Indicates the specific location within the source document where the citation is located."},"knowledge_base_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Knowledge Base Id","description":"The ID of the knowledge base this citation comes from."},"inode_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inode Id","description":"The inode ID of the file in the knowledge base."},"source_chunk":{"anyOf":[{"$ref":"#/components/schemas/EnrichedChunk"},{"type":"null"}]}},"type":"object","required":["id","source_id","title","text"],"title":"Citation"},"CitationSourceType":{"type":"string","enum":["old_knowledge_bases","knowledge_bases","url_knowledge_bases","exposed_document_node","indexed_document_node","user_uploaded_document_url","other"],"title":"CitationSourceType"},"PositionInDocument":{"properties":{"page_idx":{"type":"string","title":"Page Idx"},"chunk_idx":{"type":"string","title":"Chunk Idx"}},"type":"object","required":["page_idx","chunk_idx"],"title":"PositionInDocument"},"EnrichedChunk":{"properties":{"id":{"type":"string","title":"Id"},"source_type":{"$ref":"#/components/schemas/CitationSourceType"},"doc_name":{"type":"string","title":"Doc Name"},"lib_idx":{"type":"string","title":"Lib Idx"},"page_idx":{"type":"string","title":"Page Idx"},"chunk_idx":{"type":"string","title":"Chunk Idx"},"node_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Node Id"},"knowledge_base_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Knowledge Base Id"},"inode_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inode Id"},"text":{"type":"string","title":"Text"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"priority_level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority Level"}},"type":"object","required":["source_type","doc_name","lib_idx","page_idx","chunk_idx","text"],"title":"EnrichedChunk","description":"A fragment of text with information about where it comes from."},"FeedbackMessage":{"properties":{"type":{"type":"string","enum":["positive","negative"],"title":"Type"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"}},"type":"object","required":["type"],"title":"FeedbackMessage"},"UserMessage-Output":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type","default":"message"},"created_at":{"type":"integer","title":"Created At"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"role":{"type":"string","title":"Role","default":"user"},"content":{"items":{"anyOf":[{"$ref":"#/components/schemas/TextContentPart"},{"$ref":"#/components/schemas/ImageContentPart"},{"$ref":"#/components/schemas/FileContentPart"}]},"type":"array","title":"Content"},"attachments":{"items":{"$ref":"#/components/schemas/Attachment"},"type":"array","title":"Attachments","default":[]}},"type":"object","required":["id","created_at","content"],"title":"UserMessage"},"AssistantMessage-Output":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type","default":"message"},"created_at":{"type":"integer","title":"Created At"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"role":{"type":"string","title":"Role","default":"assistant"},"content":{"items":{"anyOf":[{"$ref":"#/components/schemas/TextContentPart"},{"$ref":"#/components/schemas/ToolCallContentPart-Output"},{"$ref":"#/components/schemas/ToolRenderContentPart"},{"$ref":"#/components/schemas/ButtonContentPart"},{"$ref":"#/components/schemas/ConnectionRequiredContentPart"}]},"type":"array","title":"Content"},"status":{"$ref":"#/components/schemas/MessageStatusType"},"error":{"anyOf":[{},{"type":"null"}],"title":"Error"},"citations":{"anyOf":[{"items":{"$ref":"#/components/schemas/Citation-Output"},"type":"array"},{"type":"null"}],"title":"Citations"},"feedback":{"anyOf":[{"$ref":"#/components/schemas/FeedbackMessage"},{"type":"null"}]},"run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"}},"type":"object","required":["id","created_at","content","status"],"title":"AssistantMessage"},"ToolCallContentPart-Output":{"properties":{"type":{"type":"string","title":"Type","default":"tool_call"},"status":{"$ref":"#/components/schemas/ToolCallContentPartStatus"},"tool_call":{"$ref":"#/components/schemas/ToolCall"}},"type":"object","required":["status","tool_call"],"title":"ToolCallContentPart"},"Citation-Output":{"properties":{"id":{"type":"string","title":"Id","description":"An unique identifier for the citation."},"source_id":{"type":"string","title":"Source Id","description":"The id of the source document/website/kb file. Multiple citations may share the same source_id but reference different pages/chunks of that document."},"title":{"type":"string","title":"Title","description":"The title of the source of the citation."},"text":{"type":"string","title":"Text","description":"The text of the citation."},"citation_source_type":{"$ref":"#/components/schemas/CitationSourceType","description":"The type of source of the citation.","default":"other"},"source_is_website":{"type":"boolean","title":"Source Is Website","description":"Whether the source is a website.","default":false},"source_mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Mime Type","description":"The MIME type of the source of the citation."},"external_source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Source Url","description":"A URL link to the source of the citation in gdrive/a website/etc."},"supabase_signed_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supabase Signed Url","description":"A signed URL to download/preview the file coming from StackAI document storage."},"position":{"anyOf":[{"$ref":"#/components/schemas/PositionInDocument"},{"type":"null"}],"description":"Indicates the specific location within the source document where the citation is located."},"knowledge_base_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Knowledge Base Id","description":"The ID of the knowledge base this citation comes from."},"inode_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inode Id","description":"The inode ID of the file in the knowledge base."}},"type":"object","required":["id","source_id","title","text"],"title":"Citation"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/projects/{project_id}/conversations/{conversation_id}/messages":{"post":{"tags":["messages"],"summary":"Append Messages Sso","description":"Append multiple messages to a given conversation.\n\nIf the conversation does not exist, it will be created with the first messages.\n\nArgs:\n    conversation_id: ID of the conversation to append messages to\n    project_id: ID of the project the conversation belongs to\n    body: AppendMessagesBody\n    message_service: Message service dependency\n    conversation_service: Conversation service dependency\n\nReturns:\n    The list of appended messages","operationId":"append_messages_sso_projects__project_id__conversations__conversation_id__messages_post","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}},{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppendMessagesBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/UserMessage-Output"},{"$ref":"#/components/schemas/AssistantMessage-Output"}]},"title":"Response Append Messages Sso Projects  Project Id  Conversations  Conversation Id  Messages Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Get Conversation Messages Sso

> Get all messages for a specific conversation branch.\
> \
> The branch is determined by the conversation's last\_message\_id.

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"OAuth2PasswordBearer":[]},{"APIKeyHeader":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}},"APIKeyHeader":{"type":"apiKey","description":"API Key. [Learn how to get it](/docs/api-reference/how-to-get-credentials).","in":"header","name":"X-API-Key"}},"schemas":{"InfinitePagination_Union_UserMessage__AssistantMessage__":{"properties":{"data":{"items":{"anyOf":[{"$ref":"#/components/schemas/UserMessage-Output"},{"$ref":"#/components/schemas/AssistantMessage-Output"}]},"type":"array","title":"Data"},"has_more":{"type":"boolean","title":"Has More"},"first_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Id"},"last_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Id"}},"type":"object","required":["data","has_more"],"title":"InfinitePagination[Union[UserMessage, AssistantMessage]]"},"UserMessage-Output":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type","default":"message"},"created_at":{"type":"integer","title":"Created At"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"role":{"type":"string","title":"Role","default":"user"},"content":{"items":{"anyOf":[{"$ref":"#/components/schemas/TextContentPart"},{"$ref":"#/components/schemas/ImageContentPart"},{"$ref":"#/components/schemas/FileContentPart"}]},"type":"array","title":"Content"},"attachments":{"items":{"$ref":"#/components/schemas/Attachment"},"type":"array","title":"Attachments","default":[]}},"type":"object","required":["id","created_at","content"],"title":"UserMessage"},"TextContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"text"},"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"TextContentPart"},"ImageContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"image"},"image":{"type":"string","title":"Image"}},"type":"object","required":["image"],"title":"ImageContentPart"},"FileContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"file"},"file":{"type":"string","title":"File"}},"type":"object","required":["file"],"title":"FileContentPart"},"Attachment":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","enum":["image","document","file"],"title":"Type"},"name":{"type":"string","title":"Name"},"content_type":{"type":"string","title":"Content Type"},"url":{"type":"string","title":"Url"}},"type":"object","required":["id","type","name","content_type","url"],"title":"Attachment"},"AssistantMessage-Output":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type","default":"message"},"created_at":{"type":"integer","title":"Created At"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"role":{"type":"string","title":"Role","default":"assistant"},"content":{"items":{"anyOf":[{"$ref":"#/components/schemas/TextContentPart"},{"$ref":"#/components/schemas/ToolCallContentPart-Output"},{"$ref":"#/components/schemas/ToolRenderContentPart"},{"$ref":"#/components/schemas/ButtonContentPart"},{"$ref":"#/components/schemas/ConnectionRequiredContentPart"}]},"type":"array","title":"Content"},"status":{"$ref":"#/components/schemas/MessageStatusType"},"error":{"anyOf":[{},{"type":"null"}],"title":"Error"},"citations":{"anyOf":[{"items":{"$ref":"#/components/schemas/Citation-Output"},"type":"array"},{"type":"null"}],"title":"Citations"},"feedback":{"anyOf":[{"$ref":"#/components/schemas/FeedbackMessage"},{"type":"null"}]},"run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"}},"type":"object","required":["id","created_at","content","status"],"title":"AssistantMessage"},"ToolCallContentPart-Output":{"properties":{"type":{"type":"string","title":"Type","default":"tool_call"},"status":{"$ref":"#/components/schemas/ToolCallContentPartStatus"},"tool_call":{"$ref":"#/components/schemas/ToolCall"}},"type":"object","required":["status","tool_call"],"title":"ToolCallContentPart"},"ToolCallContentPartStatus":{"properties":{"type":{"$ref":"#/components/schemas/MessageStatusType"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"error":{"anyOf":[{},{"type":"null"}],"title":"Error"}},"type":"object","required":["type"],"title":"ToolCallContentPartStatus"},"MessageStatusType":{"type":"string","enum":["running","complete","incomplete","requires-action"],"title":"MessageStatusType"},"ToolCall":{"properties":{"tool_call_id":{"type":"string","title":"Tool Call Id"},"action_id":{"type":"string","title":"Action Id"},"action_name":{"type":"string","title":"Action Name"},"provider_id":{"type":"string","title":"Provider Id"},"description":{"type":"string","title":"Description"},"inputs":{"additionalProperties":true,"type":"object","title":"Inputs"},"outputs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Outputs"}},"type":"object","required":["action_id","action_name","provider_id","description","inputs","outputs"],"title":"ToolCall","description":"Model representing a tool call that is streamed by a tool action.\n\nThis model contains real-time information about the tool call execution,\nincluding its inputs, outputs and status. It is not meant for tracking\npurposes but rather for streaming the current state of the tool call."},"ToolRenderContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"tool_render"},"status":{"$ref":"#/components/schemas/MessageStatusType"},"title":{"type":"string","title":"Title"},"icon_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon Url"}},"type":"object","required":["status","title"],"title":"ToolRenderContentPart"},"ButtonContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"button"},"button_id":{"type":"string","title":"Button Id"},"label":{"type":"string","title":"Label"},"is_disabled":{"type":"boolean","title":"Is Disabled","default":false},"resume_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resume Token"},"button_style":{"type":"string","enum":["primary","secondary","danger"],"title":"Button Style","default":"primary"}},"type":"object","required":["button_id","label"],"title":"ButtonContentPart","description":"Content part for buttons in messages."},"ConnectionRequiredContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"connection_required"},"provider_id":{"type":"string","title":"Provider Id"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"connection_setup_url":{"type":"string","title":"Connection Setup Url"},"error_message":{"type":"string","title":"Error Message"},"action_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Id"},"use_end_user_connection":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use End User Connection"}},"type":"object","required":["provider_id","connection_setup_url","error_message"],"title":"ConnectionRequiredContentPart"},"Citation-Output":{"properties":{"id":{"type":"string","title":"Id","description":"An unique identifier for the citation."},"source_id":{"type":"string","title":"Source Id","description":"The id of the source document/website/kb file. Multiple citations may share the same source_id but reference different pages/chunks of that document."},"title":{"type":"string","title":"Title","description":"The title of the source of the citation."},"text":{"type":"string","title":"Text","description":"The text of the citation."},"citation_source_type":{"$ref":"#/components/schemas/CitationSourceType","description":"The type of source of the citation.","default":"other"},"source_is_website":{"type":"boolean","title":"Source Is Website","description":"Whether the source is a website.","default":false},"source_mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Mime Type","description":"The MIME type of the source of the citation."},"external_source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Source Url","description":"A URL link to the source of the citation in gdrive/a website/etc."},"supabase_signed_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supabase Signed Url","description":"A signed URL to download/preview the file coming from StackAI document storage."},"position":{"anyOf":[{"$ref":"#/components/schemas/PositionInDocument"},{"type":"null"}],"description":"Indicates the specific location within the source document where the citation is located."},"knowledge_base_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Knowledge Base Id","description":"The ID of the knowledge base this citation comes from."},"inode_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inode Id","description":"The inode ID of the file in the knowledge base."}},"type":"object","required":["id","source_id","title","text"],"title":"Citation"},"CitationSourceType":{"type":"string","enum":["old_knowledge_bases","knowledge_bases","url_knowledge_bases","exposed_document_node","indexed_document_node","user_uploaded_document_url","other"],"title":"CitationSourceType"},"PositionInDocument":{"properties":{"page_idx":{"type":"string","title":"Page Idx"},"chunk_idx":{"type":"string","title":"Chunk Idx"}},"type":"object","required":["page_idx","chunk_idx"],"title":"PositionInDocument"},"FeedbackMessage":{"properties":{"type":{"type":"string","enum":["positive","negative"],"title":"Type"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"}},"type":"object","required":["type"],"title":"FeedbackMessage"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/projects/{project_id}/conversations/sso/{conversation_id}/messages":{"get":{"tags":["messages"],"summary":"Get Conversation Messages Sso","description":"Get all messages for a specific conversation branch.\n\nThe branch is determined by the conversation's last_message_id.","operationId":"get_conversation_messages_sso_projects__project_id__conversations_sso__conversation_id__messages_get","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InfinitePagination_Union_UserMessage__AssistantMessage__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Append Messages

> Append multiple messages to a given conversation.\
> \
> If the conversation does not exist, it will be created with the first messages.\
> \
> Args:\
> &#x20;   conversation\_id: ID of the conversation to append messages to\
> &#x20;   project\_id: ID of the project the conversation belongs to\
> &#x20;   body: AppendMessagesBody\
> &#x20;   message\_service: Message service dependency\
> &#x20;   conversation\_service: Conversation service dependency\
> \
> Returns:\
> &#x20;   The list of appended messages

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}},"schemas":{"AppendMessagesBody":{"properties":{"messages":{"items":{"anyOf":[{"$ref":"#/components/schemas/UserMessage-Input"},{"$ref":"#/components/schemas/AssistantMessage-Input"}]},"type":"array","title":"Messages"},"user_id":{"type":"string","title":"User Id"}},"type":"object","required":["messages","user_id"],"title":"AppendMessagesBody"},"UserMessage-Input":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type","default":"message"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"role":{"type":"string","title":"Role","default":"user"},"content":{"items":{"anyOf":[{"$ref":"#/components/schemas/TextContentPart"},{"$ref":"#/components/schemas/ImageContentPart"},{"$ref":"#/components/schemas/FileContentPart"}]},"type":"array","title":"Content"},"attachments":{"items":{"$ref":"#/components/schemas/Attachment"},"type":"array","title":"Attachments","default":[]}},"type":"object","required":["id","created_at","content"],"title":"UserMessage"},"TextContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"text"},"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"TextContentPart"},"ImageContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"image"},"image":{"type":"string","title":"Image"}},"type":"object","required":["image"],"title":"ImageContentPart"},"FileContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"file"},"file":{"type":"string","title":"File"}},"type":"object","required":["file"],"title":"FileContentPart"},"Attachment":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","enum":["image","document","file"],"title":"Type"},"name":{"type":"string","title":"Name"},"content_type":{"type":"string","title":"Content Type"},"url":{"type":"string","title":"Url"}},"type":"object","required":["id","type","name","content_type","url"],"title":"Attachment"},"AssistantMessage-Input":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type","default":"message"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"role":{"type":"string","title":"Role","default":"assistant"},"content":{"items":{"anyOf":[{"$ref":"#/components/schemas/TextContentPart"},{"$ref":"#/components/schemas/ToolCallContentPart-Input"},{"$ref":"#/components/schemas/ToolRenderContentPart"},{"$ref":"#/components/schemas/ButtonContentPart"},{"$ref":"#/components/schemas/ConnectionRequiredContentPart"}]},"type":"array","title":"Content"},"status":{"$ref":"#/components/schemas/MessageStatusType"},"error":{"anyOf":[{},{"type":"null"}],"title":"Error"},"citations":{"anyOf":[{"items":{"$ref":"#/components/schemas/Citation-Input"},"type":"array"},{"type":"null"}],"title":"Citations"},"feedback":{"anyOf":[{"$ref":"#/components/schemas/FeedbackMessage"},{"type":"null"}]},"run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"}},"type":"object","required":["id","created_at","content","status"],"title":"AssistantMessage"},"ToolCallContentPart-Input":{"properties":{"type":{"type":"string","title":"Type","default":"tool_call"},"status":{"$ref":"#/components/schemas/ToolCallContentPartStatus"},"tool_call":{"$ref":"#/components/schemas/ToolCall"}},"type":"object","required":["status","tool_call"],"title":"ToolCallContentPart"},"ToolCallContentPartStatus":{"properties":{"type":{"$ref":"#/components/schemas/MessageStatusType"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"error":{"anyOf":[{},{"type":"null"}],"title":"Error"}},"type":"object","required":["type"],"title":"ToolCallContentPartStatus"},"MessageStatusType":{"type":"string","enum":["running","complete","incomplete","requires-action"],"title":"MessageStatusType"},"ToolCall":{"properties":{"tool_call_id":{"type":"string","title":"Tool Call Id"},"action_id":{"type":"string","title":"Action Id"},"action_name":{"type":"string","title":"Action Name"},"provider_id":{"type":"string","title":"Provider Id"},"description":{"type":"string","title":"Description"},"inputs":{"additionalProperties":true,"type":"object","title":"Inputs"},"outputs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Outputs"}},"type":"object","required":["action_id","action_name","provider_id","description","inputs","outputs"],"title":"ToolCall","description":"Model representing a tool call that is streamed by a tool action.\n\nThis model contains real-time information about the tool call execution,\nincluding its inputs, outputs and status. It is not meant for tracking\npurposes but rather for streaming the current state of the tool call."},"ToolRenderContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"tool_render"},"status":{"$ref":"#/components/schemas/MessageStatusType"},"title":{"type":"string","title":"Title"},"icon_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon Url"}},"type":"object","required":["status","title"],"title":"ToolRenderContentPart"},"ButtonContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"button"},"button_id":{"type":"string","title":"Button Id"},"label":{"type":"string","title":"Label"},"is_disabled":{"type":"boolean","title":"Is Disabled","default":false},"resume_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resume Token"},"button_style":{"type":"string","enum":["primary","secondary","danger"],"title":"Button Style","default":"primary"}},"type":"object","required":["button_id","label"],"title":"ButtonContentPart","description":"Content part for buttons in messages."},"ConnectionRequiredContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"connection_required"},"provider_id":{"type":"string","title":"Provider Id"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"connection_setup_url":{"type":"string","title":"Connection Setup Url"},"error_message":{"type":"string","title":"Error Message"},"action_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Id"},"use_end_user_connection":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use End User Connection"}},"type":"object","required":["provider_id","connection_setup_url","error_message"],"title":"ConnectionRequiredContentPart"},"Citation-Input":{"properties":{"id":{"type":"string","title":"Id","description":"An unique identifier for the citation."},"source_id":{"type":"string","title":"Source Id","description":"The id of the source document/website/kb file. Multiple citations may share the same source_id but reference different pages/chunks of that document."},"title":{"type":"string","title":"Title","description":"The title of the source of the citation."},"text":{"type":"string","title":"Text","description":"The text of the citation."},"citation_source_type":{"$ref":"#/components/schemas/CitationSourceType","description":"The type of source of the citation.","default":"other"},"source_is_website":{"type":"boolean","title":"Source Is Website","description":"Whether the source is a website.","default":false},"source_mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Mime Type","description":"The MIME type of the source of the citation."},"external_source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Source Url","description":"A URL link to the source of the citation in gdrive/a website/etc."},"supabase_signed_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supabase Signed Url","description":"A signed URL to download/preview the file coming from StackAI document storage."},"position":{"anyOf":[{"$ref":"#/components/schemas/PositionInDocument"},{"type":"null"}],"description":"Indicates the specific location within the source document where the citation is located."},"knowledge_base_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Knowledge Base Id","description":"The ID of the knowledge base this citation comes from."},"inode_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inode Id","description":"The inode ID of the file in the knowledge base."},"source_chunk":{"anyOf":[{"$ref":"#/components/schemas/EnrichedChunk"},{"type":"null"}]}},"type":"object","required":["id","source_id","title","text"],"title":"Citation"},"CitationSourceType":{"type":"string","enum":["old_knowledge_bases","knowledge_bases","url_knowledge_bases","exposed_document_node","indexed_document_node","user_uploaded_document_url","other"],"title":"CitationSourceType"},"PositionInDocument":{"properties":{"page_idx":{"type":"string","title":"Page Idx"},"chunk_idx":{"type":"string","title":"Chunk Idx"}},"type":"object","required":["page_idx","chunk_idx"],"title":"PositionInDocument"},"EnrichedChunk":{"properties":{"id":{"type":"string","title":"Id"},"source_type":{"$ref":"#/components/schemas/CitationSourceType"},"doc_name":{"type":"string","title":"Doc Name"},"lib_idx":{"type":"string","title":"Lib Idx"},"page_idx":{"type":"string","title":"Page Idx"},"chunk_idx":{"type":"string","title":"Chunk Idx"},"node_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Node Id"},"knowledge_base_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Knowledge Base Id"},"inode_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inode Id"},"text":{"type":"string","title":"Text"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"priority_level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority Level"}},"type":"object","required":["source_type","doc_name","lib_idx","page_idx","chunk_idx","text"],"title":"EnrichedChunk","description":"A fragment of text with information about where it comes from."},"FeedbackMessage":{"properties":{"type":{"type":"string","enum":["positive","negative"],"title":"Type"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"}},"type":"object","required":["type"],"title":"FeedbackMessage"},"UserMessage-Output":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type","default":"message"},"created_at":{"type":"integer","title":"Created At"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"role":{"type":"string","title":"Role","default":"user"},"content":{"items":{"anyOf":[{"$ref":"#/components/schemas/TextContentPart"},{"$ref":"#/components/schemas/ImageContentPart"},{"$ref":"#/components/schemas/FileContentPart"}]},"type":"array","title":"Content"},"attachments":{"items":{"$ref":"#/components/schemas/Attachment"},"type":"array","title":"Attachments","default":[]}},"type":"object","required":["id","created_at","content"],"title":"UserMessage"},"AssistantMessage-Output":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type","default":"message"},"created_at":{"type":"integer","title":"Created At"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"role":{"type":"string","title":"Role","default":"assistant"},"content":{"items":{"anyOf":[{"$ref":"#/components/schemas/TextContentPart"},{"$ref":"#/components/schemas/ToolCallContentPart-Output"},{"$ref":"#/components/schemas/ToolRenderContentPart"},{"$ref":"#/components/schemas/ButtonContentPart"},{"$ref":"#/components/schemas/ConnectionRequiredContentPart"}]},"type":"array","title":"Content"},"status":{"$ref":"#/components/schemas/MessageStatusType"},"error":{"anyOf":[{},{"type":"null"}],"title":"Error"},"citations":{"anyOf":[{"items":{"$ref":"#/components/schemas/Citation-Output"},"type":"array"},{"type":"null"}],"title":"Citations"},"feedback":{"anyOf":[{"$ref":"#/components/schemas/FeedbackMessage"},{"type":"null"}]},"run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"}},"type":"object","required":["id","created_at","content","status"],"title":"AssistantMessage"},"ToolCallContentPart-Output":{"properties":{"type":{"type":"string","title":"Type","default":"tool_call"},"status":{"$ref":"#/components/schemas/ToolCallContentPartStatus"},"tool_call":{"$ref":"#/components/schemas/ToolCall"}},"type":"object","required":["status","tool_call"],"title":"ToolCallContentPart"},"Citation-Output":{"properties":{"id":{"type":"string","title":"Id","description":"An unique identifier for the citation."},"source_id":{"type":"string","title":"Source Id","description":"The id of the source document/website/kb file. Multiple citations may share the same source_id but reference different pages/chunks of that document."},"title":{"type":"string","title":"Title","description":"The title of the source of the citation."},"text":{"type":"string","title":"Text","description":"The text of the citation."},"citation_source_type":{"$ref":"#/components/schemas/CitationSourceType","description":"The type of source of the citation.","default":"other"},"source_is_website":{"type":"boolean","title":"Source Is Website","description":"Whether the source is a website.","default":false},"source_mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Mime Type","description":"The MIME type of the source of the citation."},"external_source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Source Url","description":"A URL link to the source of the citation in gdrive/a website/etc."},"supabase_signed_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supabase Signed Url","description":"A signed URL to download/preview the file coming from StackAI document storage."},"position":{"anyOf":[{"$ref":"#/components/schemas/PositionInDocument"},{"type":"null"}],"description":"Indicates the specific location within the source document where the citation is located."},"knowledge_base_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Knowledge Base Id","description":"The ID of the knowledge base this citation comes from."},"inode_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inode Id","description":"The inode ID of the file in the knowledge base."}},"type":"object","required":["id","source_id","title","text"],"title":"Citation"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/projects/{project_id}/conversations/sso/{conversation_id}/messages":{"post":{"tags":["messages"],"summary":"Append Messages","description":"Append multiple messages to a given conversation.\n\nIf the conversation does not exist, it will be created with the first messages.\n\nArgs:\n    conversation_id: ID of the conversation to append messages to\n    project_id: ID of the project the conversation belongs to\n    body: AppendMessagesBody\n    message_service: Message service dependency\n    conversation_service: Conversation service dependency\n\nReturns:\n    The list of appended messages","operationId":"append_messages_projects__project_id__conversations_sso__conversation_id__messages_post","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}},{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppendMessagesBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/UserMessage-Output"},{"$ref":"#/components/schemas/AssistantMessage-Output"}]},"title":"Response Append Messages Projects  Project Id  Conversations Sso  Conversation Id  Messages Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## PATCH /projects/{project\_id}/messages/{message\_id}/feedback

> Update Message Feedback

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"APIKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","description":"API Key. [Learn how to get it](/docs/api-reference/how-to-get-credentials).","in":"header","name":"X-API-Key"}},"schemas":{"FeedbackMessage":{"properties":{"type":{"type":"string","enum":["positive","negative"],"title":"Type"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"}},"type":"object","required":["type"],"title":"FeedbackMessage"},"UserMessage-Output":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type","default":"message"},"created_at":{"type":"integer","title":"Created At"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"role":{"type":"string","title":"Role","default":"user"},"content":{"items":{"anyOf":[{"$ref":"#/components/schemas/TextContentPart"},{"$ref":"#/components/schemas/ImageContentPart"},{"$ref":"#/components/schemas/FileContentPart"}]},"type":"array","title":"Content"},"attachments":{"items":{"$ref":"#/components/schemas/Attachment"},"type":"array","title":"Attachments","default":[]}},"type":"object","required":["id","created_at","content"],"title":"UserMessage"},"TextContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"text"},"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"TextContentPart"},"ImageContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"image"},"image":{"type":"string","title":"Image"}},"type":"object","required":["image"],"title":"ImageContentPart"},"FileContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"file"},"file":{"type":"string","title":"File"}},"type":"object","required":["file"],"title":"FileContentPart"},"Attachment":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","enum":["image","document","file"],"title":"Type"},"name":{"type":"string","title":"Name"},"content_type":{"type":"string","title":"Content Type"},"url":{"type":"string","title":"Url"}},"type":"object","required":["id","type","name","content_type","url"],"title":"Attachment"},"AssistantMessage-Output":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type","default":"message"},"created_at":{"type":"integer","title":"Created At"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"role":{"type":"string","title":"Role","default":"assistant"},"content":{"items":{"anyOf":[{"$ref":"#/components/schemas/TextContentPart"},{"$ref":"#/components/schemas/ToolCallContentPart-Output"},{"$ref":"#/components/schemas/ToolRenderContentPart"},{"$ref":"#/components/schemas/ButtonContentPart"},{"$ref":"#/components/schemas/ConnectionRequiredContentPart"}]},"type":"array","title":"Content"},"status":{"$ref":"#/components/schemas/MessageStatusType"},"error":{"anyOf":[{},{"type":"null"}],"title":"Error"},"citations":{"anyOf":[{"items":{"$ref":"#/components/schemas/Citation-Output"},"type":"array"},{"type":"null"}],"title":"Citations"},"feedback":{"anyOf":[{"$ref":"#/components/schemas/FeedbackMessage"},{"type":"null"}]},"run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"}},"type":"object","required":["id","created_at","content","status"],"title":"AssistantMessage"},"ToolCallContentPart-Output":{"properties":{"type":{"type":"string","title":"Type","default":"tool_call"},"status":{"$ref":"#/components/schemas/ToolCallContentPartStatus"},"tool_call":{"$ref":"#/components/schemas/ToolCall"}},"type":"object","required":["status","tool_call"],"title":"ToolCallContentPart"},"ToolCallContentPartStatus":{"properties":{"type":{"$ref":"#/components/schemas/MessageStatusType"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"error":{"anyOf":[{},{"type":"null"}],"title":"Error"}},"type":"object","required":["type"],"title":"ToolCallContentPartStatus"},"MessageStatusType":{"type":"string","enum":["running","complete","incomplete","requires-action"],"title":"MessageStatusType"},"ToolCall":{"properties":{"tool_call_id":{"type":"string","title":"Tool Call Id"},"action_id":{"type":"string","title":"Action Id"},"action_name":{"type":"string","title":"Action Name"},"provider_id":{"type":"string","title":"Provider Id"},"description":{"type":"string","title":"Description"},"inputs":{"additionalProperties":true,"type":"object","title":"Inputs"},"outputs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Outputs"}},"type":"object","required":["action_id","action_name","provider_id","description","inputs","outputs"],"title":"ToolCall","description":"Model representing a tool call that is streamed by a tool action.\n\nThis model contains real-time information about the tool call execution,\nincluding its inputs, outputs and status. It is not meant for tracking\npurposes but rather for streaming the current state of the tool call."},"ToolRenderContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"tool_render"},"status":{"$ref":"#/components/schemas/MessageStatusType"},"title":{"type":"string","title":"Title"},"icon_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon Url"}},"type":"object","required":["status","title"],"title":"ToolRenderContentPart"},"ButtonContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"button"},"button_id":{"type":"string","title":"Button Id"},"label":{"type":"string","title":"Label"},"is_disabled":{"type":"boolean","title":"Is Disabled","default":false},"resume_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resume Token"},"button_style":{"type":"string","enum":["primary","secondary","danger"],"title":"Button Style","default":"primary"}},"type":"object","required":["button_id","label"],"title":"ButtonContentPart","description":"Content part for buttons in messages."},"ConnectionRequiredContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"connection_required"},"provider_id":{"type":"string","title":"Provider Id"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"connection_setup_url":{"type":"string","title":"Connection Setup Url"},"error_message":{"type":"string","title":"Error Message"},"action_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Id"},"use_end_user_connection":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use End User Connection"}},"type":"object","required":["provider_id","connection_setup_url","error_message"],"title":"ConnectionRequiredContentPart"},"Citation-Output":{"properties":{"id":{"type":"string","title":"Id","description":"An unique identifier for the citation."},"source_id":{"type":"string","title":"Source Id","description":"The id of the source document/website/kb file. Multiple citations may share the same source_id but reference different pages/chunks of that document."},"title":{"type":"string","title":"Title","description":"The title of the source of the citation."},"text":{"type":"string","title":"Text","description":"The text of the citation."},"citation_source_type":{"$ref":"#/components/schemas/CitationSourceType","description":"The type of source of the citation.","default":"other"},"source_is_website":{"type":"boolean","title":"Source Is Website","description":"Whether the source is a website.","default":false},"source_mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Mime Type","description":"The MIME type of the source of the citation."},"external_source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Source Url","description":"A URL link to the source of the citation in gdrive/a website/etc."},"supabase_signed_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supabase Signed Url","description":"A signed URL to download/preview the file coming from StackAI document storage."},"position":{"anyOf":[{"$ref":"#/components/schemas/PositionInDocument"},{"type":"null"}],"description":"Indicates the specific location within the source document where the citation is located."},"knowledge_base_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Knowledge Base Id","description":"The ID of the knowledge base this citation comes from."},"inode_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inode Id","description":"The inode ID of the file in the knowledge base."}},"type":"object","required":["id","source_id","title","text"],"title":"Citation"},"CitationSourceType":{"type":"string","enum":["old_knowledge_bases","knowledge_bases","url_knowledge_bases","exposed_document_node","indexed_document_node","user_uploaded_document_url","other"],"title":"CitationSourceType"},"PositionInDocument":{"properties":{"page_idx":{"type":"string","title":"Page Idx"},"chunk_idx":{"type":"string","title":"Chunk Idx"}},"type":"object","required":["page_idx","chunk_idx"],"title":"PositionInDocument"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/projects/{project_id}/messages/{message_id}/feedback":{"patch":{"tags":["messages"],"summary":"Update Message Feedback","operationId":"update_message_feedback_projects__project_id__messages__message_id__feedback_patch","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"message_id","in":"path","required":true,"schema":{"type":"string","title":"Message Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackMessage"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/UserMessage-Output"},{"$ref":"#/components/schemas/AssistantMessage-Output"}],"title":"Response Update Message Feedback Projects  Project Id  Messages  Message Id  Feedback Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## PATCH /projects/{project\_id}/messages/sso/{message\_id}/feedback

> Update Message Feedback Sso

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}},"schemas":{"FeedbackMessage":{"properties":{"type":{"type":"string","enum":["positive","negative"],"title":"Type"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"}},"type":"object","required":["type"],"title":"FeedbackMessage"},"UserMessage-Output":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type","default":"message"},"created_at":{"type":"integer","title":"Created At"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"role":{"type":"string","title":"Role","default":"user"},"content":{"items":{"anyOf":[{"$ref":"#/components/schemas/TextContentPart"},{"$ref":"#/components/schemas/ImageContentPart"},{"$ref":"#/components/schemas/FileContentPart"}]},"type":"array","title":"Content"},"attachments":{"items":{"$ref":"#/components/schemas/Attachment"},"type":"array","title":"Attachments","default":[]}},"type":"object","required":["id","created_at","content"],"title":"UserMessage"},"TextContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"text"},"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"TextContentPart"},"ImageContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"image"},"image":{"type":"string","title":"Image"}},"type":"object","required":["image"],"title":"ImageContentPart"},"FileContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"file"},"file":{"type":"string","title":"File"}},"type":"object","required":["file"],"title":"FileContentPart"},"Attachment":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","enum":["image","document","file"],"title":"Type"},"name":{"type":"string","title":"Name"},"content_type":{"type":"string","title":"Content Type"},"url":{"type":"string","title":"Url"}},"type":"object","required":["id","type","name","content_type","url"],"title":"Attachment"},"AssistantMessage-Output":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type","default":"message"},"created_at":{"type":"integer","title":"Created At"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"role":{"type":"string","title":"Role","default":"assistant"},"content":{"items":{"anyOf":[{"$ref":"#/components/schemas/TextContentPart"},{"$ref":"#/components/schemas/ToolCallContentPart-Output"},{"$ref":"#/components/schemas/ToolRenderContentPart"},{"$ref":"#/components/schemas/ButtonContentPart"},{"$ref":"#/components/schemas/ConnectionRequiredContentPart"}]},"type":"array","title":"Content"},"status":{"$ref":"#/components/schemas/MessageStatusType"},"error":{"anyOf":[{},{"type":"null"}],"title":"Error"},"citations":{"anyOf":[{"items":{"$ref":"#/components/schemas/Citation-Output"},"type":"array"},{"type":"null"}],"title":"Citations"},"feedback":{"anyOf":[{"$ref":"#/components/schemas/FeedbackMessage"},{"type":"null"}]},"run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"}},"type":"object","required":["id","created_at","content","status"],"title":"AssistantMessage"},"ToolCallContentPart-Output":{"properties":{"type":{"type":"string","title":"Type","default":"tool_call"},"status":{"$ref":"#/components/schemas/ToolCallContentPartStatus"},"tool_call":{"$ref":"#/components/schemas/ToolCall"}},"type":"object","required":["status","tool_call"],"title":"ToolCallContentPart"},"ToolCallContentPartStatus":{"properties":{"type":{"$ref":"#/components/schemas/MessageStatusType"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"error":{"anyOf":[{},{"type":"null"}],"title":"Error"}},"type":"object","required":["type"],"title":"ToolCallContentPartStatus"},"MessageStatusType":{"type":"string","enum":["running","complete","incomplete","requires-action"],"title":"MessageStatusType"},"ToolCall":{"properties":{"tool_call_id":{"type":"string","title":"Tool Call Id"},"action_id":{"type":"string","title":"Action Id"},"action_name":{"type":"string","title":"Action Name"},"provider_id":{"type":"string","title":"Provider Id"},"description":{"type":"string","title":"Description"},"inputs":{"additionalProperties":true,"type":"object","title":"Inputs"},"outputs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Outputs"}},"type":"object","required":["action_id","action_name","provider_id","description","inputs","outputs"],"title":"ToolCall","description":"Model representing a tool call that is streamed by a tool action.\n\nThis model contains real-time information about the tool call execution,\nincluding its inputs, outputs and status. It is not meant for tracking\npurposes but rather for streaming the current state of the tool call."},"ToolRenderContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"tool_render"},"status":{"$ref":"#/components/schemas/MessageStatusType"},"title":{"type":"string","title":"Title"},"icon_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon Url"}},"type":"object","required":["status","title"],"title":"ToolRenderContentPart"},"ButtonContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"button"},"button_id":{"type":"string","title":"Button Id"},"label":{"type":"string","title":"Label"},"is_disabled":{"type":"boolean","title":"Is Disabled","default":false},"resume_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resume Token"},"button_style":{"type":"string","enum":["primary","secondary","danger"],"title":"Button Style","default":"primary"}},"type":"object","required":["button_id","label"],"title":"ButtonContentPart","description":"Content part for buttons in messages."},"ConnectionRequiredContentPart":{"properties":{"type":{"type":"string","title":"Type","default":"connection_required"},"provider_id":{"type":"string","title":"Provider Id"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"connection_setup_url":{"type":"string","title":"Connection Setup Url"},"error_message":{"type":"string","title":"Error Message"},"action_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Id"},"use_end_user_connection":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use End User Connection"}},"type":"object","required":["provider_id","connection_setup_url","error_message"],"title":"ConnectionRequiredContentPart"},"Citation-Output":{"properties":{"id":{"type":"string","title":"Id","description":"An unique identifier for the citation."},"source_id":{"type":"string","title":"Source Id","description":"The id of the source document/website/kb file. Multiple citations may share the same source_id but reference different pages/chunks of that document."},"title":{"type":"string","title":"Title","description":"The title of the source of the citation."},"text":{"type":"string","title":"Text","description":"The text of the citation."},"citation_source_type":{"$ref":"#/components/schemas/CitationSourceType","description":"The type of source of the citation.","default":"other"},"source_is_website":{"type":"boolean","title":"Source Is Website","description":"Whether the source is a website.","default":false},"source_mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Mime Type","description":"The MIME type of the source of the citation."},"external_source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Source Url","description":"A URL link to the source of the citation in gdrive/a website/etc."},"supabase_signed_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supabase Signed Url","description":"A signed URL to download/preview the file coming from StackAI document storage."},"position":{"anyOf":[{"$ref":"#/components/schemas/PositionInDocument"},{"type":"null"}],"description":"Indicates the specific location within the source document where the citation is located."},"knowledge_base_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Knowledge Base Id","description":"The ID of the knowledge base this citation comes from."},"inode_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inode Id","description":"The inode ID of the file in the knowledge base."}},"type":"object","required":["id","source_id","title","text"],"title":"Citation"},"CitationSourceType":{"type":"string","enum":["old_knowledge_bases","knowledge_bases","url_knowledge_bases","exposed_document_node","indexed_document_node","user_uploaded_document_url","other"],"title":"CitationSourceType"},"PositionInDocument":{"properties":{"page_idx":{"type":"string","title":"Page Idx"},"chunk_idx":{"type":"string","title":"Chunk Idx"}},"type":"object","required":["page_idx","chunk_idx"],"title":"PositionInDocument"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/projects/{project_id}/messages/sso/{message_id}/feedback":{"patch":{"tags":["messages"],"summary":"Update Message Feedback Sso","operationId":"update_message_feedback_sso_projects__project_id__messages_sso__message_id__feedback_patch","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"message_id","in":"path","required":true,"schema":{"type":"string","title":"Message Id"}},{"name":"token","in":"query","required":true,"schema":{"type":"string","description":"Token for authorization","title":"Token"},"description":"Token for authorization"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackMessage"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/UserMessage-Output"},{"$ref":"#/components/schemas/AssistantMessage-Output"}],"title":"Response Update Message Feedback Sso Projects  Project Id  Messages Sso  Message Id  Feedback Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```
