Skip to content

The bytes are in the bucket for many files — step 3 of 3, up to 100 files a request

POST
/v1/files/complete-batch
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.

Media type application/json
object
ids
required
Array<string>
>= 1 items <= 100 items
Example
{
"ids": [
"3f0c2a7e-1b5d-4c8e-9a61-2d7f4e8b0c13"
]
}

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)

Media type application/json
object
items
required

One entry per id, in order.

Array<object>
object
index
required

The item’s position in the request, from 0.

integer
status
required
string
Allowed values: ready refused
code

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.

string
error
string
httpStatus

For refused: the status the single route answers with for the same cause.

integer
retryable

The same item may succeed if sent again unchanged.

boolean
id
string
name
string
contentType
string
size
integer
url

For upload, as in ResultFileUploadLink: a right to write that one object — do not log it.

string
method
string
Allowed values: PUT
headers
object
key
additional properties
string
expiresAt
string format: date-time
resumed

For upload: the file was announced before — same id, a new link.

boolean
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"
}
]
}

A body that is not { ids: [string] } with 1 to 100 ids

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

No / invalid token or session

A reader of the project

Media type application/json
object
error
required
string
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.

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}
Retry-After
integer

Seconds until the window rolls over