# Litmus Edge Manager 3.0.x - Admin Console: Async Tasks

## Get tasks by company or project

**GET** `{{LEM_adminURL}}/admin/v1/instance-async-task/tasks?requestedPage=0&pageSize=1`

> **Updated in 3.0.** `taskType` accepts new values: DIGITAL_TWINS_HIERARCHY_UPDATE, EDGE_BACKUP_RESTORE, EXPORT_DEVICE_TEMPLATE, TEMPLATE_SOLUTION_APPLY.

# Get tasks by company or project

Lists instance-level asynchronous tasks (long-running operations such as bulk device actions) scoped to a company or project, with status and time filters. Each task groups one or more subtasks.
## Endpoint

```http
GET {{LEM_adminURL}}/admin/v1/instance-async-task/tasks
```
## Authentication

API key in a request header (case sensitive). The value is the LEM admin API token.

| URL prefix | Auth header |
|---|---|
| `{{LEM_URL}}/api/v1/...` (main fleet API) | `X-AuthToken: <token>` |
| `{{LEM_adminURL}}/admin/v1/...` (admin console, port 8446) | `X-AuthToken: <token>` |
| `{{LEM_URL}}/mpcs/...` (Marketplace Catalog) | `Authorization: <token>` (3.0.x also accepts `X-AuthToken`) |
## Parameters

| Parameter | In | Notes |
|---|---|---|
| `companyName` / `projectId` | query | Scope the listing. |
| `taskType` | query | Filter by task type (see `Get all task types`). |
| `taskStatus` / `subtaskStatus` | query | Filter by status. |
| `createdOnFrom` / `createdOnTo` | query | Created-time window. |
| `updatedOnFrom` / `updatedOnTo` | query | Updated-time window. |
| `instanceOnly` | query | Only instance-scoped tasks. |
| `requestedPage` / `pageSize` | query | Pagination. |

## Response

`[AsyncTask]` (paginated). Each task has id, type, status, scope and timestamps.
## Errors

| HTTP status         | When it happens                                                                |
|---------------------|--------------------------------------------------------------------------------|
| `400 Bad Request`   | Missing or malformed query/body parameter.                                     |
| `401 Unauthorized`  | Missing or invalid credentials.                                                |
| `403 Forbidden`     | Token lacks permission for this operation.                                     |
| `404 Not Found`     | Target entity does not exist.                                                  |
| `5xx`               | Service is unreachable, restarting, or internally errored. Inspect device logs under `System > Support`. |

> **TLS note**: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.


### Response

**Status**: 200 OK

```json
{
  "pageNum": 0,
  "pagesCount": 0,
  "size": 0,
  "totalSize": 0,
  "elements": []
}
```

---

## Get task by ID

**GET** `{{LEM_adminURL}}/admin/v1/instance-async-task/task/{{task_id}}`

# Get task by ID

Fetches a single asynchronous task by its id, including its current status.
## Endpoint

```http
GET {{LEM_adminURL}}/admin/v1/instance-async-task/task/{taskId}
```
## Authentication

API key in a request header (case sensitive). The value is the LEM admin API token.

| URL prefix | Auth header |
|---|---|
| `{{LEM_URL}}/api/v1/...` (main fleet API) | `X-AuthToken: <token>` |
| `{{LEM_adminURL}}/admin/v1/...` (admin console, port 8446) | `X-AuthToken: <token>` |
| `{{LEM_URL}}/mpcs/...` (Marketplace Catalog) | `Authorization: <token>` (3.0.x also accepts `X-AuthToken`) |
## Parameters

| `taskId` | path | The task id. |
## Response

A single `AsyncTask`.
## Errors

| HTTP status         | When it happens                                                                |
|---------------------|--------------------------------------------------------------------------------|
| `400 Bad Request`   | Missing or malformed query/body parameter.                                     |
| `401 Unauthorized`  | Missing or invalid credentials.                                                |
| `403 Forbidden`     | Token lacks permission for this operation.                                     |
| `404 Not Found`     | Target entity does not exist.                                                  |
| `5xx`               | Service is unreachable, restarting, or internally errored. Inspect device logs under `System > Support`. |

