# ExportTask

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 only exported along with the task definition if with endpoints=true is set.

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

## Syntax

`public string ExportTask(` ` string server,  ` `string task,` `bool withendpoints = false` `);`

## Parameters

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| server | string | The name of the server on which the task is defined. |
| task | string | The task to be exported. |
| withendpoints | bool | Whether or not to export the endpoint definitions as well. |

## Return values

Exported task JSON file as a string

## Errors

Error responses

| Error | Message | Description |
| --- | --- | --- |
| AEM\_METHOD\_NOT\_SUPPORTED\_VERSION | AemExportTask is only supported on Replicate 5.5 or above. | AemExportTask is only supported on Replicate 5.5 or above. |
| 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. |