Cancel upload session
Interface Description
Cancel an upload session that has not completed.
Endpoint
| Field | Value |
|---|---|
| Method | DELETE |
| Path | /openapi/v2/knowledge-bases/{knowledgeBaseId}/upload-sessions/{uploadSessionId} |
| Operation ID | cancelUploadSession |
| Authentication | Bearer OpenAPI key |
Parameters
| Name | Location | Required | Type | Example | Description |
|---|---|---|---|---|---|
knowledgeBaseId | path | Yes | string | knowledge-base-11111111-1111-4111-8111-111111111111 | Knowledge-base identifier returned by knowledge-base APIs. |
uploadSessionId | path | Yes | string | upload-11111111-1111-4111-8111-111111111111 | Upload session identifier returned by createUploadSession. |
Request Body
This operation has no request body.
Request Example
bash
curl -X DELETE "https://openapi.example.com/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/upload-sessions/upload-11111111-1111-4111-8111-111111111111" \
-H "Authorization: Bearer <openapi-key>"Successful Responses
200
Upload session after cancellation.
| Field | Required | Type | Description |
|---|---|---|---|
session | Yes | object | Upload 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": "cancelled",
"declaredFileCount": 1,
"declaredByteCount": 37,
"counts": {
"selected": 1,
"uploadRequired": 1,
"skippedExisting": 0,
"waitingReservation": 0,
"rejectedDeleting": 0,
"uploaded": 0,
"finalized": 0
},
"errorCode": null,
"expiresAt": "2026-06-18T00:00:00.000Z",
"completedAt": "2026-06-17T00:00:00.000Z",
"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 Status | Error Code | Explanation |
|---|---|---|
| 401 | UNAUTHORIZED | The Bearer API key is missing, malformed, unknown, revoked, or deleted. |
| 404 | NOT_FOUND | The requested resource was not found. |
| 409 | CONFLICT | The request conflicts with the resource's current state. |
| 429 | RATE_LIMITED | The request exceeded the configured rate limits. |
| 500 | INTERNAL_ERROR | The API encountered an internal error. |
| 503 | DATABASE_REPOSITORY_UNAVAILABLE | The data required by this operation is temporarily unavailable. |