> ## Documentation Index
> Fetch the complete documentation index at: https://docs.deepxl.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Analyze a file for fraud detection

> Analyze a file for fraud detection using the specified model.

**Available Models:**
- `document` - For PDFs and document images (bank statements, invoices, IDs)
- `object` - For general images and AI-generated content detection

**Likelihood:** Returned as 0-100% where higher values indicate higher probability of manipulation/fraud.

**Tags Parameter:**
Pass optional metadata as a JSON object to organize and filter your analysis results. 

**Recommended tag fields:**
| Field | Description | Example |
|-------|-------------|---------|
| `customerId` | Your customer's unique identifier | `"9999"` |
| `customerName` | Customer or account name | `"Acme Corp"` |
| `documentId` | Your internal document reference | `"DOC-2024-001"` |
| `companyName` | Company name | `"DeepXL"` |
| `companyId` | Company identifier | `"COMP-001"` |

**Example tags value:** `{"customerId":"9999","customerName":"Acme Corp","documentId":"DOC-2024-001","companyName":"DeepXL","companyId":"COMP-001"}`

You can filter results by tags using the GET endpoint: `?tagFilter=customerId=9999`



## OpenAPI

````yaml /openapi.json post /v1/detection
openapi: 3.1.0
info:
  title: DeepXL API
  description: >-
    Professional document analysis and verification API for fraud detection,
    identity verification, and data extraction.
  contact:
    name: DeepXL Support
    url: https://deepxl.ai/contact
    email: hello@deepxl.ai
  version: 1.1.0
servers:
  - url: https://api.deepxl.ai
    description: Production
security: []
tags:
  - name: Fraud Detection
    description: Detect manipulated or AI-generated content in documents and images.
  - name: Document Parsing
    description: Extract structured data from IDs, bank statements, and pay stubs.
  - name: ID Verification
    description: Match an ID document against a selfie.
  - name: File Retrieval
    description: Fetch original uploads or generated heatmaps from a prior analysis.
paths:
  /v1/detection:
    post:
      tags:
        - Fraud Detection
      summary: Analyze a file for fraud detection
      description: >-
        Analyze a file for fraud detection using the specified model.


        **Available Models:**

        - `document` - For PDFs and document images (bank statements, invoices,
        IDs)

        - `object` - For general images and AI-generated content detection


        **Likelihood:** Returned as 0-100% where higher values indicate higher
        probability of manipulation/fraud.


        **Tags Parameter:**

        Pass optional metadata as a JSON object to organize and filter your
        analysis results. 


        **Recommended tag fields:**

        | Field | Description | Example |

        |-------|-------------|---------|

        | `customerId` | Your customer's unique identifier | `"9999"` |

        | `customerName` | Customer or account name | `"Acme Corp"` |

        | `documentId` | Your internal document reference | `"DOC-2024-001"` |

        | `companyName` | Company name | `"DeepXL"` |

        | `companyId` | Company identifier | `"COMP-001"` |


        **Example tags value:** `{"customerId":"9999","customerName":"Acme
        Corp","documentId":"DOC-2024-001","companyName":"DeepXL","companyId":"COMP-001"}`


        You can filter results by tags using the GET endpoint:
        `?tagFilter=customerId=9999`
      operationId: analyze_file_v1_detection_post
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_analyze_file_v1_detection_post'
      responses:
        '200':
          description: Analysis completed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetectionResponse'
              examples:
                document_model:
                  summary: Document model response
                  description: >-
                    Response from the document fraud detection model analyzing a
                    PDF or document image
                  value:
                    result:
                      detectionId: 2
                      mediaType: image
                      fileType: jpeg
                      fileName: bank_statement.jpg
                      fileSize: 245678
                      model: document
                      likelihood: 85.2
                      fraudSeverity: high
                      country: us
                      reasoning:
                        - Potential manipulation detected in text region
                        - Font inconsistencies found
                      modelResults:
                        technicalChecks:
                          - type: IMAGE_MANIPULATION
                            status: FAIL
                            details: Detected potential manipulation
                            likelihood: 0.85
                      classification: suspicious
                      timestamp: 1725795600
                      timestampISO: '2024-09-08T10:00:00.000000'
                      tags:
                        - name: customerId
                          value: '9999'
                        - name: customerName
                          value: Acme Corp
                        - name: documentId
                          value: DOC-2024-001
                        - name: companyName
                          value: DeepXL
                        - name: companyId
                          value: COMP-001
                      files:
                        - category: original_file
                          fileName: bank_statement.jpg
                          fileSize: 245678
                          contentType: image/jpeg
                          timestamp: 1725795600
                          timestampISO: '2024-09-08T10:00:00.000000'
                          url: >-
                            https://api.deepxl.ai/v1/files/fd_2_bank_statement.jpg
                        - category: heatmap
                          fileName: fd_2_heatmap_1.png
                          fileSize: 45678
                          contentType: image/png
                          timestamp: 1725795600
                          timestampISO: '2024-09-08T10:00:00.000000'
                          url: https://api.deepxl.ai/v1/files/fd_2_heatmap_1.png
                object_model:
                  summary: Object model response
                  description: >-
                    Response from the object model detecting AI-generated or
                    manipulated images. Likelihood is 0-100% where lower values
                    indicate authentic images.
                  value:
                    result:
                      detectionId: 1
                      mediaType: image
                      fileType: jpeg
                      fileName: photo.jpg
                      fileSize: 231433
                      model: object
                      likelihood: 4.75
                      fraudSeverity: low
                      country: us
                      reasoning:
                        - >-
                          Image appears authentic with only 4.7% AI probability.
                          Natural characteristics suggest genuine photography.
                      modelResults:
                        technicalChecks: []
                      classification: verified
                      timestamp: 1725795600
                      timestampISO: '2024-09-08T10:00:00.000000'
                      tags:
                        - name: customerId
                          value: '9999'
                        - name: customerName
                          value: Acme Corp
                        - name: documentId
                          value: DOC-2024-002
                        - name: companyName
                          value: DeepXL
                        - name: companyId
                          value: COMP-001
                      files:
                        - category: original_file
                          fileName: photo.jpg
                          fileSize: 231433
                          contentType: image/jpeg
                          timestamp: 1725795600
                          timestampISO: '2024-09-08T10:00:00.000000'
                          url: https://api.deepxl.ai/v1/files/fd_1_photo.jpg
        '400':
          description: Invalid model name or request parameters
        '401':
          description: Authentication required - API key or Clerk token missing/invalid
        '415':
          description: >-
            Unsupported media type - file type not compatible with selected
            model
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
      security:
        - API Key: []
