Download a file
PollGET /v1/documents/{id} with the workspace credential. On completed, request the relative download path from that response with the same credential. PDFs use /pdf and images use /file. A read before completion returns 409. Use Documents in the workspace to inspect status and download an earlier output.
Deliver to Amazon S3
In Settings, configure a bucket, region, optional slash-terminated prefix and a dedicated AWS key pair. Enable S3 Block Public Access. Scope the principal’ss3:PutObject and s3:GetObject to BUCKET/PREFIX/WORKSPACE-ID/*. Settings return bucket metadata and keep secret values encrypted at rest under the host encryption key.
Set "delivery": "object" in the generation request to select S3. The job records a delivery failure if the object cannot be stored. For a completed S3 document, authenticated GET /v1/documents/{id}/link returns a presigned URL valid for 300 seconds. Treat that URL as a temporary credential. The default delivery stores the file in workspace storage; in the Cloud Run profile this is a private Google Cloud Storage bucket.
Receive signed events
Configure a public HTTPS receiver in workspace Settings and save the signing secret when shown. Completion and failure events contain a stable event ID and a document status. Before handling one:- Read the exact request body bytes and
x-dockiln-timestamp. Reject stale timestamps and timestamps too far in the future. Five minutes is a practical tolerance. - Compute HMAC-SHA256 over the timestamp, one literal period and the raw body, using the webhook secret. Compare
v1=followed by the hex digest withx-dockiln-signatureusing a constant-time comparison. - Parse the verified payload. Deduplicate its event ID in the same transaction as your side effect, then acknowledge with a 2xx response.