Skip to content

Announce files for the case being marked — step 1 of 3 of sending them to the project’s bucket

POST
/v1/runs/{id}/cases/{caseId}/files/uploads
curl --request POST \
--url https://beta-api.plune.ai/v1/runs/example/cases/example/files/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "files": [ { "name": "signed-in.png", "contentType": "image/png", "size": 48213 }, { "name": "trace.zip", "contentType": "application/zip", "size": 3145728 } ] }'

The same three steps as POST /v1/results/{id}/files/uploads (ADR 0041), for the case being marked in a manual run, before its mark (#1234): the mark takes them with results[].files. One left unmarked is removed a week after it was added, or once the run is closed. A project without a bucket is told which files go to /v1/runs/{id}/cases/{caseId}/files?name= instead (direct) and which have nowhere to go (skipped). The ceilings in the bucket: image 10 MiB, text 5 MiB, video 100 MiB, trace 100 MiB, other 50 MiB; 30 files, the database and the bucket together. A file in the bucket costs the budget nothing. For a browser, the bucket needs a CORS rule that lets the dashboard’s address PUT. A reader cannot announce files; someone else’s is a 404. 600 requests a minute a person.

id
required
string

The manual run, still open.

caseId
required
string

The case being marked in it.

Media type application/json

The files a client is about to send to a result, as it names them. Only these three fields are read.

object
files
required
Array<object>
>= 1 items
object
name
required

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

string
contentType
required

The media type the file will be sent with: type/subtype, optionally ; name=value parameters, no comma. The link is signed for exactly this.

string
size
required

The exact number of bytes of the body. The link is signed for exactly this, and complete checks it in the bucket.

integer
>= 1
Example
{
"files": [
{
"name": "signed-in.png",
"contentType": "image/png",
"size": 48213
},
{
"name": "trace.zip",
"contentType": "application/zip",
"size": 3145728
}
]
}

One entry per file, in the order asked

Media type application/json
object
files
required

One entry for each requested file, in the order they were requested.

Array
One of:

The project has a bucket: this file goes there. PUT the bytes to url with headers, then POST /v1/files/{id}/complete.

object
id
required

The id of the file: what complete takes, and what the file is called in every list from then on.

string
name
required

The name as it was cleaned and will be shown.

string
url
required

A signed address in the customer’s bucket. It is a right, not a name: whoever holds it can write that one object until it expires. Do not print it or log it.

string
method
required
string
Allowed values: PUT
headers
required

Exactly the headers to send, lower-case names: content-type, and content-length — the length of the body, which an HTTP client that sets it from the body itself sends already. Nothing else is signed; add no Authorization.

object
key
additional properties
string
expiresAt
required

The link works for 15 minutes from the answer.

string format: date-time
Examples
Example noBucket

The project has no bucket

{
"files": [
{
"name": "signed-in.png",
"direct": true
},
{
"name": "trace.zip",
"skipped": "no_storage"
}
]
}

A body that is not { files: [{ name, contentType, size }] }

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 it would hold more than 30 files (code: too_many_files)

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

A file over the ceiling of its kind in the bucket (code: file_too_large)

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 project has a bucket and the server cannot open its key (code: platform_not_configured)

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