Pinter
ENID
Documents
Lihat sebagai Markdown

Upload a Knowledge Document

POST/api/knowledge/documents/hub-upload

Overview

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 to KNOWLEDGE_MAX_UPLOAD_MB.
  • description, categories, keywords (optional).
  • visibility (private default | internal), share_permission (use default | view), share_expires_at (ISO-8601, future).
  • grantee_user_ids, grantee_group_ids (optional; JSON array, comma list or repeated field); role_group_ids is accepted and ignored.

Body permintaan

multipart/form-data

filestringwajib
descriptionstring | null
categoriesstring | null
keywordsstring | null
visibilitystring | null
share_permissionstring | null
share_expires_atstring | null
grantee_user_idsstring[] | null
grantee_group_idsstring[] | null
role_group_idsstring[] | null
folder_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[]wajib
detail[].msgstringwajib
detail[].typestringwajib
detail[].inputobject
detail[].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"