components:
  schemas:
    Body_analyze_file_v1_detection_post:
      properties:
        model:
          type: string
          title: Model
          description: 'Model to use for analysis; Available models: document, object'
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
        tags:
          anyOf:
            - type: string
            - type: 'null'
          title: Tags
          description: >-
            Optional JSON object with key-value pairs for organizing and
            querying results. Example: {"customerId":"9999","customerName":"Acme
            Corp","documentId":"DOC-2024-001","companyName":"DeepXL","companyId":"COMP-001"}.
            Common keys: customerId, customerName, documentId, companyName,
            companyId.
          default: '{}'
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: >-
            Optional country hint. Supported values: us, mx, br. Defaults to us
            when omitted or invalid.
      type: object
      required:
        - model
        - file
      title: Body_analyze_file_v1_detection_post
    DetectionResponse:
      properties:
        result:
          $ref: '#/components/schemas/FraudDetection'
          description: The fraud detection result
      type: object
      required:
        - result
      title: DetectionResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FraudDetection:
      properties:
        detectionId:
          type: integer
          title: Detectionid
          description: Unique identifier for the detection record
        mediaType:
          type: string
          title: Mediatype
          description: Media type category (e.g. image, document)
        fileType:
          type: string
          title: Filetype
          description: File extension (e.g. jpeg, png, pdf)
        fileName:
          type: string
          title: Filename
          description: Original file name
        fileSize:
          type: integer
          title: Filesize
          description: File size in bytes
        timestamp:
          type: integer
          title: Timestamp
          description: Unix timestamp of when the analysis was performed
        timestampISO:
          type: string
          title: Timestampiso
          description: ISO 8601 timestamp of when the analysis was performed
        model:
          type: string
          title: Model
          description: Model used for analysis (document or object)
        modelVersion:
          anyOf:
            - type: string
            - type: 'null'
          title: Modelversion
          description: Version of the model used (e.g. 1.1.0)
        likelihood:
          type: number
          title: Likelihood
          description: Fraud likelihood as a percentage (0-100)
        fraudSeverity:
          anyOf:
            - type: string
            - type: 'null'
          title: Fraudseverity
          description: >-
            Fraud severity level: low (0-30%), medium (30-70%), high (70-100%),
            or null for rejected documents
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: Normalized country hint for this request (us, mx, br)
        classification:
          anyOf:
            - type: string
            - type: 'null'
          title: Classification
          description: Classification label (e.g. authentic, suspicious, verified)
        reasoning:
          items:
            type: string
          type: array
          title: Reasoning
          description: List of natural-language explanations for the analysis findings
        modelResults:
          additionalProperties: true
          type: object
          title: Modelresults
          description: Technical check results from the model
        tags:
          items:
            $ref: '#/components/schemas/Tag'
          type: array
          title: Tags
          description: Metadata tags attached to this detection
          default: []
        files:
          items:
            $ref: '#/components/schemas/FileData'
          type: array
          title: Files
          description: Associated files (original upload, heatmaps)
          default: []
      type: object
      required:
        - detectionId
        - mediaType
        - fileType
        - fileName
        - fileSize
        - timestamp
        - timestampISO
        - model
        - likelihood
        - reasoning
        - modelResults
      title: FraudDetection
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    Tag:
      properties:
        name:
          type: string
          title: Name
          description: Tag key name
        value:
          type: string
          title: Value
          description: Tag value
      type: object
      required:
        - name
        - value
      title: Tag
    FileData:
      properties:
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
          description: File category (e.g. original_file, heatmap, id, face)
        fileName:
          type: string
          title: Filename
          description: Name of the file
        fileSize:
          type: integer
          title: Filesize
          description: File size in bytes
        contentType:
          type: string
          title: Contenttype
          description: MIME content type (e.g. image/jpeg, application/pdf)
        timestamp:
          type: integer
          title: Timestamp
          description: Unix timestamp of when the file was created
        timestampISO:
          type: string
          title: Timestampiso
          description: ISO 8601 timestamp of when the file was created
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
          description: URL to retrieve the file via GET /v1/files/{fileName}
      type: object
      required:
        - fileName
        - fileSize
        - contentType
        - timestamp
        - timestampISO
      title: FileData
  securitySchemes:
    API Key:
      type: apiKey
      description: API key created in the dashboard
      in: header
      name: x-api-key

````