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
iduuid required- The delivery, as
POST /deliveriesreturned it. fileIduuid required- The file, as
POST …/filesreturned it.
What the response holds · 202
filequeued- The file received.
The fields of queued
iduuid- The file.
statusstring- Always
queued: the verdict is read, or comes by webhook, never in this response. queuedduplicateboolean- True if the same bytes are already in the delivery: this file costs nothing.
Errors
| 404 | not_found | A delivery or file unknown, deleted, or erased at the end of its retention; or an address the API does not have. |
| 409 | not_uploaded | The bytes have not arrived: finish the upload, or give the file up. |
| 409 | size_mismatch | What arrived is not the size announced: announce the file again. |
| 402 | no_credits | No files left on the plan, and no credits; left says what is left. Buy some in ValidFile, or wait for the next period. |
| 403 | scope | The 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. |
| 409 | idempotency_mismatch | The same Idempotency-Key with another body: take a new one. |
| 409 | idempotency_in_progress | The 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 }
}