[Tenjin API Reference](https://api-docs.tenjin.com/llms.txt) › [Raw Data Exports API](https://api-docs.tenjin.com/raw-data-exports-api.md) › Create a new data export

- Raw Data Exports API OpenAPI spec: https://api-docs.tenjin.com/openapi/raw-data-exports-api.json

# Create a new data export

- **Method:** `POST`
- **Path:** `/v1/exports`
- **Operation ID:** `post_exports`
- **Tags:** Raw Data Exports

Create a new data export

## Effective servers

- `https://api.tenjin.com/data_exports`

## Authentication

- **Bearer**: HTTP bearer (`JWT`)

  Generate an access token on the [Access Tokens](https://dashboard.tenjin.com/dashboard/access_tokens) page of the Tenjin dashboard and send it as `Authorization: Bearer <access token>`. [API access tokens](https://tenjin.com/docs/api-access-tokens/) explains them.

## Request body

**Required:** `true`

**Content type:** `application/json`

schema: `post_exports_Request`

- **`app_id` (required)**: `string`

  App ID to export data for
- **`end_date` (required)**: `string`, format: `date`

  End date for the export (YYYY-MM-DD format)
- **`start_date` (required)**: `string`, format: `date`

  Start date for the export (YYYY-MM-DD format)
- **`ad_network_ids`**: `array of integer`, default: `[]`

  Ad Network IDs to filter the export (optional)
- **`event_type_groups`**: `array`

  List of event type groups to include in the export

  **Items:**

  `string`, possible values: `"app_open", "custom_events", "in_app_purchases", "subscription", "ilrd", "ad_engagement", "fraud", "skan_cv", "installs", "in_app_events"`
- **`event_types`**: `array`

  DEPRECATED — use event_type_groups. List of event type groups to include in the export

  **Items:**

  `string`, possible values: `"app_open", "custom_events", "in_app_purchases", "subscription", "ilrd", "ad_engagement", "fraud", "skan_cv", "installs", "in_app_events"`
- **`limited_rows`**: `boolean`, default: `false`

  Whether to limit the number of rows in the export

**Example:**

```json
{
  "start_date": "",
  "end_date": "",
  "event_type_groups": [
    "app_open"
  ],
  "event_types": [
    "app_open"
  ],
  "limited_rows": false,
  "app_id": "",
  "ad_network_ids": []
}
```

## Responses

### 201 Create a new data export

**Content type:** `application/json`

schema: `DataExport`

- **`ad_network_ids` (required)**: `array of integer`

  Ad Network IDs included in this export
- **`app_ids` (required)**: `array of string`

  App IDs included in this export
- **`created_at` (required)**: `string`, format: `date-time`

  Creation timestamp (ISO8601)
- **`end_date` (required)**: `string`, format: `date`

  End date (ISO8601)
- **`event_type_groups` (required)**: `array of string`

  Event type groups included in this export
- **`event_types` (required)**: `array of string`

  DEPRECATED — use event_type_groups
- **`expiration_date` (required)**: `string`, format: `date`

  DEPRECATED — use expires_at. Date portion of expires_at: the export expires during this UTC day, not at its end.
- **`expires_at` (required)**: `string`, format: `date-time`

  Exact expiry timestamp (ISO8601), 24 hours after creation. Downloads return 410 Gone after this; files are deleted shortly afterwards.
- **`files` (required)**: `array`

  Files available for download

  **Items:**

  schema: `FileInfo`

  Files available for download
  - **`download_url` (required)**: `string`

    API path that redirects (303) to a presigned S3 download URL
  - **`file_size` (required)**: `integer`
  - **`s3_uri` (required)**: `string`
- **`id` (required)**: `string`

  Export ID
- **`limited_rows` (required)**: `boolean`

  Whether row count was limited
- **`start_date` (required)**: `string`, format: `date`

  Start date (ISO8601)
- **`status` (required)**: `string`

  Current state (pending, processing, completed, failed)
- **`updated_at` (required)**: `string`, format: `date-time`

  Last update timestamp (ISO8601)

**Example:**

```json
{
  "id": "",
  "status": "",
  "limited_rows": true,
  "app_ids": [
    ""
  ],
  "ad_network_ids": [
    1
  ],
  "event_type_groups": [
    ""
  ],
  "event_types": [
    ""
  ],
  "created_at": "",
  "updated_at": "",
  "start_date": "",
  "end_date": "",
  "expires_at": "",
  "expiration_date": "",
  "files": [
    {
      "s3_uri": "",
      "file_size": 1,
      "download_url": ""
    }
  ]
}
```

### 401, 403, 422, 429, 503

- `401` Forbidden - Missing or invalid authentication
- `403` Unauthorized - Insufficient permissions
- `422` Wrong Params
- `429` Open-export limit or daily ending-today limit reached
- `503` Raw data exports are temporarily paused

**Content type:** `application/json`

schema: `Error`

- **`error` (required)**: `string`

  Error message (same as title, for backward compatibility)
- **`status` (required)**: `integer`

  HTTP status code
- **`title` (required)**: `string`

  Short, human-readable summary
- **`type` (required)**: `string`

  URI identifying the problem type
- **`detail`**: `string`

  Human-readable explanation specific to this occurrence

**Example:**

```json
{
  "error": "",
  "type": "",
  "title": "",
  "status": 1,
  "detail": ""
}
```

## Schemas

- `DataExport` — shown above.
- `Error` — shown above.
- `post_exports_Request` — shown above.
- `FileInfo` — shown above.
