Skip to content

Send a file to a review item

POST
/v1/review-items/{id}/files
curl --request POST \
--url 'https://beta-api.plune.ai/v1/review-items/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/files?name=example' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: image/png' \
--data binary

A picture or a text of a Cairn run onto the proposal it queued (cli#138), for a project without a bucket - the body IS the file, as POST /v1/results/{id}/files, with the same types and ceilings (2 MiB a picture, 512 KiB a text, cleaned of credentials). A writer of the project’s queue (a reader is refused); an item of another project, in the Bin, or never issued is a 404; a decided item (approved or rejected) takes no more files (409). The files are read on GET /v1/review-items/{id} (files). Approving a proposal whose run measured a verdict moves them onto the result that approval writes; otherwise they stay on the item. Not audited: machine intake, as a result’s files.

id
required
string format: uuid
X-Plune-Project
string

Which of your projects to act in — an id from GET /v1/projects. Absent, your default project. A project you are not a member of answers 404, the same as one that does not exist. Ignored under a bearer token, which is bound to the project it was minted in.

name
required
string
<= 200 characters

What the file is called; only the last segment of a path is kept, cleaned of credentials.

string format: binary

Stored

Media type application/json

A file of a result, everything but its bytes (ADR 0040, ADR 0041). Only a finished file is ever shown: one that was announced with uploads and not yet completed is in no list.

object
id
required
string
name
required

The last segment of the name it was uploaded with, cleaned of credentials as a text is.

string
contentType
required

In the database (storage: db): image/png, image/jpeg, image/webp, application/json or text/plain — a log is text/plain. In the bucket (storage: bucket): the media type it was announced with, lower case and without parameters, any type.

string
size
required

Bytes as kept: in the database a picture at most 2 MiB and a text at most 512 KiB, counted after its credentials are cleaned, so it can differ from what was sent; in the bucket the size that was announced and found there.

integer
storage
required

db: Plune keeps the bytes in its database, GET /v1/files/{id} returns them. bucket: they are in a bucket — the project’s own, or, for a built-in file of a server that keeps those in its own bucket (#1428), Plune’s — and GET /v1/files/{id} answers 409 in_bucket (the way to read them is GET /v1/files/{id}/link). A built-in file in Plune’s bucket counts toward the budget as one in the database does.

string
Allowed values: db bucket
Example
{
"storage": "db"
}

No name (or one over 200 characters once cleaned), an empty file, or a text with nothing left once cleaned

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

No such review item in this project

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

The item is decided, or it already has 20 pictures (or 10 texts, for a text)

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

A picture larger than 2 MiB, or a text larger than 512 KiB — as sent, or once cleaned

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

A type that is not listed — it needs the project’s bucket; a text in a charset other than UTF-8; or bytes that are not UTF-8 text

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

The server keeps built-in files in its own bucket and could not write this one there: nothing is stored, send it again (code: bucket_unreachable, #1428)

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