Complete an upload

POST /api/v1/deliveries/{id}/files/{fileId}/complete

Says the bytes have arrived. ValidFile checks that Cloud Storage holds a file of the size announced, then measures it. The verdict is read afterwards, or comes by webhook.

Scope · deliveries:write Takes an Idempotency-Key

Path parameters

id uuid required
The delivery, as POST /deliveries returned it.
fileId uuid required
The file, as POST …/files returned it.

What the response holds · 202

file queued
The file received.

The fields of queued

id uuid
The file.
status string
Always queued: the verdict is read, or comes by webhook, never in this response.
queued
duplicate boolean
True if the same bytes are already in the delivery: this file costs nothing.

Errors

404not_foundA delivery or file unknown, deleted, or erased at the end of its retention; or an address the API does not have.
409not_uploadedThe bytes have not arrived: finish the upload, or give the file up.
409size_mismatchWhat arrived is not the size announced: announce the file again.
402no_creditsNo files left on the plan, and no credits; left says what is left. Buy some in ValidFile, or wait for the next period.
403scopeThe key does not have the scope the route asks for: a read-only key tried to write, or a key without drop-links:write tried to make or cut a drop link.
409idempotency_mismatchThe same Idempotency-Key with another body: take a new one.
409idempotency_in_progressThe first call is still running: try again in a moment, with the same key.

And those of any call, in Limits and errors.

The same bytes twice in the same delivery cost one credit: the second is given back here, duplicate: true. A script started again does not pay twice for what it already sent, as long as it goes as far as this call.

Sent again, it returns what the first found, without measuring again. On not_uploaded, finish the upload and call again, or give the file up to get its credit back at once.

curl -X POST https://validfile.ca/api/v1/deliveries/$DELIVERY/files/$FILE/complete \
  -H "Authorization: Bearer $VALIDFILE_KEY"
{
  "file": { "id": "9e2d4c1a-3b7f-4e0d-8a6c-2f1b5d9e7c43", "status": "queued", "duplicate": false }
}