> ## 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.

# Add analysis feedback [us-1]

> Add custom feedback for the document analysis result.

All feedback must be reviewed before submission to ensure it does not contain PII. Submitted feedback is stored securely to support product improvements.



## OpenAPI

````yaml /spec-us-1.json put /v2/submission/{submission_id}/feedback
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.us-1.documents.resistant.ai
security: []
paths:
  /v2/submission/{submission_id}/feedback:
    put:
      summary: Add analysis feedback [us-1]
      description: >-
        Add custom feedback for the document analysis result.


        All feedback must be reviewed before submission to ensure it does not
        contain PII. Submitted feedback is stored securely to support product
        improvements.
      operationId: putFeedback
      parameters:
        - in: path
          name: submission_id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeedbackRequest'
      responses:
        '200':
          description: Custom feedback for fraud analysis.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackResponse'
        '400':
          description: Bad request. Feedback must be sent with all required properties.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not found. Submission doesn't exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - OAuth2:
            - submissions.write
components:
  schemas:
    FeedbackRequest:
      title: FeedbackRequest
      type: object
      properties:
        analysis_feedback:
          $ref: '#/components/schemas/AnalysisFeedback'
          title: Analysis feedback
          description: Type of feedback on the result of document analysis.
        comment:
          title: Feedback comment
          description: Additional feedback comment.
          minLength: 0
          maxLength: 1024
          type: string
          nullable: true
      required:
        - analysis_feedback
    FeedbackResponse:
      title: FeedbackResponse
      type: object
      properties:
        analysis_feedback:
          $ref: '#/components/schemas/AnalysisFeedback'
          title: Analysis feedback
          description: Type of feedback on the result of document analysis.
        comment:
          title: Feedback comment
          description: Additional feedback comment.
          minLength: 0
          maxLength: 1024
          type: string
          nullable: true
        updated:
          title: Feedback timestamp
          description: UTC date and time of the latest feedback update.
          type: string
      required:
        - analysis_feedback
        - updated
    Error:
      title: Error
      type: object
      properties:
        message:
          title: Error message
          description: Detailed error message
          minLength: 0
          maxLength: 512
          type: string
      required:
        - message
    AnalysisFeedback:
      title: Analysis Feedback
      description: Type of feedback on the result of document analysis.
      enum:
        - CORRECT
        - NOT_CORRECT
      type: string
  responses:
    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'
    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/aus3tzuy12e5blAJi417/v1/token
          scopes:
            submissions.read: Read analysis results for a submission
            submissions.write: Create a new submission

````