Skip to content

Add files to upload session ​

Interface Description ​

Add a batch of Markdown files to an upload session by registering each relative path, size, and optional checksum.

Endpoint ​

FieldValue
MethodPOST
Path/openapi/v2/knowledge-bases/{knowledgeBaseId}/upload-sessions/{uploadSessionId}/entries
Operation IDaddUploadManifestEntries
AuthenticationBearer OpenAPI key

Parameters ​

NameLocationRequiredTypeExampleDescription
knowledgeBaseIdpathYesstringknowledge-base-11111111-1111-4111-8111-111111111111Knowledge-base identifier returned by knowledge-base APIs.
uploadSessionIdpathYesstringupload-11111111-1111-4111-8111-111111111111Upload session identifier returned by createUploadSession.

Request Body ​

application/json ​

FieldRequiredTypeExampleDescription
entriesYesarray<UploadManifestEntryRequest>[{"relativePath":"handbook/onboarding/guide.md","declaredSize":37,"checksumSha256":"67c26271e50e79cadc720ca4eb964ee65fa4be663c87e0314b486b1109a0990c"}]One or more Markdown file records added in this request.

Request Example ​

bash
curl -X POST "https://openapi.example.com/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/upload-sessions/upload-11111111-1111-4111-8111-111111111111/entries" \
  -H "Authorization: Bearer <openapi-key>" \
  -H "Content-Type: application/json" \
  --data '{
  "entries": [
    {
      "relativePath": "handbook/onboarding/guide.md",
      "declaredSize": 37,
      "checksumSha256": "67c26271e50e79cadc720ca4eb964ee65fa4be663c87e0314b486b1109a0990c"
    }
  ]
}'

Successful Responses ​

200 ​

Upload session after accepting this batch of file records.

FieldRequiredTypeDescription
sessionYesobjectUpload session returned by the request.

Success Response Example ​

json
{
  "session": {
    "id": "upload-11111111-1111-4111-8111-111111111111",
    "operationId": "upload-operation-11111111-1111-4111-8111-111111111111",
    "knowledgeBaseId": "knowledge-base-11111111-1111-4111-8111-111111111111",
    "state": "manifest_building",
    "declaredFileCount": 1,
    "declaredByteCount": 37,
    "counts": {
      "selected": 1,
      "uploadRequired": 0,
      "skippedExisting": 0,
      "waitingReservation": 0,
      "rejectedDeleting": 0,
      "uploaded": 0,
      "finalized": 0
    },
    "errorCode": null,
    "expiresAt": "2026-06-18T00:00:00.000Z",
    "completedAt": null,
    "createdAt": "2026-06-17T00:00:00.000Z",
    "updatedAt": "2026-06-17T00:00:00.000Z",
    "actions": {
      "operation": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/operations/upload-operation-11111111-1111-4111-8111-111111111111"
    }
  }
}

Error Codes ​

The table below lists every error response documented for this operation.

HTTP StatusError CodeExplanation
401UNAUTHORIZEDThe Bearer API key is missing, malformed, unknown, revoked, or deleted.
404NOT_FOUNDThe requested resource was not found.
409CONFLICTThe request conflicts with the resource's current state.
413PAYLOAD_TOO_LARGEThe request body or requested file exceeds the size limit for this operation.
422VALIDATION_ERRORThe request failed validation.
429RATE_LIMITEDThe request exceeded the configured rate limits.
500INTERNAL_ERRORThe API encountered an internal error.
503DATABASE_REPOSITORY_UNAVAILABLEThe data required by this operation is temporarily unavailable.

Next Steps ​