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

# createMediaDownloadTask

> Queues an archive of the files `searchCriteria` matches in a media source. Every matched file must have finished uploading, or it fails with `ConflictError`. Its `RESULT` artifact holds the archive once the returned task is `COMPLETED`.



**mutation** `createMediaDownloadTask(input: CreateMediaDownloadTaskInput!): CreateMediaDownloadTaskPayload!`

## Arguments

**`input`**: `CreateMediaDownloadTaskInput!` (required)

## Returns

`CreateMediaDownloadTaskPayload!`

**`errors`**: `[CreateMediaDownloadTaskError!]`

---

**`queuedTask`**: `QueuedTask`

## Examples

```graphql Mutation
mutation CreateMediaDownloadTask($input: CreateMediaDownloadTaskInput!) {
  createMediaDownloadTask(input: $input) {
    errors {
      __typename
      ... on GraphQlError {
        code
        details {
          __typename
        }
        message
      }
    }
    queuedTask {
      artifacts {
        available
        completedAt
        createdAt
        filename
        kind
        sizeBytes
      }
      awaitingConfirmation
      configuration {
        __typename
        ... on CardsImportConfiguration {
          __typename
        }
      }
      createdAt
      createdBy
      details {
        __typename
        ... on CardsImportDetails {
          __typename
        }
      }
    }
  }
}
```

```json Variables
{
  "input": {
    "dataSourceId": "id",
    "filename": "string",
    "searchCriteria": [
      {}
    ]
  }
}
```

```json Response
{
  "data": {
    "createMediaDownloadTask": {
      "errors": [
        {
          "__typename": "GraphQlError",
          "code": "string",
          "details": [
            {
              "__typename": "KeyValuePairOfStringAndString"
            }
          ],
          "message": "string"
        }
      ],
      "queuedTask": {
        "artifacts": [
          {
            "available": true,
            "completedAt": "value",
            "createdAt": "value",
            "filename": "string",
            "kind": "INPUT",
            "sizeBytes": "value"
          }
        ],
        "awaitingConfirmation": true,
        "configuration": {
          "__typename": "CardsImportConfiguration"
        },
        "createdAt": "value",
        "createdBy": "value",
        "details": {
          "__typename": "CardsImportDetails"
        }
      }
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.