Skip to content

Analyze Attachment

POST
/api/v1/team-chat/threads/{thread_id}/analyze-attachment

Analyze an image or PDF attachment within a chat thread.

Accepts a multipart file upload, runs it through MultiModalAnalyzer, persists the resulting summary as a chat message, and returns the analysis metadata.

Args: thread_id: Thread to attach the analysis message to. file: Uploaded file (JPEG/PNG/GIF/WebP/PDF, max 20 MB). context: Optional user-supplied context prompt. user: Authenticated user context. conv_svc: ConversationService (injected).

Returns: AttachmentAnalysisResponse with analysis and message IDs.

Raises: HTTPException 415: Unsupported media type. HTTPException 413: File exceeds 20 MB limit. HTTPException 503: MultiModalAnalyzer not available.

Authorizations

Parameters

Path Parameters

thread_id
required
string

Request Body required

object
context
string
""
file
required
string

Responses

200

Successful Response

Response for a successful attachment analysis.

Attributes: analysis_id: UUID of the analysis record. summary: LLM-generated description of the attachment. model_used: Model that performed the analysis. credits_consumed: Credits deducted from the tenant balance. message_id: ID of the persisted chat message containing the summary.

object
analysis_id
required
string
credits_consumed
required
integer
message_id
required
string
model_used
required
string
summary
required
string

422

Validation Error

object
detail
Array<object>
object
ctx
object
input
loc
required
Array
msg
required
string
type
required
string