> **TLS note**: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.


---

## Get subtasks for a task

**GET** `{{LEM_adminURL}}/admin/v1/instance-async-task/{{task_id}}/subtasks`

# Get subtasks for a task

Lists the subtasks that make up a given task. Each subtask typically targets one device or unit of work within the parent task.
## Endpoint

```http
GET {{LEM_adminURL}}/admin/v1/instance-async-task/{taskId}/subtasks
```
## Authentication

API key in a request header (case sensitive). The value is the LEM admin API token.

| URL prefix | Auth header |
|---|---|
| `{{LEM_URL}}/api/v1/...` (main fleet API) | `X-AuthToken: <token>` |
| `{{LEM_adminURL}}/admin/v1/...` (admin console, port 8446) | `X-AuthToken: <token>` |
| `{{LEM_URL}}/mpcs/...` (Marketplace Catalog) | `Authorization: <token>` (3.0.x also accepts `X-AuthToken`) |
## Parameters

| `taskId` | path | The parent task id. |
## Response

`[AsyncSubtask]` with per-subtask status and target.
## Errors

| HTTP status         | When it happens                                                                |
|---------------------|--------------------------------------------------------------------------------|
| `400 Bad Request`   | Missing or malformed query/body parameter.                                     |
| `401 Unauthorized`  | Missing or invalid credentials.                                                |
| `403 Forbidden`     | Token lacks permission for this operation.                                     |
| `404 Not Found`     | Target entity does not exist.                                                  |
| `5xx`               | Service is unreachable, restarting, or internally errored. Inspect device logs under `System > Support`. |

> **TLS note**: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.


---

## Get subtasks flat list by company or project

**GET** `{{LEM_adminURL}}/admin/v1/instance-async-task/subtasks?requestedPage=0&pageSize=1`

> **Updated in 3.0.** `taskType` accepts new values: DIGITAL_TWINS_HIERARCHY_UPDATE, EDGE_BACKUP_RESTORE, EXPORT_DEVICE_TEMPLATE, TEMPLATE_SOLUTION_APPLY.

# Get subtasks flat list by company or project

Returns subtasks across all tasks as a single flat, filterable, paginated list, scoped to a company or project. Useful for monitoring all in-flight work without walking task-by-task.
## Endpoint

```http
GET {{LEM_adminURL}}/admin/v1/instance-async-task/subtasks
```
## Authentication

API key in a request header (case sensitive). The value is the LEM admin API token.

| URL prefix | Auth header |
|---|---|
| `{{LEM_URL}}/api/v1/...` (main fleet API) | `X-AuthToken: <token>` |
| `{{LEM_adminURL}}/admin/v1/...` (admin console, port 8446) | `X-AuthToken: <token>` |
| `{{LEM_URL}}/mpcs/...` (Marketplace Catalog) | `Authorization: <token>` (3.0.x also accepts `X-AuthToken`) |
## Parameters

| Parameter | In | Notes |
|---|---|---|
| `companyName` / `projectId` | query | Scope the listing. |
| `taskType` / `taskStatus` / `subtaskStatus` | query | Filters. |
| `createdOnFrom` / `createdOnTo` / `updatedOnFrom` / `updatedOnTo` | query | Time windows. |
| `instanceOnly` | query | Only instance-scoped subtasks. |
| `requestedPage` / `pageSize` | query | Pagination. |

## Response

`[AsyncSubtaskFlat]` (paginated).
## Errors

| HTTP status         | When it happens                                                                |
|---------------------|--------------------------------------------------------------------------------|
| `400 Bad Request`   | Missing or malformed query/body parameter.                                     |
| `401 Unauthorized`  | Missing or invalid credentials.                                                |
| `403 Forbidden`     | Token lacks permission for this operation.                                     |
| `404 Not Found`     | Target entity does not exist.                                                  |
| `5xx`               | Service is unreachable, restarting, or internally errored. Inspect device logs under `System > Support`. |

