|
79 | 79 | }, |
80 | 80 | { |
81 | 81 | "$ref": "#/components/parameters/Cursor" |
| 82 | + }, |
| 83 | + { |
| 84 | + "name": "folderId", |
| 85 | + "in": "query", |
| 86 | + "required": false, |
| 87 | + "description": "Restrict the list to one folder. Omit to list every file in the workspace.", |
| 88 | + "schema": { "type": "string", "minLength": 1 } |
| 89 | + }, |
| 90 | + { |
| 91 | + "name": "search", |
| 92 | + "in": "query", |
| 93 | + "required": false, |
| 94 | + "description": "Case-insensitive substring match against the file `name`. Matches nothing else — not ids, descriptions, or content. `%` and `_` are matched literally. Must be non-empty; omit the parameter instead of sending a blank one.", |
| 95 | + "schema": { "type": "string", "minLength": 1, "maxLength": 200 } |
| 96 | + }, |
| 97 | + { |
| 98 | + "name": "sortBy", |
| 99 | + "in": "query", |
| 100 | + "required": false, |
| 101 | + "description": "Field to sort by. The cursor is a keyset over the active sort, so it carries the sort it was minted under. Replaying a cursor after changing `sortBy` or `sortOrder` returns `400`; restart pagination without a cursor instead.", |
| 102 | + "schema": { |
| 103 | + "type": "string", |
| 104 | + "enum": ["name", "size", "uploadedAt", "updatedAt"], |
| 105 | + "default": "uploadedAt" |
| 106 | + } |
| 107 | + }, |
| 108 | + { |
| 109 | + "name": "sortOrder", |
| 110 | + "in": "query", |
| 111 | + "required": false, |
| 112 | + "description": "Sort direction. The cursor is a keyset over the active sort, so it carries the sort it was minted under. Replaying a cursor after changing `sortBy` or `sortOrder` returns `400`; restart pagination without a cursor instead.", |
| 113 | + "schema": { "type": "string", "enum": ["asc", "desc"], "default": "asc" } |
82 | 114 | } |
83 | 115 | ], |
84 | 116 | "responses": { |
|
137 | 169 | } |
138 | 170 | } |
139 | 171 | }, |
140 | | - "post": { |
| 172 | + "x-removed-buffered-post": { |
141 | 173 | "operationId": "uploadFile", |
142 | 174 | "summary": "Upload File", |
143 | 175 | "description": "Upload a file to a workspace as `multipart/form-data` with a single `file` field. The workspace — and the optional target `folderId` — are supplied as query parameters (not form fields) so authorization runs before the request body is buffered. Maximum file size is 100MB. A name already taken in the destination folder is **not** an error: the name is auto-suffixed (`data.csv` -> `data (1).csv`), matching the in-app uploader, so a `201` can come back with a `name` different from the one you sent — always read `name` from the response rather than assuming it. `409` is returned only if a unique name cannot be allocated after several attempts. Use `PATCH /api/v2/files/{fileId}` if you need a specific name to be exact-or-fail. Returns `201 Created`.\n\nPresigned upload is not part of the public API: it debits the storage quota only in a separate register step, so a caller that never registers would leave unaccounted bytes in storage. This buffered path debits inside the upload transaction.", |
|
283 | 315 | } |
284 | 316 | } |
285 | 317 | }, |
| 318 | + "/api/v2/files/uploads": { |
| 319 | + "post": { |
| 320 | + "operationId": "createFileUpload", |
| 321 | + "summary": "Create File Upload", |
| 322 | + "description": "Create a stateless multipart upload session and signed upload token. Every file uses this flow; a small file is a single part. The maximum file size is 5 GB.", |
| 323 | + "tags": ["Files"], |
| 324 | + "requestBody": { |
| 325 | + "required": true, |
| 326 | + "content": { "application/json": { "schema": {} } } |
| 327 | + }, |
| 328 | + "responses": { |
| 329 | + "201": { |
| 330 | + "description": "The upload session.", |
| 331 | + "content": { "application/json": { "schema": {} } } |
| 332 | + }, |
| 333 | + "400": { "$ref": "#/components/responses/BadRequest" }, |
| 334 | + "401": { "$ref": "#/components/responses/Unauthorized" }, |
| 335 | + "403": { "$ref": "#/components/responses/Forbidden" }, |
| 336 | + "429": { "$ref": "#/components/responses/RateLimited" }, |
| 337 | + "500": { "$ref": "#/components/responses/InternalError" } |
| 338 | + } |
| 339 | + } |
| 340 | + }, |
| 341 | + "/api/v2/files/uploads/{uploadId}": { |
| 342 | + "delete": { |
| 343 | + "operationId": "abortFileUpload", |
| 344 | + "summary": "Abort File Upload", |
| 345 | + "description": "Abort an incomplete upload and discard its provider parts.", |
| 346 | + "tags": ["Files"], |
| 347 | + "parameters": [ |
| 348 | + { |
| 349 | + "name": "uploadId", |
| 350 | + "in": "path", |
| 351 | + "required": true, |
| 352 | + "schema": { "type": "string" } |
| 353 | + }, |
| 354 | + { "$ref": "#/components/parameters/WorkspaceIdQuery" }, |
| 355 | + { "$ref": "#/components/parameters/UploadTokenHeader" } |
| 356 | + ], |
| 357 | + "responses": { |
| 358 | + "200": { |
| 359 | + "description": "The aborted upload session.", |
| 360 | + "content": { "application/json": { "schema": {} } } |
| 361 | + }, |
| 362 | + "401": { "$ref": "#/components/responses/Unauthorized" }, |
| 363 | + "404": { "$ref": "#/components/responses/NotFound" }, |
| 364 | + "409": { "$ref": "#/components/responses/Conflict" }, |
| 365 | + "429": { "$ref": "#/components/responses/RateLimited" }, |
| 366 | + "500": { "$ref": "#/components/responses/InternalError" } |
| 367 | + } |
| 368 | + } |
| 369 | + }, |
| 370 | + "/api/v2/files/uploads/{uploadId}/parts": { |
| 371 | + "post": { |
| 372 | + "operationId": "createFileUploadPartUrls", |
| 373 | + "summary": "Create File Upload Part URLs", |
| 374 | + "description": "Issue short-lived signed PUT URLs for a bounded set of upload part numbers.", |
| 375 | + "tags": ["Files"], |
| 376 | + "parameters": [ |
| 377 | + { |
| 378 | + "name": "uploadId", |
| 379 | + "in": "path", |
| 380 | + "required": true, |
| 381 | + "schema": { "type": "string" } |
| 382 | + }, |
| 383 | + { "$ref": "#/components/parameters/WorkspaceIdQuery" }, |
| 384 | + { "$ref": "#/components/parameters/UploadTokenHeader" } |
| 385 | + ], |
| 386 | + "requestBody": { |
| 387 | + "required": true, |
| 388 | + "content": { "application/json": { "schema": {} } } |
| 389 | + }, |
| 390 | + "responses": { |
| 391 | + "200": { |
| 392 | + "description": "Signed URLs for the requested parts.", |
| 393 | + "content": { "application/json": { "schema": {} } } |
| 394 | + }, |
| 395 | + "400": { "$ref": "#/components/responses/BadRequest" }, |
| 396 | + "401": { "$ref": "#/components/responses/Unauthorized" }, |
| 397 | + "404": { "$ref": "#/components/responses/NotFound" }, |
| 398 | + "409": { "$ref": "#/components/responses/Conflict" }, |
| 399 | + "429": { "$ref": "#/components/responses/RateLimited" }, |
| 400 | + "500": { "$ref": "#/components/responses/InternalError" } |
| 401 | + } |
| 402 | + } |
| 403 | + }, |
| 404 | + "/api/v2/files/uploads/{uploadId}/complete": { |
| 405 | + "post": { |
| 406 | + "operationId": "completeFileUpload", |
| 407 | + "summary": "Complete File Upload", |
| 408 | + "description": "Verify every part, assemble the object, and atomically register the workspace file.", |
| 409 | + "tags": ["Files"], |
| 410 | + "parameters": [ |
| 411 | + { |
| 412 | + "name": "uploadId", |
| 413 | + "in": "path", |
| 414 | + "required": true, |
| 415 | + "schema": { "type": "string" } |
| 416 | + }, |
| 417 | + { "$ref": "#/components/parameters/WorkspaceIdQuery" }, |
| 418 | + { "$ref": "#/components/parameters/UploadTokenHeader" } |
| 419 | + ], |
| 420 | + "requestBody": { |
| 421 | + "required": true, |
| 422 | + "content": { "application/json": { "schema": {} } } |
| 423 | + }, |
| 424 | + "responses": { |
| 425 | + "200": { |
| 426 | + "description": "The completed upload and registered file.", |
| 427 | + "content": { "application/json": { "schema": {} } } |
| 428 | + }, |
| 429 | + "400": { "$ref": "#/components/responses/BadRequest" }, |
| 430 | + "401": { "$ref": "#/components/responses/Unauthorized" }, |
| 431 | + "404": { "$ref": "#/components/responses/NotFound" }, |
| 432 | + "409": { "$ref": "#/components/responses/Conflict" }, |
| 433 | + "429": { "$ref": "#/components/responses/RateLimited" }, |
| 434 | + "500": { "$ref": "#/components/responses/InternalError" } |
| 435 | + } |
| 436 | + } |
| 437 | + }, |
286 | 438 | "/api/v2/files/{fileId}": { |
287 | 439 | "get": { |
288 | 440 | "operationId": "downloadFile", |
|
1525 | 1677 | "example": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64" |
1526 | 1678 | } |
1527 | 1679 | }, |
| 1680 | + "UploadTokenHeader": { |
| 1681 | + "name": "upload-token", |
| 1682 | + "in": "header", |
| 1683 | + "required": true, |
| 1684 | + "description": "The signed token returned when the multipart upload was created.", |
| 1685 | + "schema": { "type": "string", "minLength": 1 } |
| 1686 | + }, |
1528 | 1687 | "FileIdPath": { |
1529 | 1688 | "name": "fileId", |
1530 | 1689 | "in": "path", |
|
0 commit comments