Quickstart API
Create a submission → upload → retrieve results.
Get an access token
OAuth2 client credentials across stages and cells.
Receiving results
Polling (default) or optional notifications (SQS / webhooks).
View results in the UI
Web UI and Offline iFrame viewer options.
End-to-end integration model
The typical lifecycle looks like this:Key identifiers
submission_id
A server-generated identifier returned when you create a submission. It is the primary identifier used to:
- fetch results (decision / fraud / quality / classification)
- deep link into the Web UI
- delete a submission
query_id
An optional, customer-defined identifier you provide at submission creation time. Use it to correlate results with your internal system (e.g., case ID or document record ID).
Environments
Stage
- Production: live processing
- Testing: used to validate integration behavior before go-live (limited to EU region)
Cell
A short identifier used in hostnames to indicate the deployment “cell”, such as:eu-1(no hostname prefix)us-1,ca-1,ap-2,ap-3(appear as hostname prefixes)
- EU prod API:
api.documents.resistant.ai - US prod API:
api.us-1.documents.resistant.ai
AWS region (storage endpoints)
S3 upload/download endpoints use standard AWS region identifiers (e.g.,eu-west-1, us-east-1).
Pipelines and results
When creating a submission, you choose which analysis pipeline to run viapipeline_configuration:
FRAUD_ONLY: run fraud pipeline (default)CLASSIFICATION_ONLY: run classification onlyQUALITY_ONLY: run quality only
- Adaptive Decision result (recommended):
GET /v2/submission/{submission_id}/decision - Fraud result:
GET /v2/submission/{submission_id}/fraud - Quality result:
GET /v2/submission/{submission_id}/quality - Classification result:
GET /v2/submission/{submission_id}/classification - PDF report:
GET /v2/submission/{submission_id}/report
Result status model (terminal states)
Result endpoints return a response with astatus field. Treat these as terminal states:
SUCCESS: results are availableFAILED: processing failed during backend analysisINVALID_INPUT: document could not be processed (e.g., unsupported or malformed)SKIPPED: the step did not run (commonly due to pipeline configuration)
Adaptive Decision responses may also include
INVALID_PIPELINE_CONFIG when a required pipeline input is missing.Receiving results: polling vs notifications
Polling (default)
Most customers retrieve results by polling the relevant endpoint(s) until a terminal status is returned. Recommended approach:- exponential backoff
- cap interval at 45 seconds
- stop after 15 minutes (hard analysis timeout)
Optional notifications
Instead of polling, some customers use:- Amazon SQS event notifications (optional add-on)
- Webhooks via Svix (optional add-on)
Viewing results
Web UI
A hosted browser-based UI used by investigators/analysts to review results, indicators, and document previews. Deep link formatOffline iFrame viewer
A self-hosted viewer that renders results in your environment. You provide:- the original file bytes (
ArrayBuffer) - result payloads via
postMessage():fraud(required)decision(optional)classification(optional)
Optional features that affect the model
Submission characteristics
Submission characteristics are optional metadata attached to a submission (device, identity, transaction context, etc.). Important behavior:- if you set
enable_submission_characteristics=trueat submission creation time, then providing characteristics becomes required for that submission to be analyzed.
Payload encryption
Optional end-to-end encryption of uploaded file bytes (JWE) for additional protection beyond TLS. It changes the upload payload format but does not change the submission/result flow.Delete submission
You can delete a submission via:DELETE /v2/submission/{submission_id}
Common misunderstandings
Do I upload the file to the Documents API directly?
Do I upload the file to the Documents API directly?
No. You upload the file bytes to the presigned
upload_urlreturned from “Create submission” using HTTP PUT with Content-Type: application/octet-streamShould I base64-encode the file before upload?
Should I base64-encode the file before upload?
No. Upload the original file bytes.
Can I request a new access token for every API request?
Can I request a new access token for every API request?
Don’t. Reuse the token until it expires (
expires_in) to avoid unnecessary token endpoint load.Do token URLs differ by stage/cell?
Do token URLs differ by stage/cell?
Yes. Token URLs are environment-specific. Always use the token URL provided for your stage + cell.
Why did my quality result come back as SKIPPED?
Why did my quality result come back as SKIPPED?
Quality analysis assesses scan/photo artifacts (blur, glare, cropping, etc.), so it only runs on images and on PDFs that contain embedded images. It’s skipped on native digital PDFs, since there’s no scan or photo to assess. Fraud and classification aren’t affected by this and still run on native PDFs.