# ExportTask

## General

### URL

https://{Host}/attunityenterprisemanager/api/v1/servers/{ServerName}/tasks/{TaskName}?action=export&withendpoints={withendpoints}

### Description

Export definitions from the selected task on the selected server. The definitions always include task settings, tables/table patterns (include/exclude), table settings and global transformations. The endpoint definition is exported with the task definition.

Supported only from Replicate 5.2 and later.

### HTTP method

GET

### Required user role

See [Required Enterprise Manager permissions](https://help.qlik.com/en-US/enterprise-manager/May2026/Content/EnterpriseManager/EnterpriseManager_APIGuide/Introduction/AEMPermissions.htm).

## Request parameters

Request parameters

| Location | Name | Required | Example |
| --- | --- | --- | --- |
| URL | Host [string] | Yes | computer.network.net |
| URL | ServerName [string] | Yes | myrepsrv1 |
| URL | TaskName [string] | Yes | SalesDBBackup |
| URL | withendpoints [bool] | No | true/false |
| Header | EnterpriseManager.APISessionID [string] | Yes | wCo0\_KvjEUFROvfHF5KGrw |

## Response

JSON File (stream)

## cURL example

### Request

`curl -i -k --header "EnterpriseManager.APISessionID: wCo0_KvjEUFROvfHF5KGrw"  https://computer.network.net/attunityenterprisemanager/api/v1/servers/ myrepsrv1/tasks/SalesDBBackup?action=export`

### Response

JSON file (stream)

## Error response

Error responses

| HTTP Code | Enterprise Manager Code | Text | Description |
| --- | --- | --- | --- |
| 500 | - | ExportTask is only supported on Replicate 5.2 or above. | - |
| 500 | AEM\_EXPORT\_TASK\_NO\_PERMISSION\_ON\_ENDPOINT | Failed to export task {task} from Replicate server {server} as the logged in user does not have permission to access one or both of the task's endpoints. | Export all cannot be carried out because the user does not have permissions on one or more endpoints. |