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

# Upload a document

> Upload a document via the API.

Upload a document via the API.

<Note>
  Can be used in combination with [OCR processing](/integrations/ocr/ocrolus).
</Note>


## OpenAPI

````yaml openAPI/verifications-partners.yaml post /partners/v2/user-uploads
openapi: 3.0.0
info:
  title: Partner Verifications API
  version: 1.0.0
  description: |
    Order payroll, banking, and document-based income verifications.
servers:
  - url: https://api-sandbox.argyle.com
    description: Sandbox
  - url: https://api.argyle.com
    description: Production
security:
  - basicAuth: []
paths:
  /partners/v2/user-uploads:
    post:
      summary: Upload a document
      description: Upload a document via the API.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - user
                - document_type
                - upload
              properties:
                user:
                  type: string
                  format: uuid
                  description: ID of the user object.
                document_type:
                  type: string
                  enum:
                    - paystubs
                    - W-2
                    - 1099
                    - proof-of-identity
                    - proof-of-address
                    - miscellaneous
                  description: The type of document.
                upload:
                  type: string
                  format: binary
                  description: |
                    Link to the document to be uploaded.

                    Max of 1 file per POST request.
      responses:
        '200':
          $ref: '#/components/responses/PartnerUserUploadResponse'
components:
  responses:
    PartnerUserUploadResponse:
      description: A user upload object.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PartnerUserUpload'
  schemas:
    PartnerUserUpload:
      type: object
      example:
        id: 01320596-2c3d-189c-53e7-a8ce6d625b33
        account: 01856c65-43b6-8b5d-b32a-56b8fbda5c28
        document_type: paystubs
        file_url: www.argyle.com/storagename
        file_name: combined_paystubs.pdf
        metadata:
          employment: {}
          ocr_documents:
            - ocr_data: {}
              ocr_authenticity: {}
              ocr_authenticity_score: null
            - ocr_data: {}
              ocr_authenticity: {}
              ocr_authenticity_score: null
          ocr_data: {}
          ocr_authenticity: {}
          ocr_authenticity_score: null
        processing:
          classification: completed
          ocr: completed
          authenticity: completed
        created_at: '2024-07-08T13:43:49.864Z'
        updated_at: '2024-07-08T13:43:51.868Z'
      properties:
        id:
          type: string
          format: uuid
          description: Unique ID of the uploaded document.
        account:
          type: string
          format: uuid
          description: ID of the account associated with the uploaded document.
        document_type:
          type: string
          description: >
            The document
            [category](/workflows/document-processing#enabling-document-uploads)
            in Link the user selected, or the `document_type` provided when
            [uploading via the API](/api-reference/user-uploads#upload).


            If [OCR processing](/integrations/ocr/ocrolus) is enabled, this
            value is overwritten when the document is found to be a different
            type.


            Possible values:

            - `paystubs`

            - `W-2`

            - `1099`

            - `proof-of-identity`

            - `proof-of-address`

            - `miscellaneous`
        file_url:
          type: string
          description: >
            URL linking to the original uploaded document file.


            This static URL redirects to a download page that requires [Argyle
            authentication headers](/api-guide/overview#authentication).


            **Implementation requirements for client-side applications**


            1. Ensure your HTTP client or library (for example, Axios or Python
            requests) is configured to follow redirects.

            2. Append [Basic authentication
            headers](/api-guide/overview#authentication) for Argyle to the file
            download request.
        file_name:
          type: string
          description: File name of the uploaded document on the user's computer or phone.
        metadata:
          type: object
          description: Contains document OCR and authenticity information.
          properties:
            employment:
              type: object
              description: Contains document verification data.
            ocr_documents:
              type: array
              description: >-
                Always included. Contains one OCR and authenticity result for
                each document detected within the uploaded file.
              items:
                $ref: '#/components/schemas/PartnerOcrDocument'
            ocr_data:
              type: object
              deprecated: true
              description: Deprecated. Use `ocr_documents[].ocr_data`.
            ocr_authenticity:
              type: object
              deprecated: true
              description: Deprecated. Use `ocr_documents[].ocr_authenticity`.
            ocr_authenticity_score:
              type: integer
              nullable: true
              deprecated: true
              description: Deprecated. Use `ocr_documents[].ocr_authenticity_score`.
        processing:
          type: object
          description: Contains OCR processing statuses.
          properties:
            classification:
              type: string
              enum:
                - unauthorized
                - idle
                - in_progress
                - completed
                - failed
              description: |
                OCR classification processing status.

                - `unauthorized`: Classification permissions are not enabled.
                - `idle`: Processing has not started.
                - `in_progress`: Processing is in progress.
                - `completed`: Processing successfully completed.
                - `failed`: Processing failed.
            ocr:
              type: string
              enum:
                - unauthorized
                - idle
                - in_progress
                - completed
                - failed
              description: |
                Full OCR processing status.

                - `unauthorized`: Full OCR permissions are not enabled.
                - `idle`: Processing has not started.
                - `in_progress`: Processing is in progress.
                - `completed`: Processing successfully completed.
                - `failed`: Processing failed.
            authenticity:
              type: string
              enum:
                - unauthorized
                - idle
                - in_progress
                - completed
                - failed
              description: |
                OCR authenticity processing status.

                - `unauthorized`: Full OCR permissions are not enabled.
                Full OCR permissions are required for authenticity.
                - `idle`: Processing has not started.
                - `in_progress`: Processing is in progress.
                - `completed`: Processing successfully completed.
                - `failed`: Processing failed.
        created_at:
          type: string
          format: date-time
          description: >-
            Timestamp ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)) when
            the uploaded document was submitted.
        updated_at:
          type: string
          format: date-time
          description: >-
            Timestamp ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)) when
            the user upload object was last updated.
    PartnerOcrDocument:
      type: object
      description: >-
        Contains OCR and authenticity results for one document detected within
        an uploaded file.
      properties:
        ocr_data:
          type: object
          description: >
            Contains [Ocrolus OCR](/integrations/ocr/ocrolus#api) data for the
            detected document.


            Available for paystubs, W-2s, and 1099s when Ocrolus is enabled.
        ocr_authenticity:
          type: object
          description: >
            Contains [Ocrolus authenticity](/integrations/ocr/ocrolus#api) data
            for the detected document.


            Includes individual instances of tampering or other
            authenticity-related edits detected in the document.


            Available for paystubs, W-2s, and 1099s when Ocrolus is enabled.
        ocr_authenticity_score:
          type: integer
          nullable: true
          description: >
            [Ocrolus authenticity
            score](/integrations/ocr/ocrolus#authenticity-scores) for the
            detected document.


            Single score that captures the likelihood the detected document is
            authentic, as determined by Ocrolus.


            Available for paystubs, W-2s, and 1099s when Ocrolus is enabled.
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Username = api_key_id, Password = api_key_secret

````