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

# Post EndUserFile V2

> Upload file to an end user & asynchronously classify its type. After uploading, call the `/start_workflow` endpoint to trigger downstream processing (parsing, bank statement extraction, etc.).




## OpenAPI

````yaml https://app.herondata.io/swagger post /api/end_users/{end_user_id_or_heron_id}/files/v2
openapi: 3.0.0
info:
  contact:
    email: support@herondata.io
    name: Support
  title: Heron Data API
  version: '2021-07-19'
servers:
  - description: Production
    url: https://app.herondata.io
security:
  - ApiKeyAuth:
      - key_XXX
externalDocs:
  description: Read Tutorial
  url: https://docs.herondata.io/
paths:
  /api/end_users/{end_user_id_or_heron_id}/files/v2:
    post:
      tags:
        - EndUserFiles
      summary: Post EndUserFile V2
      description: >
        Upload file to an end user & asynchronously classify its type. After
        uploading, call the `/start_workflow` endpoint to trigger downstream
        processing (parsing, bank statement extraction, etc.).
      parameters:
        - in: path
          name: end_user_id_or_heron_id
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                file:
                  description: The file to upload
                  format: binary
                  type: string
                file_class:
                  description: >-
                    (Optional) - The type of file. Common values:
                    bank_statement, iso_application_form, debt_summary,
                    void_check, invoice, pnl_statement, balance_sheet,
                    tax_return, money_market_statement. Contact Heron support
                    for the full list of file classes available for your
                    account.
                  type: string
                reference_id:
                  description: Your reference id for the file
                  type: string
              required:
                - file
              type: object
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EndUserFileSchema'
          description: OK
        '409':
          content:
            application/json:
              schema:
                properties:
                  code:
                    example: 409
                    type: integer
                  description:
                    type: string
                  end_user_file_heron_id:
                    description: Heron ID of the existing duplicate file
                    type: string
                  name:
                    example: Conflict
                    type: string
                type: object
          description: >
            File content duplicates an already uploaded file, or an identical
            file is still being saved. If an earlier upload of the same file was
            interrupted, retries get this 409 for up to 100 seconds. Returned
            only when duplicate rejection is enabled for the account.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    EndUserFileSchema:
      properties:
        bank_statement:
          allOf:
            - $ref: '#/components/schemas/PdfGet'
          example: null
          nullable: true
          readOnly: true
        created:
          format: date-time
          type: string
        email:
          allOf:
            - $ref: '#/components/schemas/EndUserEmailSchema'
          example: null
          nullable: true
          readOnly: true
        file_class:
          type: string
        file_source_metadata:
          additionalProperties: {}
          nullable: true
          readOnly: true
          type: object
        filename:
          type: string
        heron_id:
          type: string
        iso_application:
          allOf:
            - $ref: '#/components/schemas/GetIsoApplication'
          nullable: true
          readOnly: true
        num_pages:
          type: integer
        page_classes:
          additionalProperties:
            $ref: '#/components/schemas/EndUserFilePageClasses'
          nullable: true
          type: object
        parent_heron_id:
          nullable: true
          type: string
        parsed_results:
          default: []
          items:
            $ref: '#/components/schemas/ParsedEndUserFile'
          readOnly: true
          type: array
        processing_error:
          nullable: true
          readOnly: true
          type: string
        reference_id:
          type: string
        renamed_filename:
          type: string
      type: object
    PdfGet:
      properties:
        data_source:
          allOf:
            - $ref: '#/components/schemas/DataSourceNested'
          description: >-
            The data source for this PDF. Only available after parsing and
            enrichment has completed, otherwise null.
          nullable: true
        heron_id:
          description: ID generated by Heron Data
          example: pdf_SmXdnWk75k6NSREPLS9pMq
          type: string
        status:
          description: Status of PDF
          enum:
            - new
            - parsing
            - parsed
            - processed
            - human_reviewing
            - approved
            - rejected
            - failed
            - transactions_loaded
            - transactions_unloaded
          example: processed
          type: string
      type: object
    EndUserEmailSchema:
      properties:
        cc_addresses:
          items:
            type: string
          type: array
        created:
          format: date-time
          type: string
        date_sent:
          format: date-time
          type: string
        date_sent_string:
          type: string
        from_address:
          type: string
        from_address_domain:
          type: string
        from_name:
          type: string
        heron_id:
          type: string
        html_body:
          type: string
        html_or_text_body:
          type: string
        is_reply:
          type: boolean
        processing_status:
          enum:
            - new
            - processing
            - processed
            - failed
          type: string
        reply_to:
          nullable: true
          type: string
        subject:
          type: string
        subject_cleaned:
          type: string
        text_body:
          type: string
        to_addresses:
          items:
            type: string
          type: array
        viewer_url:
          description: a temporary, secure URL for viewing the email contents
          type: string
      type: object
    GetIsoApplication:
      properties:
        heron_id:
          description: The ISO application's heron_id
          example: iso_6hBjQT9k6KP2rLCXwjUJff
          type: string
        processing_status:
          description: The processing status of the file.
          enum:
            - new
            - processing
            - processed
            - failed
          example: processed
          type: string
      required:
        - heron_id
        - processing_status
      type: object
    EndUserFilePageClasses:
      properties:
        confidence:
          default: 1
          type: number
        file_class:
          type: string
      type: object
    ParsedEndUserFile:
      properties:
        attribute_values:
          items:
            additionalProperties: {}
            type: object
          type: array
        bounding_boxes:
          items:
            $ref: '#/components/schemas/ParsedEndUserFileBoundingBox'
          nullable: true
          type: array
        created:
          format: date-time
          type: string
        field_validations:
          items:
            $ref: '#/components/schemas/FieldValidation'
          type: array
        heron_id:
          description: Unique identifier of the end user file
          type: string
        id:
          description: '[DEPRECATED] Unique identifier for the parsed file'
          type: integer
        layout_bounding_boxes:
          items:
            $ref: '#/components/schemas/ParsedEndUserFileBoundingBox'
          nullable: true
          type: array
        parser_display_name:
          type: string
        parser_id:
          type: string
        parsing_status:
          enum:
            - succeeded
            - failed
            - processing
          type: string
        patches:
          items:
            $ref: '#/components/schemas/ParsedEndUserFilePatch'
          type: array
        result:
          additionalProperties: {}
          description: Final output result after applying patches
          nullable: true
          type: object
        result_schema:
          additionalProperties: {}
          description: The output JSON schema the results conform to
          type: object
        validation_summary:
          description: Summary of validation results
          type: string
      required:
        - created
        - heron_id
        - parser_id
        - parsing_status
      type: object
    DataSourceNested:
      properties:
        heron_id:
          description: Heron ID of the data source
          type: string
        is_enabled:
          description: Whether this data source is enabled
          type: boolean
      type: object
    ParsedEndUserFileBoundingBox:
      properties:
        bounding_box:
          description: Bounding box coordinates in the format 'y1,x1,y2,x2'
          items:
            type: number
          type: array
        json_pointer:
          description: JSON pointer to the field in the parsed result
          type: string
        page_num:
          description: Page number where the bounding box is located
          type: integer
        value:
          description: The actual value of the field within the bounding box
          type: string
      required:
        - bounding_box
        - json_pointer
        - page_num
        - value
      type: object
    FieldValidation:
      properties:
        failure_reason:
          nullable: true
          type: string
        field_name:
          type: string
        result:
          enum:
            - pass
            - fail
            - not_applicable
          example: pass
          type: string
        validation_type:
          type: string
      required:
        - failure_reason
        - field_name
        - result
        - validation_type
      type: object
    ParsedEndUserFilePatch:
      properties:
        correction_reason:
          nullable: true
          type: string
        enabled:
          nullable: true
          type: boolean
        op:
          type: string
        original_value:
          nullable: true
        path:
          type: string
        source:
          nullable: true
          type: string
        value:
          nullable: true
      required:
        - op
        - path
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.