---
title: "Create a GA download task"
method: POST
path: "/gdc/projects/{projectId}/dataload/download/googleanalytics/downloadTasks"
tags: ["msfrest"]
---

# Create a GA download task

`POST /gdc/projects/{projectId}/dataload/download/googleanalytics/downloadTasks`

## Request

- Base URL: `https://secure.gooddata.com`
- URL: `https://secure.gooddata.com/gdc/projects/{projectId}/dataload/download/googleanalytics/downloadTasks`
- Auth: none declared

## Request body

- GoogleAnalyticsDownloadTask
  - `googleAnalyticsDownloadTask` object, required
    - `credentials` object, required
      - `clientId` string, required: OAuth2 Client ID
      - `clientSecret` string, required: OAuth2 Client Secret
      - `refreshToken` string, required: OAuth2 Refresh Token
    - `definition` object, required
      - `ids` string, required: unique table ID, format: ga:XXXX (where XXXX is the Analytics profile ID), required field
      - `startDate` string, required: first date for which user requests data, format: YYYY-MM-DD, required field
      - `endDate` string, required: last date for which user requests data, format: YYYY-MM-DD, required field
      - `metrics` string[], required: list of comma-separated metrics, required field
      - `dimensions` string[]: list of comma-separated dimensions
      - `filters` string[]: dimensions and metrics filters that restricts data returned for user request
      - `segment` string: segments the data for user's request
      - `outputFile` string: output file on WebDAV (/uploads/...), obsolete field, results for new clients are stored on S3
    - `timeout` integer: timeout of this task, propagated to the taskman ( in seconds inteval <0, 43200>)

## Response `201`

Created - new GA download task created

- AsyncTask: Deprecated taskman async task used in old API resources. It contains `link` element in singular which doesn't comply with our API rules.
  - `asyncTask` object, required
    - `link` AsyncTaskPollLink, required
      - `poll` string, uri, required: URI of the polling resource

## Other responses

- `400`: Bad Request - invalid data in the request
- `404`: Not Found - the project doesn't exist

---

[API](https://skmtc.dev/gooddata/apis/gooddata-api-documentation.md) - [All operations](https://skmtc.dev/gooddata/apis/gooddata-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/gooddata/apis/gooddata-api-documentation/revisions/e5dc0ee6ab00?raw)
