Capture Agent API
Narrow outbound Linux/SANE agent enrollment, leasing, and checksummed result transfer
Replace an enrolled capture agent's device capabilities
Requires the narrow Jiandu-Capture device credential. Replaces the validated capability list, updates last-seen time, and advances the agent revision; the credential cannot access household APIs.
Enroll a capture agent with a one-use code
Consumes an unexpired enrollment code without a prior session and returns the new agent ID, configured lease duration, and narrow device credential once. Jiandu stores only credential digests.
Claim the next queued job for this capture agent
Requires the narrow device credential. Returns one matching job and a new lease token, or 204 when no work is queued; expired uncanceled leases are requeued and only the new token's digest is stored.
Fail a leased capture-agent job safely
Requires the narrow device credential and current lease token. Records one server-defined scan_failed, assembly_failed, or local_storage_failed reason, clears the lease, and returns the terminal job without accepting agent-supplied error text.
Renew a capture-agent job lease and report progress
Requires the narrow device credential plus the current lease token. Extends the lease and records scanning or uploading; a stale lease conflicts and a durable cancellation request stops the job.
Create or recover a resumable capture-agent upload
Requires the narrow device credential and current job lease. Validates and binds the filename, media type, nonzero length, and lowercase full-file SHA-256, then creates or recovers the job's private upload session.
Read capture-agent upload status
Requires the narrow device credential and current job lease. Renews the lease and returns the bound upload's identifier, durable offset, declared length, and lifecycle state.
Read a capture-agent upload's durable offset headers
Requires the narrow device credential and current job lease. Renews the lease and returns Upload-Offset and Upload-Length on 204 without a response body.
Append a checksummed capture-agent upload chunk
Requires the narrow device credential, current lease, application/offset+octet-stream body, exact Upload-Offset, and SHA-256 Upload-Checksum. Each accepted chunk renews the lease; a checksum mismatch returns 460, and completing the transfer attaches it to the job for durable finalization.