Inspect a file
PATCH/v1/files/:id
Queues inspection of an uploaded file — listing its solid bodies — and returns a job. Wait for the job with Stream job updates (GET /v1/jobs/{id}/events), then read the bodies with Get a file (GET /v1/files/{id}). A file holding no solid body fails the job, its error beginning no_solid_bodies:. A file is inspected once: once its bodies are listed they never change, and a further inspection is refused. A failed inspection lists nothing, so it can be run again. One inspection of a file runs at a time: another, while one is queued or running, is refused.
Experimental. Available now and still gaining functionality. It may change in breaking ways in a minor API release; each such change is listed in the release notes, so check them before upgrading.
Request
Responses
- 202
- 400
- 401
- 403
- 404
- 409
- 410
- 500
- 503
The inspection job was accepted; wait for it on GET /v1/jobs/{id}/events, then read /v1/files/{id}.
The request is invalid.
The API key is missing or invalid.
The API key may not perform this operation: it has no access to this part of the API, it may only read it, or its creator has not met the organization’s two-factor requirement.
The file does not exist.
The file has not been uploaded, it changed after its first inspection was asked for (file_source_changed), its bodies are already listed, an inspection of it is already queued or running, or the Idempotency-Key was already used for a different operation.
The file is older than the retention window and is no longer available.
The inspection job could not be submitted.
Authentication is temporarily unavailable, or the job could not be sent to the processing queue (job_dispatch_failed) and was not created. Retry the request; reusing its Idempotency-Key is safe.