The Documents API evolves continuously to support new document types, detection capabilities, and customer requirements. Integrations should handle changes gracefully without breaking.
Always use metadata.type to determine visualization format
Do not hardcode which indicators have which metadata types. The metadata format for a given indicator can change over time as detection capabilities improve.
Indicator metadata types can evolve:
An indicator that was DataOnly (no visualization) may become Combining (structured tables) in a future release
An ElementsCollection indicator may gain additional element types
New metadata types may be introduced
Recommended approach:Always read metadata.type from the response and switch on that value:
for indicator in indicators: metadata = indicator.get("metadata", {}) if not metadata: render_text_only(indicator.get("title", "Unknown indicator")) continue metadata_type = metadata.get("type") if metadata_type == "Combining": render_combining_table(metadata) elif metadata_type == "ElementsCollection": render_elements_collection(metadata) elif metadata_type == "DataOnly": render_data_table(metadata) else: # Unknown type → fallback to text-only render_text_only(indicator.get("title", "Unknown indicator"))
Do not do this:
# Bad: hardcoded mapping breaks when metadata.type changesINDICATOR_METADATA_MAP = { "in_transaction_cluster": "Combining", "in_font_inconsistency": "ElementsCollection", # ... hardcoded for all indicators}# This breaks when we change an indicator's metadata.type
When rendering metadata elements that contain text fields (e.g., BBoxWithOldAndNewText elements with original_text and new_text), text wrapped in backticks (text) should be formatted as monospace code.Example:
This improves readability for technical fields (e.g., font names, metadata fields, encoded values).
If you only need to display fraud results occasionally (e.g., for manual review), linking to the Web UI or embedding the iFrame is often simpler than building a custom renderer.
The GET /v2/submission/{submission_id}/fraud endpoint accepts an optional with_metadata query parameter (defaults to false).When to use with_metadata=true:
You are displaying indicator details in a custom UI
You need structured metadata for rendering tables, charts, or visualizations
You are building a manual review interface with detailed fraud evidence
When to omit it (default false):
You only need the overall score or decision for routing
You are auto-approving/declining based on score alone
You want faster response times and smaller payloads
Performance impact:Responses with with_metadata=true are larger and may take slightly longer to return. If you only need the fraud score or decision, omit the parameter to optimize performance.Example:
# Minimal response (score + decision only)GET /v2/submission/{submission_id}/fraud# Full response with indicator metadataGET /v2/submission/{submission_id}/fraud?with_metadata=true
Not all fields in the fraud result response are guaranteed to be present. Your integration should handle missing or null values gracefully.Fields that may be missing or null:
Field
When missing or null
decision
Adaptive Decision not enabled for tenant, or enable_decision: false in submission request
query_id
Not provided in the original submission request
indicators
May be an empty array for certain document types, or if analysis fails
metadata
Only present if with_metadata=true in the request
metadata.title
Optional field; may be null or missing even when metadata is present
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.