> **TLS note**: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.


### Response

**Status**: 200 OK

```json
{
  "pageNum": 0,
  "pagesCount": 0,
  "size": 0,
  "totalSize": 0,
  "elements": []
}
```

---

## Get all task types

**GET** `{{LEM_adminURL}}/admin/v1/instance-async-task/task-types`

# Get all task types

Lists the available asynchronous task types, for use as the `taskType` filter on the task / subtask listings.
## Endpoint

```http
GET {{LEM_adminURL}}/admin/v1/instance-async-task/task-types
```
## Authentication

API key in a request header (case sensitive). The value is the LEM admin API token.

| URL prefix | Auth header |
|---|---|
| `{{LEM_URL}}/api/v1/...` (main fleet API) | `X-AuthToken: <token>` |
| `{{LEM_adminURL}}/admin/v1/...` (admin console, port 8446) | `X-AuthToken: <token>` |
| `{{LEM_URL}}/mpcs/...` (Marketplace Catalog) | `Authorization: <token>` (3.0.x also accepts `X-AuthToken`) |
## Response

`[TaskTypeInfo]` (each `{ type, ... }`).
## Errors

| HTTP status         | When it happens                                                                |
|---------------------|--------------------------------------------------------------------------------|
| `400 Bad Request`   | Missing or malformed query/body parameter.                                     |
| `401 Unauthorized`  | Missing or invalid credentials.                                                |
| `403 Forbidden`     | Token lacks permission for this operation.                                     |
| `404 Not Found`     | Target entity does not exist.                                                  |
| `5xx`               | Service is unreachable, restarting, or internally errored. Inspect device logs under `System > Support`. |

> **TLS note**: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.


### Response

**Status**: 200 OK

