---
title: "Complete chat attachment"
method: POST
path: "/api/chat/attachments/complete"
tags: ["chat"]
---

# Complete chat attachment

`POST /api/chat/attachments/complete`

## Request

- Base URL: `https://localhost:8080`
- URL: `https://localhost:8080/api/chat/attachments/complete`
- Auth: none declared

Creates a completed attachment record after the client has called RAG extract-content. Request body is JSON only (no file upload).

## Request body

- CompleteAttachmentDto
  - `conversationId` string: Conversation ID to associate the attachment with
  - `fileName` string, required: Original file name from RAG response
  - `fileSize` number, required: File size in bytes
  - `mimeType` string, required: MIME type (e.g. application/pdf)
  - `fileType` string: File type from RAG (e.g. pdf, document, image)
  - `ragRequestId` string, required: RAG request_id from extract-content response
  - `extractedContent` string, required: Extracted full text from RAG (content.full_text)
  - `ragMetadata` object: RAG metadata (metadata, partial, etc.)

## Response `201`

Attachment created

- AttachmentResponseDto
  - `id` string, required: Attachment ID (use as attachmentId in chat requests)
  - `conversationId` object: Conversation ID if associated
  - `fileName` string, required: Original file name
  - `fileSize` number, required: File size in bytes
  - `mimeType` string, required: MIME type
  - `fileType` string, required: Schema file type: image | pdf | document
  - `processingStatus` 'pending' | 'processing' | 'completed' | 'failed', required: Processing status
  - `ragRequestId` object: RAG request ID
  - `createdAt` string, required: Created at (ISO string)
  - `updatedAt` string, required: Updated at (ISO string)

## Other responses

- `400`: Validation error (size, type, or content length)
- `401`: Unauthorized (optional auth: guests use anonymous user)

---

[API](https://skmtc.dev/opencase/apis/opencase-backend-api.md) · [All operations](https://skmtc.dev/opencase/apis/opencase-backend-api/llms.txt) · [OpenAPI document](https://skmtc.dev/opencase/apis/opencase-backend-api/revisions/c66ef2d8dc00?raw)
