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

# Upload file async

## Field support per integration

<AccordionGroup>
  <Accordion title="DATEV Unternehmen Online" icon="https://mintcdn.com/maesn/NQwZPkomn6wLid0x/logo/datev.svg?fit=max&auto=format&n=NQwZPkomn6wLid0x&q=85&s=5589154dcfa064e1d967a067e488896a" width="24" height="24" data-path="logo/datev.svg">
    <Note>
      This endpoint is asynchronous. To check the status of the request, use the `GET asyncTask` endpoint.
      For more info about asynchronous tasks visit the [`Asynchronous Task`](/async-task) section.
    </Note>

    <Note>
      If you're not using the [Interactive Authentication Flow](/authentication#interactive-authentication-flow), make sure the query parameter `companyId` is accurately populated with the appropriate company ID. You can obtain this value by using the `GET Companies` endpoint available under the Authentication section.
    </Note>

    Supported Request Parameters:

    <ResponseField name="file" type="File" required />

    <Note>
      The name of the uploaded file must include the file extension, for example `invoice.pdf`.
    </Note>

    <Note>
      The file name must not exceed 255 characters in length.
    </Note>

    <ResponseField name="documentId" type="string" />

    <Note>
      The `documentId` field can be used to uniquely identify a document. If provided, it must be a valid GUID.
    </Note>

    <ResponseField name="documentType" type="string" required />

    <Note>
      The `documentType` field must match one of the document types returned by the `GET Document Types` endpoint.
    </Note>

    <ResponseField name="note" type="string" />
  </Accordion>

  <Accordion title="DATEV Rechnungswesen" icon="https://mintcdn.com/maesn/NQwZPkomn6wLid0x/logo/datev.svg?fit=max&auto=format&n=NQwZPkomn6wLid0x&q=85&s=5589154dcfa064e1d967a067e488896a" width="24" height="24" data-path="logo/datev.svg">
    <Note>
      This endpoint is asynchronous. To check the status of the request, use the `GET asyncTask` endpoint.
      For more info about asynchronous tasks visit the [`Asynchronous Task`](/async-task) section.
    </Note>

    <Note>
      If you're not using the [Interactive Authentication Flow](/authentication#interactive-authentication-flow), make sure the query parameter `companyId` is accurately populated with the appropriate company ID. You can obtain this value by using the `GET Companies` endpoint available under the Authentication section.
    </Note>

    Supported Request Parameters:

    <ResponseField name="file" type="File" required />

    <Note>
      The name of the uploaded file must include the file extension, for example `invoice.pdf`.
    </Note>

    <Note>
      The file name must not exceed 255 characters in length.
    </Note>

    <ResponseField name="documentDate" type="string" required />

    <ResponseField name="documentId" type="string" />

    <Note>
      The `documentId` field can be used to uniquely identify a document. If provided, it must be a valid GUID.
    </Note>

    <ResponseField name="documentType" type="string" required />

    <Note>
      The `documentType` field must match one of the document types returned by the `GET Document Types` endpoint.
    </Note>

    <ResponseField name="integrationSource" type="string" required />

    <Note>
      The `integrationSource` field should be set to the name of your application integrating with DATEV.
    </Note>

    <ResponseField name="note" type="string" />
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml post /accounting/files/async
openapi: 3.0.0
info:
  title: Maesn unified API
  description: The Maesn unified API description
  version: '1.0'
  contact: {}
servers:
  - url: https://api.maesn.dev
security: []
tags:
  - name: maesn
    description: ''
paths:
  /accounting/files/async:
    post:
      tags:
        - accounting
      operationId: uploadFileAsync
      parameters:
        - name: X-API-KEY
          description: API key
          in: header
          schema:
            type: string
          required: true
        - name: X-ACCOUNT-KEY
          description: Account key
          in: header
          schema:
            type: string
          required: true
        - name: companyId
          required: false
          in: query
          schema:
            type: string
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                documentDate:
                  type: string
                  example: '2025-03-26T08:25:54.060Z'
                documentId:
                  type: string
                  example: b5e624e5-fb9e-4836-a443-87a3820f5b48
                documentType:
                  type: string
                  example: Rechnungsausgang
                integrationSource:
                  type: string
                  example: 3rd party app
                note:
                  type: string
                  example: note for the document
              required:
                - file
                - documentType
      responses:
        '202':
          description: ''
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/BaseResponseDto'
                  - properties:
                      data:
                        $ref: '#/components/schemas/TaskIdResponseDto'
components:
  schemas:
    BaseResponseDto:
      type: object
      properties:
        meta:
          $ref: '#/components/schemas/MetaResponse'
        data:
          oneOf:
            - type: object
            - type: array
    TaskIdResponseDto:
      type: object
      properties:
        taskId:
          type: string
          example: 02cc5849-b23c-48fe-8a9b-96f74bfc9571
    MetaResponse:
      type: object
      properties:
        warnings:
          type: array
          items:
            type: string
            example: Field not used by target system
        pagination:
          $ref: '#/components/schemas/PaginationResponse'
    PaginationResponse:
      type: object
      properties:
        total:
          type: number
          example: 125
        perPage:
          type: number
          example: 50
        currentPage:
          type: number
          example: 1
        totalPages:
          type: number
          example: 3

````