```json
[
  {
    "code": "ANALYTICS_ML_MODEL_UPLOAD",
    "name": "Upload AI/ML Models"
  },
  {
    "code": "DIGITAL_TWINS_INSTANCES_UPGRADE",
    "name": "Update DT instances"
  },
  {
    "code": "DIGITAL_TWINS_INSTANCE_CREATE",
    "name": "Create DT instance"
  },
  {
    "code": "DIGITAL_TWINS_INSTANCE_CREATE_WITH_PARAMETERS",
    "name": "Create DT instance with parameters"
  },
  {
    "code": "DIGITAL_TWINS_MODEL_DEPLOY",
    "name": "Deploy DT models"
  },
  {
    "code": "EDGE_ACTIVATION_URL_UPDATE",
    "name": "Update edge activation URL"
  },
  {
    "code": "EDGE_BACKUP_CREATE",
    "name": "Create Edge Device backup"
  },
  {
    "code": "EDGE_CA_CERTIFICATE_DELETE",
    "name": "Delete edge CA certificate"
  },
  {
    "code": "EDGE_CA_CERTIFICATE_UPDATE",
    "name": "Update edge CA certificate"
  },
  {
    "code": "EDGE_CERTIFICATE_ISSUE",
    "name": "Issue a new certificate"
  },
  {
    "code": "EDGE_CERTIFICATE_RESET",
    "name": "Reset to Edge Device default certificate"
  },
  {
    "code": "EDGE_LOG_FORWARDING",
    "name": "Change log forwarding status"
  },
  {
    "code": "FIRMWARE_UPGRADE",
    "name": "Software update"
  },
  {
    "code": "FIRMWARE_UPGRADE_DOWNLOAD",
    "name": "Download software update"
  },
  {
    "code": "FIRMWARE_UPGRADE_EXECUTE",
    "name": "Install software update"
  },
  {
    "code": "GCP_SA_KEY_ROTATION",
    "name": "Rotate GCP Service Account keys"
  },
  {
    "code": "GIT_SYNC_PROJECT",
    "name": "Git project synchronization"
  },
  {
    "code": "LICENSE_APPLY",
    "name": "Apply Edge Device license"
  },
  {
    "code": "MARKETPLACE_APPLICATION_CACHE_REFRESH",
    "name": "Refresh Marketplace application cache"
  },
  {
    "code": "MARKETPLACE_APPLICATION_DELETE",
    "name": "Delete Marketplace application"
  },
  {
    "code": "MARKETPLACE_APPLICATION_LAUNCH",
    "name": "Launch Marketplace application"
  },
  {
    "code": "MARKETPLACE_APPLICATION_START",
    "name": "Start Marketplace application"
  },
  {
    "code": "MARKETPLACE_APPLICATION_STOP",
    "name": "Stop Marketplace application"
  },
  {
    "code": "MARKETPLACE_APPLICATION_UPGRADE",
    "name": "Upgrade Marketplace application"
  },
  {
    "code": "MARKETPLACE_SYNC",
    "name": "Sync Marketplace"
  },
  {
    "code": "PROVISION",
    "name": "Provision device after activation"
  },
  {
    "code": "PROVISION_AWS_SITEWISE_CONNECTOR",
    "name": "Provision: AWS SiteWise connector"
  },
  {
    "code": "PROVISION_DEFAULT_PASSWORD_POLICY",
    "name": "Provision: apply default password policy"
  },
  {
    "code": "PROVISION_FLOATING_LICENSE_SERVER",
    "name": "Provision: configure floating license server"
  },
  {
    "code": "PROVISION_GENERATE_LICENSE",
    "name": "Provision: generate device license"
  },
  {
    "code": "PROVISION_GOOGLE_PUBSUB_CONNECTOR",
    "name": "Provision: Google Pub/Sub connector"
  },
  {
    "code": "PROVISION_LICENSE",
    "name": "Provision: apply device license"
  },
  {
    "code": "PROVISION_SIMULATOR_DEVICE",
    "name": "Provision: configure simulator device"
  },
  {
    "code": "PROVISION_TEMPLATE",
    "name": "Provision: apply templates"
  },
  {
    "code": "TEMPLATE_APPLY",
    "name": "Apply template"
  },
  {
    "code": "ZT_FILE_GENERATE",
    "name": "Generate ZeroTouch bundle file"
  }
]
```

---

## Get subtask logs

**GET** `{{LEM_adminURL}}/admin/v1/instance-async-task/logs/subtask/{{subtask_id}}?requestedPage=0&pageSize=1`

# Get subtask logs

Returns the action-log records produced by a single subtask, paginated. Use this to inspect what a subtask did and why it succeeded or failed.
## Endpoint

```http
GET {{LEM_adminURL}}/admin/v1/instance-async-task/logs/subtask/{subtaskId}
```
## Authentication

API key in a request header (case sensitive). The value is the LEM admin API token.

| URL prefix | Auth header |
|---|---|
| `{{LEM_URL}}/api/v1/...` (main fleet API) | `X-AuthToken: <token>` |
| `{{LEM_adminURL}}/admin/v1/...` (admin console, port 8446) | `X-AuthToken: <token>` |
| `{{LEM_URL}}/mpcs/...` (Marketplace Catalog) | `Authorization: <token>` (3.0.x also accepts `X-AuthToken`) |
## Parameters

| Parameter | In | Notes |
|---|---|---|
| `subtaskId` | path | The subtask id. |
| `requestedPage` / `pageSize` | query | Pagination. |

## Response

`[ActionLogRecord]` (paginated log entries).
## Errors

| HTTP status         | When it happens                                                                |
|---------------------|--------------------------------------------------------------------------------|
| `400 Bad Request`   | Missing or malformed query/body parameter.                                     |
| `401 Unauthorized`  | Missing or invalid credentials.                                                |
| `403 Forbidden`     | Token lacks permission for this operation.                                     |
| `404 Not Found`     | Target entity does not exist.                                                  |
| `5xx`               | Service is unreachable, restarting, or internally errored. Inspect device logs under `System > Support`. |

> **TLS note**: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.


---

