Skip to main content
This quickstart walks you through the minimum steps to process a document using the Resistant Documents API:
  1. Create a submission
  2. Upload the file bytes to the returned upload_url
  3. Poll /fraud until a terminal status is returned
If you need terminology (e.g., submission_id, stage/cell, status meanings), see Concepts.

Getting an access token

Token URLs and OAuth2 client credentials.

Domains to allowlist

Only needed if you’re behind a firewall/proxy.

Polling for results

Exponential backoff guidance and timeouts.

Prerequisites

  • You have a Client ID and Client Secret
  • You have a sample file ready (PDF or image)
  • If you are behind a firewall/proxy: confirm Domains to allowlist
This page uses the default EU endpoint (api.documents.resistant.ai). If your tenant is in another cell (e.g., us-1, ca-1, ap-2, ap-3), use the corresponding base URL described in Concepts.

1

Get an access token

TOKEN_URL="<your_token_url>"
CLIENT_ID="<your_client_id>"
CLIENT_SECRET="<your_client_secret>"

BASIC_AUTH=$(echo -n "$CLIENT_ID:$CLIENT_SECRET" | base64)

curl --request POST \
  --url "$TOKEN_URL" \
  --header "accept: application/json" \
  --header "authorization: Basic $BASIC_AUTH" \
  --header "content-type: application/x-www-form-urlencoded" \
  --data "grant_type=client_credentials&scope=submissions.read submissions.write"
Token URLs differ by stage/cell. Use the table on Getting an access token.
2

Create a submission

POST https://api.documents.resistant.ai/v2/submission
Authorization: Bearer <access_token>
Content-Type: application/json

{
  "query_id": "internal-doc-12345",
  "pipeline_configuration": "FRAUD_ONLY",
  "enable_decision": false,
  "enable_submission_characteristics": false
}
Response (example)
{
  "submission_id": "sub_abc123xyz",
  "upload_url": "https://...presigned-url..."
}
query_id must not contain PII. Use an internal opaque ID (e.g., UUID).
3

Upload the file bytes to upload_url

UPLOAD_URL="<upload_url_from_create_submission>"
FILE_PATH="/path/to/document.pdf"

curl --request PUT \
  --url "$UPLOAD_URL" \
  --header "content-type: application/octet-stream" \
  --data-binary @"$FILE_PATH"
Upload failures are commonly caused by missing allowlist rules or incorrect Content-Type. See Domains to allowlist.
4

Poll for the fraud result

GET https://api.documents.resistant.ai/v2/submission/{submission_id}/fraud
Authorization: Bearer <access_token>
Polling behavior
  • Use exponential backoff (cap interval at 45 seconds)
  • Stop polling after 15 minutes (hard analysis timeout)
What responses mean
  • 200 → processing finished (success or terminal error included in payload)
  • 404 → result not ready yet (retry with backoff)
See Polling for results for a recommended backoff strategy and edge cases.
5

Store results

At minimum, store:
  • submission_id
  • query_id (if used)
  • analysis_time, sha256, score
  • the full JSON response body (store as a blob / document)
Optional:
  • View the result in the Web UI (deep link by submission_id)
  • Render results in the Offline iFrame viewer (if enabled)

Next steps

  • Enable additional outputs: quality, classification, decision
  • Switch from polling to Amazon SQS or Webhooks (optional add-ons)
  • Enable Submission characteristics (optional)
  • Enable Payload encryption (optional)