Skip to content

Add a screenshot or a text file to a result

POST
/v1/results/{id}/files
curl --request POST \
--url 'https://beta-api.plune.ai/v1/results/example/files?name=example' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: image/png' \
--data binary

The request body IS the file, and Content-Type says which kind (ADR 0040). A screenshot: PNG, JPEG or WebP, at most 2 MiB, up to 20 per result. A text (the amendment, #928): application/json or text/plain — a log is text/plain, whatever its name (.log, stdout, stderr) — as UTF-8 only, at most 512 KiB, up to 10 per result, counted apart from the screenshots. A text is cleaned of credentials before it is kept, by the pass a failure’s text goes through: colour codes go, and so do tokens, keys, cookies and Authorization values. What is kept is the cleaned text, its size is that, and it can be longer than what was sent — the 512 KiB ceiling is on both. The server does not parse JSON; cleaning can leave a JSON file that no longer parses, and a client reads it as text then. Trace and video are not accepted here. Into a run that is still open: a reporter uploads after each batch of results and before it closes the run, using the ids the batch answered with. Each project keeps its files, pictures and texts together, within a budget of 1 GiB: an upload that would pass it first deletes the project’s oldest files — the results stay, their files go.

id
required
string

The result — items[].id of the batch that stored it.

name
required
string
<= 200 characters

What the file is called; only the last segment of a path is kept, and it is cleaned of credentials. At most 200 characters once cleaned.

string format: binary

Stored

Media type application/json

A file of a result, everything but its bytes (ADR 0040).

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

A log is text/plain.

string
Allowed values: image/png image/jpeg image/webp application/json text/plain
size
required

Bytes as kept: a picture at most 2 MiB; a text at most 512 KiB, and counted after its credentials are cleaned, so it can differ from what was sent.

integer
Example
{
"id": "3f0c2a7e-1b5d-4c8e-9a61-2d7f4e8b0c13",
"name": "signed-in.png",
"contentType": "image/png",
"size": 48213
}

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

Not found or not yours

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

The run is closed, or the result already has 20 screenshots (or 10 text files, for a text)

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

A screenshot 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; a text in a charset other than UTF-8; or bytes that are not UTF-8 text (invalid UTF-8, or a NUL)

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

Rate-limited: either the per-route throttle or a tenant quota. 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