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

# Create a submission [eu-1]

> Create a new submission for a document to be analyzed



## OpenAPI

````yaml /spec-eu-1.json post /v2/submission
openapi: 3.0.1
info:
  title: Resistant Documents API
  version: 2.0.0b
  description: >-

    Resistant Documents provides this API to programmatically interact with its
    document analysis engine.

    Interaction with the API can be divided into three phases:


    1. Creating document submission

    2. Uploading a file for for analysis to an address returned from step 1.

    3. Fetching analysis results


    In the first step, the submission is created by posting to the 
    `/v2/submission` endpoint. The response contains a `submission_id` uniquely
    identifying the document to be analyzed throughout the entire interaction,
    and is used to fetch analysis results later.


    Submission response also returns `upload_url` containing a pre-signed URL.
    This URL should be used to upload the actual document to be analyzed in the
    second step. Please note the document has to be uploaded using HTTP `PUT`
    method with `Content-Type` HTTP header set to `application/octet-stream`.


    In the last step, client should repeatedly poll using the
    `/v2/submission/{submission_id}/fraud` endpoint for analysis results. The
    best practice is to use polling with an [exponential
    back-off](https://en.wikipedia.org/wiki/Exponential_backoff) to reduce load
    on the API.


    # Authentication


    <SecurityDefinitions />
servers:
  - url: https://api.documents.resistant.ai
security: []
paths:
  /v2/submission:
    post:
      summary: Create a submission [eu-1]
      description: Create a new submission for a document to be analyzed
      operationId: createSubmission
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmissionRequest'
      responses:
        '200':
          description: Submission created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmissionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - OAuth2:
            - submissions.write
components:
  schemas:
    SubmissionRequest:
      title: SubmissionRequest
      type: object
      properties:
        query_id:
          title: Query ID
          description: >-
            Optional customer-defined identifier for the submitted document,
            typically an internal reference ID. Must not contain PII. Used for
            correlating analysis results with your internal systems.
          minLength: 0
          maxLength: 1024
          type: string
          nullable: true
        pipeline_configuration:
          $ref: '#/components/schemas/PipelineConfiguration'
          title: Pipeline configuration
          description: >-
            Type of analysis pipeline to execute. FRAUD_ONLY runs fraud
            detection and also checks document quality and classifies the
            document. QUALITY_ONLY and CLASSIFICATION_ONLY should only be used
            for near-real-time quality or classification checks without fraud
            analysis.
          default: FRAUD_ONLY
        enable_decision:
          title: Enable Adaptive Decision
          description: >-
            Set to true to enable Adaptive Decision for this submission. When
            enabled, customizable decision outcomes are available via the
            /decision endpoint.
          default: false
          type: boolean
        enable_submission_characteristics:
          title: Enable submission characteristics
          description: >-
            Set to true to enable attachment of submission characteristics such
            as device, identity, and transaction metadata. When enabled, the
            submission_characteristics_upload_url field is included in the
            response.
          default: false
          type: boolean
    SubmissionResponse:
      title: SubmissionResponse
      type: object
      properties:
        upload_url:
          title: Presigned upload URL
          description: >
            Presigned URL where the document file should be uploaded using HTTP
            PUT with Content-Type set to application/octet-stream.


            Example upload using curl:

            ```

            curl --request PUT \
              --url $UPLOAD_URL \
              --header 'content-type: application/octet-stream' \
              --data @path_to_file
            ```
          type: string
          format: uri
        submission_id:
          title: Submission ID
          description: >-
            Unique identifier for this submission, generated by the Documents
            API. Use this ID to retrieve analysis results.
          minLength: 24
          maxLength: 36
          type: string
        submission_characteristics_upload_url:
          title: Submission characteristics URL
          description: >-
            URL for attaching submission characteristics to this submission.
            Requires an access token. May be a relative path. See the
            /v2/submission/{submission_id}/characteristics endpoint for details.
          type: string
          format: uri
      required:
        - upload_url
        - submission_id
    PipelineConfiguration:
      title: PipelineConfiguration
      description: >-
        Type of analysis pipeline to execute. FRAUD_ONLY runs fraud detection
        and also checks document quality and classifies the document.
        QUALITY_ONLY and CLASSIFICATION_ONLY should only be used for
        near-real-time quality or classification checks without fraud analysis.
      enum:
        - FRAUD_ONLY
        - CLASSIFICATION_ONLY
        - QUALITY_ONLY
      type: string
    Error:
      title: Error
      type: object
      properties:
        message:
          title: Error message
          description: Detailed error message
          minLength: 0
          maxLength: 512
          type: string
      required:
        - message
  responses:
    BadRequest:
      description: Bad request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing valid authentication credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Access to the requested resource is forbidden.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnsupportedMediaType:
      description: Unsupported media type.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: Request quota was exceeded
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://eu.id.resistant.ai/oauth2/aus2un1hkrKhPjir4417/v1/token
          scopes:
            submissions.read: Read analysis results for a submission
            submissions.write: Create a new submission

````