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

# Asynchronous Task

> Learn how asynchronous tasks work in the Maesn Unified API for long-running operations.

## Overview

The Maesn API supports asynchronous operations for the following endpoints:

* [`POST /bookingProposals`](/api-reference/accounting-endpoints/bookingproposals/create-booking-proposal)
* [`GET` and `POST` `/contacts`](/api-reference/accounting-endpoints/contacts/get-contact)
* [`POST /contacts/bulk`](/api-reference/accounting-endpoints/contacts/create-contacts-bulk)
* [`POST /expenses`](/api-reference/accounting-endpoints/expenses/create-expense)
* [`POST /files/async`](/api-reference/accounting-endpoints/files/upload-file-async)
* [`GET /journalEntries`](/api-reference/accounting-endpoints/journalentries/get-journal-entries)
* [`POST /journalEntries/bulk`](/api-reference/accounting-endpoints/journalentries/create-journal-entries-bulk)
* [`GET` and `POST` `/projects`](/api-reference/accounting-endpoints/projects/get-project)
* [`POST /salesOrders`](/api-reference/accounting-endpoints/salesorders/create-sales-order)
* [`POST /transactions`](/api-reference/accounting-endpoints/transactions/create-transaction)

To track the status of these requests, the API provides the [`GET /asyncTask`](/api-reference/accounting-endpoints/asynctask) endpoint.
When an asynchronous request is made, the response body includes a `taskId`, a unique identifier that allows clients to check the progress or result of the operation.

This `taskId` is used as a parameter in [`GET /asyncTask`](/api-reference/accounting-endpoints/asynctask), enabling efficient status tracking of background processes.

## Example

Here is an example of a partial response from an asynchronous operation:

```json theme={null}
{
  "data": {
    "accountId": "CashLedger",
    "accountingPeriodId": "01-2025",
    "currency": "EUR",
    "expenseLines": [
      {
        "accountId": "4613",
        "description": "Business lunch",
        "documentNumber": "INV-123",
        "totalGrossAmount": 49,
      }
    ],
    "taskId": "06D2F7324A1A4825B6200BA647017539",
    "totalGrossAmount": 49,
  },
  "meta": {}
}
```

If the task does not support partial responses, the returned response may be as simple as:

```json theme={null}
{
  "data": {
    "taskId": "06D2F7324A1A4825B6200BA647017539"
  },
  "meta": {}
}
```

To check the status of the task, this is how you can use the `taskId` in the [`GET /asyncTask`](/api-reference/accounting-endpoints/asynctask) endpoint:

```javascript Example code snippet theme={null}
    const response = await axios.get(
    "https://api.maesn.dev/accounting/asyncTask/06D2F7324A1A4825B6200BA647017539", {
        headers: {
            'X-API-KEY': apiKey,
            'X-ACCOUNT-KEY': accountKey
        }
    });
```
