Documents
Upload a Knowledge Document
POST
/api/knowledge/documents/hub-uploadOverview
Stores the original file in GCS, registers the document and starts the parser job (parse, chunk, embed, index). Returns immediately with status uploaded or processing; poll GET /hub-documents/{id} until processed or failed. Active when KNOWLEDGE_BACKEND=parser.
Authentication & Headers
- Auth: Bearer Token (rejected for Auditor)
- Content-Type:
multipart/form-data
Form Fields
file(required):pdf, doc, docx, xls, xlsx, ppt, pptx, txt, md, csv, up toKNOWLEDGE_MAX_UPLOAD_MB.description,categories,keywords(optional).visibility(privatedefault |internal),share_permission(usedefault |view),share_expires_at(ISO-8601, future).grantee_user_ids,grantee_group_ids(optional; JSON array, comma list or repeated field);role_group_idsis accepted and ignored.
Body permintaan
multipart/form-data
filestringwajibdescriptionstring | nullcategoriesstring | nullkeywordsstring | nullvisibilitystring | nullshare_permissionstring | nullshare_expires_atstring | nullgrantee_user_idsstring[] | nullgrantee_group_idsstring[] | nullrole_group_idsstring[] | nullfolder_pathstring | null{
"file": "string",
"description": "string",
"categories": "string",
"keywords": "string",
"visibility": "string",
"share_permission": "string",
"share_expires_at": "string",
"grantee_user_ids": [
"string"
],
"grantee_group_ids": [
"string"
],
"role_group_ids": [
"string"
],
"folder_path": "string"
} Respons
201 Document registered (`status`: `uploaded` | `processing`)
400 Bad Request - The request parameters or headers are invalid (e.g. unsupported API-Version).
401 Unauthorized - Missing, invalid, or expired JWT Bearer token.
403 Forbidden - Insufficient role permissions or resource access denied by RBAC policy.
404 Not Found - The requested resource ID was not found.
413 File exceeds the size limit
415 Unsupported file extension
422 Invalid file content or access fields
detailobject[]detail[].locstring | integer[]wajibdetail[].msgstringwajibdetail[].typestringwajibdetail[].inputobjectdetail[].ctxobject{
"detail": [
{
"loc": [
null
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
} 503 File storage unavailable
Contoh
curl -X POST "$PINTER_URL/api/knowledge/documents/hub-upload" \
-H "Authorization: Bearer $ACCESS_TOKEN"