sa-east-1. Local Docker uses MinIO with the same S3-compatible contract.
The API validates declared content type, extension, and size before returning a presigned URL. Upload registration is blocked until the operation’s document requirements are approved. After upload completion, PayFi validates the actual bytes, computes a digest, checks parseability and duplicates, and blocks Analysis processing until the malware scan gate marks the object clean.
Why uploads are split into metadata and bytes
The partner or client first registers the document metadata with PayFi. PayFi then returns a short-lived presigned URL for direct upload into private storage. This keeps large files out of the API process, makes uploads resumable at the UI layer, and gives PayFi a deterministic metadata record before any file bytes are accepted.Document registration
UsePOST /v1/operations/{operationId}/documents with:
documentType: one of the expected document types for the operation.fileName: the original client-facing file name.contentType: the declared MIME type.sizeBytes: expected object size.
REQUIREMENTS_PENDING, REQUIREMENTS_REVIEW_REQUIRED, or REQUIREMENTS_FAILED. The approved document list is the source of truth for upload.
Register the document metadata:
POST /v1/operations/{operationId}/documents
Direct upload
The client uploads the file bytes directly to the returneduploadUrl. The upload URL is short-lived and scoped to one object key.
Retention and residency
Production raw operation documents use theoperation-documents/... key prefix so storage lifecycle policies can target them without deleting risk-policy source files.
Delete production raw objects immediately after successful processing or terminal failure. During an eligible retry, retain them for no more than 24 hours. Configure the bucket lifecycle for operation-documents/* as the same 24-hour defense-in-depth upper bound. Risk-policy source documents and other long-lived reference materials must use separate prefixes and must not be covered by that rule.
The expiry reconciler deletes overdue objects and audits both cleanup success and failure. Replay does not renew retention and returns REPLAY_INPUT_UNAVAILABLE when no authorized input snapshot remains.
Do not store raw partner documents on local SSDs or unmanaged support systems. Long-term model-improvement data must be anonymized and allowed by the customer DPA.
Completion gate
After the direct upload, call:POST /v1/upload-sessions/{token}/documents/{documentId}/complete
- Finds the upload session by token.
- Confirms the document belongs to the same operation and organization.
- Reads object metadata from storage.
- Verifies object size, extension, magic bytes, effective MIME, and parseability.
- Calculates SHA-256 and detects duplicates within the authorized tenant scope.
- Runs the malware scan gate in fail-closed mode.
- Marks the document as
CLEANorREJECTED. - Creates a pending analysis job only for clean, valid documents.
CLEAN.
Client remediation
If a document is rejected, the operation does not advance to analysis for that file. The partner should ask the client to upload a corrected document through the approved upload flow. If only part of the required document set is clean, the operation moves toDOCUMENTS_PARTIAL. When every required type is clean, it moves to DOCUMENTS_UPLOADED and becomes eligible for processing.