The bytes are in the bucket for many files — step 3 of 3, up to 100 files a request
const url = 'https://beta-api.plune.ai/v1/files/complete-batch';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"ids":["3f0c2a7e-1b5d-4c8e-9a61-2d7f4e8b0c13"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://beta-api.plune.ai/v1/files/complete-batch \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "ids": [ "3f0c2a7e-1b5d-4c8e-9a61-2d7f4e8b0c13" ] }'POST /v1/files/{id}/complete for many files: { "ids": ["…"] }, at most 100 (ADR 0051, #1476). 200 with one entry per id, in order: status: "ready" (the file is finished, or was — the call is repeatable) or "refused" with the code and httpStatus of the single route: not_found (another project’s file and an invented id alike), file_missing / file_mismatch (the file is forgotten: announce it again), upload_expired, bucket_unreachable (with retryable: true), not_connected. Plune asks the customer’s bucket for each file, eight at a time. One id refused costs the others nothing; an id twice in one request is duplicate for the second and the bucket is asked once. Counted with the other two batch routes: 6000 items a minute a person and 120 requests a minute, each per server instance (429 rate_limited with Retry-After, nothing taken). A reader of the project cannot use it.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
Example
{ "ids": [ "3f0c2a7e-1b5d-4c8e-9a61-2d7f4e8b0c13" ]}Responses
Section titled “ Responses ”One entry per id. Shown: a file that is finished (ready), and an id that is not a file of the caller’s project (unknown)
object
One entry per id, in order.
object
The item’s position in the request, from 0.
For refused, why: invalid_name, invalid_content_type, invalid_file, not_found, run_closed, file_too_large, too_many_files, duplicate, no_storage, over_budget, platform_not_configured, not_connected, bucket_unreachable, file_mismatch, file_missing, upload_expired.
For refused: the status the single route answers with for the same cause.
The same item may succeed if sent again unchanged.
For upload, as in ResultFileUploadLink: a right to write that one object — do not log it.
object
For upload: the file was announced before — same id, a new link.
Examples
The bytes are there
{ "items": [ { "index": 0, "id": "3f0c2a7e-1b5d-4c8e-9a61-2d7f4e8b0c13", "status": "ready", "name": "signed-in.png", "contentType": "image/png", "size": 48213, "storage": "bucket" } ]}Someone else’s file and an invented id read the same
{ "items": [ { "index": 0, "status": "refused", "code": "not_found", "error": "file '3f0c2a7e-1b5d-4c8e-9a61-2d7f4e8b0c13' not found", "httpStatus": 404 } ]}A body that is not { ids: [string] } with 1 to 100 ids
object
Example generated
{ "error": "example"}No / invalid token or session
A reader of the project
object
Example generated
{ "error": "example"}Rate-limited: the per-route throttle, or the per-minute request limit of the plan an API token counts by (#1442; the body names the plan, #2092). Retry-After carries the seconds until the window rolls over.
object
Example generated
{ "error": "example"}Headers
Section titled “Headers ”Seconds until the window rolls over