1. Attachments
AboAI-Doc
English
  • 中文
  • English
  • Home Page
  • AboAi-API
    • Model
      • Native OpenAI Format
      • Native Gemini Format
    • Chat
      • Native OpenAI Format
      • Native Gemini Format
      • Native Claude Format
      • Responses Request (openai)
    • Audio
      • Native OpenAI Format TTS
      • Native Gemini Format TTS
    • Images
      • Native OpenAI Format Image Generation
      • Native Gemini Format Image Generation
      • Native OpenAI Format Image Editing (JSON)
      • Native OpenAI Format Image Editing (Multipart)
    • Video
      • Seedance2.0 format
        • Create Video Generation Task
        • Query Video Generation Task Status
    • Vector
      • Embeddings
        • Create Embedding
    • Translation
      • Speech Translation
    • Knowledge
      • Knowledge Management
        • List Knowledge Bases
        • Create Knowledge Base
        • Update Knowledge Base
        • Get Knowledge Base Details
        • Delete Knowledge Base
      • Attachments
        • List Attachments
          GET
        • Upload Attachment
          POST
        • Get Attachment Status
          GET
        • Get Attachment Details
          GET
        • Delete Attachment
          DELETE
      • Search & Chat
        • Knowledge Search
        • RAG Chat
  • AI application
    • AboAI API Integration with Claude Code
    • AboAI API Integration with Cursor
    • AboAI API Integration with Codex-cli
    • AboAI API Integration with Codex Desktop
    • AboAI API Integration with Hermes Agent
  1. Attachments

Upload Attachment

POST
/v1/knowledge/attachments
Upload a document (multipart/form-data). The request synchronously uploads to OSS and saves the record; parsing / chunking / embedding run asynchronously. Returns the attachment record (with docId); poll "Get Attachment Status" for progress.
Chunking parameters use partial-override semantics: send only the fields you want to change; omitted fields use the platform configuration. The strategy and parameters are fixed at upload and cannot be changed later; to change them, delete and re-upload.
Allowed file types and size limits are those returned by GET /v1/knowledge/upload-limit.

Request

Header Params

Body Params multipart/form-dataRequired

Responses

🟢200Success
application/json
Success (wrapped in R)
Bodyapplication/json

🟠400Bad Request
🟠401Forbidden
🔴500Server Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://vipapi.aboai.ai/v1/knowledge/attachments' \
--header 'Authorization: Bearer {{apiKey}}' \
--form 'file=@""' \
--form 'kid="NkD5Y4RkLGnp"' \
--form 'strategy=""' \
--form 'targetTokens=""' \
--form 'maxTokens=""' \
--form 'minTokens=""' \
--form 'mergeLimitTokens=""' \
--form 'overlapTokens=""' \
--form 'separator=""' \
--form 'tableRowsPerChunk=""' \
--form 'chunkModelName=""' \
--form 'prependHeadingPath=""' \
--form 'headingPathReserveTokens=""' \
--form 'semanticRefine=""' \
--form 'semanticBatchSize=""' \
--form 'heuristicConfidenceThreshold=""' \
--form 'arbitrationContextWindow=""' \
--form 'dumpChunks=""'
Response Response Example
200 - Example 1
{
    "code": 0,
    "msg": "string",
    "data": {
        "id": 0,
        "kid": "string",
        "docId": "string",
        "docName": "string",
        "fileSize": 0,
        "docType": "string",
        "remark": "string",
        "ossId": 0,
        "docUrl": "string",
        "requestId": "string",
        "chunkStrategy": "string",
        "chunkModelName": "string",
        "embeddingModelName": "string",
        "stage": 0,
        "status": 0,
        "failStage": 0,
        "failReason": "string",
        "chunkCount": 0,
        "embeddedCount": 0,
        "vectorStatus": 0,
        "vectorFailReason": "string",
        "vectorCostMs": 0,
        "estimateTokens": 0,
        "estimateCost": "string",
        "actualTokens": 0,
        "actualCost": "string",
        "createBy": "string",
        "createTime": "string",
        "updateTime": "string",
        "finishTime": "string"
    }
}
Modified at 2026-11-04 09:19:19
Previous
List Attachments
Next
Get Attachment Status
Built with