> For the complete documentation index, see [llms.txt](https://help.branch.io/llms.txt).

# Scheduled Log Exports API

The Scheduled Log Exports API lets you set up a recurring export of select device-level data that runs on a daily or hourly basis.

[Read the Scheduled Log Exports API overview](https://help.branch.io/apidocs/scheduled-log-exports/overview.md)

## Get details on a single export job

`GET https://api2.branch.io/scheduled-exports/logs/subscription/{subscription_id}/job/{job_id}`

This endpoint provides a way to get details on the particular job, as long as you know the subscription_id and the job_id. Scheduled exports run at a regular cadence. Each individual run is considered a "job" and has a "job ID".

### Parameters

- `job_id` (string, path, required) — The relevant job ID. 
- `subscription_id` (string, path, required) — A persistent ID for the specific subscription. 

### Responses

- `200` — Export job success response.
- `400` — Bad request—typically an invalid or missing credential or parameter.
- `404` — Job ID not found.

### Returns

Export job success response. Returns `400` and `404` on failure — see the response panel for the error shape.

### Example request

```bash
curl 'https://api2.branch.io/scheduled-exports/logs/subscription/XXXX-0000-xxxx/job/XXXX-0000-xxxx?app_id=%3Capp_id%3E' \
  --request GET \
  --header 'Access-Token: <Access-Token>'
```

### Example responses

`200`

```json
{
  "job_id": "XXXX-0000-xxxx",
  "status": "SUCCEEDED",
  "start_date": "2023-05-19T00:00:00.000-00:00",
  "end_date": "2023-05-20T00:00:00.000-00:00",
  "export_url": [
    "https://branch-exports-web-usw2.s3.us-west-1.amazonaws.com/v2/y%3D2021/m%3D09/d%3D16/app_id%3D{APP_ID}/job_id%3Da1b2c3d4/task_id%3D{TASK_ID}/unique-csv-file-name-here.csv.gz?X-Amz-Algorithm={AMZ_ALGORITHM}&X-Amz-Date={AMZ_DATE}&X-Amz-SignedHeaders={AMZ_SIGNED_HEADERS}&X-Amz-Expires={AMZ_EXPIRATION}&X-Amz-Credential={AMZ_CREDENTIAL}&X-Amz-Signature={AMZ_SIGNATURE}"
  ],
  "lines_exported": 43
}
```

`400`

```json
{
  "error": {
    "message": "Authentication failed.",
    "code": 400
  }
}
```

## Get details on a single subscription

`GET https://api2.branch.io/scheduled-exports/logs/subscription/{subscription_id}`

This endpoint lets you retrieve the subscription status via the `subscription_url` provided. Make sure the `subscription_status` is set to `ACTIVE`.

### Parameters

- `subscription_id` (string, path, required) — A persistent ID for the specific subscription. 

### Responses

- `200` — Status of aggregate export.
- `400` — Bad request—typically an invalid or missing credential or parameter.
- `404` — Job ID not found.

### Returns

Status of aggregate export. Returns `400` and `404` on failure — see the response panel for the error shape.

### Example request

```bash
curl 'https://api2.branch.io/scheduled-exports/logs/subscription/XXXX-0000-xxxx?app_id=%3Capp_id%3E' \
  --request GET \
  --header 'Access-Token: <Access-Token>'
```

### Example responses

`200`

```json
{
  "subscription_id": "XXXX-0000-xxxx",
  "report": {
    "cadence": "hourly",
    "response_format": "csv",
    "response_format_compression": "gz",
    "report_type": "eo_install",
    "report_fields": [
      "name"
    ],
    "filter": [
      ""
    ],
    "subscription_status": "ACTIVE"
  },
  "destination": {
    "subscription_type": "cloud",
    "cloud": "s3",
    "bucket": "my-branch-export-bucket",
    "prefix": "my-folder",
    "resource_access_id": "arn:aws:iam::xxxxxxxxxxxx:role/role-name-here",
    "recipient_emails": [
      "example@branch.io"
    ]
  }
}
```

`400`

```json
{
  "error": {
    "message": "Authentication failed.",
    "code": 400
  }
}
```

## Get details on all subscriptions

`GET https://api2.branch.io/scheduled-exports/logs/subscriptions`

Returns all export subscriptions for an app or organization. See what data is being exported (for example, topic, columns, and filters) and where data is exported to (for example, email addresses, your data center, or a Branch-hosted S3 bucket). Note: You need to provide either app_id or organization_id along with accessToken to execute this operation.

### Responses

- `200` — Array of available subscriptions.
- `400` — Bad request—typically an invalid or missing credential or parameter.
- `404` — Job ID not found.

### Returns

Array of available subscriptions. Returns `400` and `404` on failure — see the response panel for the error shape.

### Example request

```bash
curl 'https://api2.branch.io/scheduled-exports/logs/subscriptions?app_id=%3Capp_id%3E' \
  --request GET \
  --header 'Access-Token: <Access-Token>'
```

### Example responses

`200`

```json
[
  {
    "subscription_id": "XXXX-0000-xxxx",
    "report": {
      "cadence": "hourly",
      "response_format": "csv",
      "response_format_compression": "gz",
      "report_type": "eo_install",
      "report_fields": [
        "name"
      ],
      "filter": [
        ""
      ],
      "subscription_status": "ACTIVE"
    },
    "destination": {
      "subscription_type": "cloud",
      "cloud": "s3",
      "bucket": "my-branch-export-bucket",
      "prefix": "my-folder",
      "resource_access_id": "arn:aws:iam::xxxxxxxxxxxx:role/role-name-here",
      "recipient_emails": [
        "example@branch.io"
      ]
    }
  }
]
```

`400`

```json
{
  "error": {
    "message": "Authentication failed.",
    "code": 400
  }
}
```

## Get details on many export jobs

`GET https://api2.branch.io/scheduled-exports/logs/subscription/{subscription_id}/jobs`

Once your subscription is active, you can query for the exported data and download the data via the array `export_url`. For data accessible via API, the files are stored in Branch's S3 bucket, and you're provided a pre-signed S3 URL for exporting data. Typically, data is accessible via API for 7 days, so be sure to download your data shortly after it's generated.

### Parameters

- `app_id` (string, query, required) — Unique identifier for the Branch app of the requested data.
- `end_date` (string, query, required) — The latest date of export job runs to be included. Time zone is UTC. Format: `yyyy-MM-dd'T'HH:mm:ssZ`.
- `start_date` (string, query, required) — The earliest date of export job runs to be included. Time zone is UTC. Format: `yyyy-MM-dd'T'HH:mm:ssZ`.
- `subscription_id` (string, path, required) — ID for your subscription. Obtained from the [/subscribe path](https://help.branch.io/apidocs/scheduled-log-exports.md#createScheduledLogExportSubscription).

### Responses

- `200` — OK—returns an array of export jobs.
- `400` — Bad request.

### Returns

OK—returns an array of export jobs. Returns `400` on failure — see the response panel for the error shape.

### Example request

```bash
curl 'https://api2.branch.io/scheduled-exports/logs/subscription/a1b2c3d4/jobs?app_id=123456789012345678&start_date=2021-08-16T02%3A00%3A00&end_date=2021-08-16T02%3A59%3A59' \
  --request GET \
  --header 'Access-Token: <Access-Token>'
```

### Example responses

`200`

```json
[
  {
    "job_id": "XXXX-0000-xxxx",
    "status": "SUCCEEDED",
    "start_date": "2023-05-19T00:00:00.000-00:00",
    "end_date": "2023-05-20T00:00:00.000-00:00",
    "export_url": [
      "https://branch-exports-web-usw2.s3.us-west-1.amazonaws.com/v2/y%3D2021/m%3D09/d%3D16/app_id%3D{APP_ID}/job_id%3Da1b2c3d4/task_id%3D{TASK_ID}/unique-csv-file-name-here.csv.gz?X-Amz-Algorithm={AMZ_ALGORITHM}&X-Amz-Date={AMZ_DATE}&X-Amz-SignedHeaders={AMZ_SIGNED_HEADERS}&X-Amz-Expires={AMZ_EXPIRATION}&X-Amz-Credential={AMZ_CREDENTIAL}&X-Amz-Signature={AMZ_SIGNATURE}"
    ],
    "lines_exported": 43
  }
]
```

`400`

```json
{
  "error": {
    "message": "Authentication failed.",
    "code": 400
  }
}
```

## Get external ID

`GET https://api2.branch.io/scheduled-exports/logs/subscription/externalId`

Branch provides a unique "external ID" for your Branch account. This should be used when setting up data to be exported to your cloud data service (that is, S3). Note: You need to provide either app_id or organization_id along with accessToken to execute this operation.

### Responses

- `200` — The ID to be used in the trust relationship of the role that you create to allow Branch to access your S3 bucket.
- `400` — Bad request—typically an invalid or missing credential or parameter.
- `404` — Job ID not found.

### Returns

The ID to be used in the trust relationship of the role that you create to allow Branch to access your S3 bucket. Returns `400` and `404` on failure — see the response panel for the error shape.

### Example request

```bash
curl 'https://api2.branch.io/scheduled-exports/logs/subscription/externalId?app_id=%3Capp_id%3E' \
  --request GET \
  --header 'Access-Token: <Access-Token>'
```

### Example responses

`200`

```json
{
  "external_id": "XXXX-0000-xxxx"
}
```

`400`

```json
{
  "error": {
    "message": "Authentication failed.",
    "code": 400
  }
}
```

## Create subscription

`POST https://api2.branch.io/scheduled-exports/logs/subscribe`

Set up a new scheduled log export subscription. Supported at both the app and organization levels. The result is a subscription that specifies what data will be exported (for example, topic, columns, and filters) and where data will be exported to.

### Parameters

- `destination` (object, required) — Information about where a finished report is stored and how it can be accessed.
- `destination.subscription_type` (enum, required) — Should be set to "branch" if you want data stored in Branch's S3 bucket and accessible via API. One of `branch`, `email`, `cloud`.
- `destination.cloud` (string) — For cloud-based destinations. Can be either `s3` or `gcs`.
- `destination.bucket` (string) — The cloud bucket being used for the subscription.
- `destination.prefix` (string) — The prefix or folder you're using for Branch exports.
- `destination.resource_access_id` (string) — ARN for the role (AWS) or full service account name (GCP) you're using for Branch exports.
- `destination.recipient_emails` (array of string) — Only for `subscription_type`: `email`. List of recipient email addresses.
- `report` (object, required) — Information about the report that should be generated.
- `report.cadence` (enum, required) — How frequently the report is generated, and for what time period it's generated. Options: hourly or daily. One of `hourly`, `daily`.
- `report.response_format` (enum, required) — Format in which the export data is delivered. Options: csv, json, or parquet. One of `csv`, `json`, `parquet`.
- `report.response_format_compression` (enum) — Method by which the export data should be compressed. Options: gz or snappy. Defaults to gz if not specified. One of `gz`, `snappy`.
- `report.report_type` (enum, required) — A string representing the event type of your report. See [Available Topics](https://help.branch.io/apidocs/custom-exports/overview.md#available-topics) for the complete list. One of `eo_impression`, `eo_click`, `eo_web_to_app_auto_redirect`, `eo_branch_cta_view`, `eo_open`, `eo_install`, `eo_reinstall`, `eo_web_session_start`, `eo_pageview`, `eo_commerce_event`, `eo_custom_event`, `eo_content_event`, `eo_dismissal`, `eo_user_lifecycle_event`, `skadnetwork_valid_messages`, `eo_click_blocked`, `eo_impression_blocked`, `eo_install_blocked`, `eo_reinstall_blocked`, `eo_open_blocked`, `eo_web_session_start_blocked`, `eo_pageview_blocked`, `eo_custom_event_blocked`, `eo_content_event_blocked`, `eo_commerce_event_blocked`, `eo_user_lifecycle_event_blocked`, `eo_branch_cta_view_blocked`, `eo_web_to_app_auto_redirect_blocked`.
- `report.report_fields` (array of enum, required) — An array representing fields/columns available in your report. To include every available field, use `["all"]` instead of a field list. The all-fields option requires Sensitive Data, Fraud Settings & Data, and Export permissions. When using `"all"`, new fields are automatically included as they become available—design your systems to handle schema changes gracefully. Parquet is recommended for resilience to schema changes. See [Available EO Fields](https://help.branch.io/apidocs/custom-exports/overview.md#available-eo-fields) for the complete list. One of `all`, `app_id`, `app_name`, `attributed`, `content_items`, `custom_data`, `customer_event_alias`, `days_from_last_attributed_touch_to_event`, `deep_linked`, `di_match_click_token`, `event_data_ad_type`, `event_data_affiliation`, `event_data_coupon`, `event_data_currency`, `event_data_description`, `event_data_exchange_rate`, `event_data_revenue`, `event_data_revenue_in_usd`, `event_data_search_query`, `event_data_shipping`, `event_data_tax`, `event_data_transaction_id`, `event_data_local_currency`, `event_data_local_currency_exchange_rate`, `event_data_revenue_in_local_currency`, `event_timestamp`, `existing_user`, `external_intent_uri`, `universal_link_url`, `android_app_link_url`, `first_event_for_user`, `hours_from_last_attributed_touch_to_event`, `id`, `install_activity_attributed`, `install_activity_data_has_clicked_ad`, `install_activity_data_has_clicked_email`, `install_activity_timestamp`, `install_activity_touch_data_additional_data_tilde_ad_id`, `install_activity_touch_data_additional_data_tilde_ad_set_id`, `install_activity_touch_data_additional_data_tilde_campaign_id`, `install_activity_touch_data_additional_data_tilde_creative_id`, `install_activity_touch_data_dollar_3p`, `install_activity_touch_data_plus_via_features`, `install_activity_touch_data_plus_web_format`, `install_activity_touch_data_tilde_ad_name`, `install_activity_touch_data_tilde_ad_set_name`, `install_activity_touch_data_tilde_advertising_partner_id`, `install_activity_touch_data_tilde_agency`, `install_activity_touch_data_tilde_agency_id`, `install_activity_touch_data_tilde_campaign`, `install_activity_touch_data_tilde_channel`, `install_activity_touch_data_tilde_creative_name`, `install_activity_touch_data_tilde_customer_ad_name`, `install_activity_touch_data_tilde_customer_ad_set_name`, `install_activity_touch_data_tilde_customer_campaign`, `install_activity_touch_data_tilde_customer_keyword`, `install_activity_touch_data_tilde_customer_placement`, `install_activity_touch_data_tilde_customer_secondary_publisher`, `install_activity_touch_data_tilde_customer_sub_site_name`, `install_activity_touch_data_tilde_feature`, `install_activity_touch_data_tilde_journey_name`, `install_activity_touch_data_tilde_keyword`, `install_activity_touch_data_tilde_placement`, `install_activity_touch_data_tilde_secondary_publisher`, `install_activity_touch_data_tilde_stage`, `install_activity_touch_data_tilde_tags`, `install_activity_touch_data_tilde_view_name`, `install_activity_touch_type`, `last_attributed_touch_data_custom_fields`, `last_attributed_touch_data_plus_current_feature`, `last_attributed_touch_data_tilde_id`, `last_attributed_touch_data_plus_touch_id`, `last_cta_view_data_plus_touch_id`, `last_attributed_touch_data_plus_via_features`, `last_attributed_touch_data_plus_web_format`, `last_attributed_touch_data_plus_attribution_method`, `last_attributed_touch_data_plus_attribution_method_type`, `last_attributed_touch_data_tilde_ad_id`, `last_attributed_touch_data_tilde_ad_name`, `last_attributed_touch_data_tilde_ad_set_id`, `last_attributed_touch_data_tilde_ad_set_name`, `last_attributed_touch_data_tilde_advertising_account_name`, `last_attributed_touch_data_tilde_advertising_account_id`, `last_attributed_touch_data_tilde_advertising_partner_id`, `last_attributed_touch_data_tilde_advertising_partner_name`, `last_attributed_touch_data_tilde_agency`, `last_attributed_touch_data_tilde_agency_id`, `last_attributed_touch_data_tilde_banner_dimensions`, `last_attributed_touch_data_tilde_branch_ad_format`, `last_attributed_touch_data_tilde_campaign`, `last_attributed_touch_data_tilde_campaign_id`, `last_attributed_touch_data_tilde_campaign_type`, `last_attributed_touch_data_tilde_channel`, `last_attributed_touch_data_tilde_creative_name`, `last_attributed_touch_data_tilde_creative_id`, `last_attributed_touch_data_tilde_customer_ad_name`, `last_attributed_touch_data_tilde_customer_ad_set_name`, `last_attributed_touch_data_tilde_customer_campaign`, `last_attributed_touch_data_tilde_customer_keyword`, `last_attributed_touch_data_tilde_customer_placement`, `last_attributed_touch_data_tilde_customer_secondary_publisher`, `last_attributed_touch_data_tilde_customer_sub_site_name`, `last_attributed_touch_data_tilde_external_touch_id`, `last_attributed_touch_data_tilde_feature`, `last_attributed_touch_data_tilde_journey_id`, `last_attributed_touch_data_tilde_journey_name`, `last_attributed_touch_data_tilde_keyword`, `last_attributed_touch_data_tilde_keyword_id`, `last_attributed_touch_data_tilde_optimization_model`, `last_attributed_touch_data_tilde_placement`, `last_attributed_touch_data_tilde_placement_id`, `last_attributed_touch_data_tilde_secondary_ad_format`, `last_attributed_touch_data_tilde_secondary_publisher`, `last_attributed_touch_data_tilde_secondary_publisher_id`, `last_attributed_touch_data_tilde_stage`, `last_attributed_touch_data_tilde_sub_site_name`, `last_attributed_touch_data_tilde_tags`, `last_attributed_touch_data_tilde_technology_partner`, `last_attributed_touch_data_tilde_touch_subtype`, `last_attributed_touch_data_tilde_view_id`, `last_attributed_touch_data_tilde_view_name`, `last_attributed_touch_timestamp`, `last_attributed_touch_timestamp_iso`, `last_attributed_touch_type`, `last_attributed_touch_data_tilde_organic_search_url`, `last_cta_view_data_custom_fields`, `last_cta_view_data_dollar_3p`, `last_attributed_touch_data_plus_referring_domain`, `last_cta_view_data_plus_via_features`, `last_cta_view_data_plus_web_format`, `last_cta_view_data_tilde_ad_id`, `last_cta_view_data_tilde_ad_name`, `last_cta_view_data_tilde_ad_set_id`, `last_cta_view_data_tilde_ad_set_name`, `last_cta_view_data_tilde_advertising_partner_name`, `last_cta_view_data_tilde_agency`, `last_cta_view_data_tilde_banner_dimensions`, `last_cta_view_data_tilde_branch_ad_format`, `last_cta_view_data_tilde_campaign`, `last_cta_view_data_tilde_campaign_id`, `last_cta_view_data_tilde_campaign_type`, `last_cta_view_data_tilde_channel`, `last_cta_view_data_tilde_creative_id`, `last_cta_view_data_tilde_creative_name`, `last_cta_view_data_tilde_external_touch_id`, `last_cta_view_data_tilde_feature`, `last_cta_view_data_tilde_id`, `last_cta_view_data_tilde_keyword_id`, `last_cta_view_data_tilde_optimization_model`, `last_cta_view_data_tilde_placement`, `last_cta_view_data_tilde_secondary_ad_format`, `last_cta_view_data_tilde_secondary_publisher`, `last_cta_view_data_tilde_stage`, `last_cta_view_data_tilde_tags`, `last_cta_view_data_tilde_technology_partner`, `last_cta_view_timestamp`, `last_cta_view_timestamp_iso`, `match_guaranteed`, `minutes_from_last_attributed_touch_to_event`, `name`, `organization_id`, `organization_name`, `origin`, `reengagement_activity_attributed`, `reengagement_activity_data_has_clicked_ad`, `reengagement_activity_data_has_clicked_email`, `reengagement_activity_timestamp`, `reengagement_activity_touch_data_additional_data_tilde_ad_id`, `reengagement_activity_touch_data_additional_data_tilde_ad_set_id`, `reengagement_activity_touch_data_additional_data_tilde_campaign_id`, `reengagement_activity_touch_data_additional_data_tilde_creative_id`, `reengagement_activity_touch_data_dollar_3p`, `reengagement_activity_touch_data_plus_via_features`, `reengagement_activity_touch_data_plus_web_format`, `reengagement_activity_touch_data_tilde_ad_name`, `reengagement_activity_touch_data_tilde_ad_set_name`, `reengagement_activity_touch_data_tilde_advertising_partner_id`, `reengagement_activity_touch_data_tilde_advertising_partner_name`, `reengagement_activity_touch_data_tilde_agency`, `reengagement_activity_touch_data_tilde_agency_id`, `reengagement_activity_touch_data_tilde_campaign`, `reengagement_activity_touch_data_tilde_channel`, `reengagement_activity_touch_data_tilde_creative_name`, `reengagement_activity_touch_data_tilde_customer_ad_name`, `reengagement_activity_touch_data_tilde_customer_ad_set_name`, `reengagement_activity_touch_data_tilde_customer_campaign`, `reengagement_activity_touch_data_tilde_customer_keyword`, `reengagement_activity_touch_data_tilde_customer_placement`, `reengagement_activity_touch_data_tilde_customer_secondary_publisher`, `reengagement_activity_touch_data_tilde_customer_sub_site_name`, `reengagement_activity_touch_data_tilde_feature`, `reengagement_activity_touch_data_tilde_journey_name`, `reengagement_activity_touch_data_tilde_keyword`, `reengagement_activity_touch_data_tilde_placement`, `reengagement_activity_touch_data_tilde_secondary_publisher`, `reengagement_activity_touch_data_tilde_stage`, `reengagement_activity_touch_data_tilde_tags`, `reengagement_activity_touch_data_tilde_view_name`, `reengagement_activity_touch_type`, `referrer_click_timestamp`, `seconds_from_install_to_event`, `seconds_from_last_attributed_touch_to_event`, `seconds_from_last_attributed_touch_to_store_install_begin`, `site_event_items_count`, `store_install_begin_timestamp`, `timestamp`, `timestamp_iso`, `user_data_aaid`, `user_data_android_id`, `user_data_app_package_name`, `user_data_app_version`, `user_data_brand`, `user_data_browser`, `user_data_build`, `user_data_cpu_type`, `user_data_cross_platform_id`, `user_data_developer_identity`, `user_data_device_type`, `user_data_environment`, `user_data_geo_city_code`, `user_data_geo_city_en`, `user_data_geo_country_code`, `user_data_geo_country_en`, `user_data_geo_dma_code`, `user_data_geo_lat`, `user_data_geo_lon`, `user_data_geo_postal_code`, `user_data_geo_region_en`, `user_data_geo_region_code`, `user_data_http_referrer`, `user_data_idfa`, `user_data_idfv`, `user_data_installer_package_name`, `user_data_internet_connection_type`, `user_data_ip`, `user_data_is_jailbroken`, `user_data_kindle_id`, `user_data_language`, `user_data_limit_ad_tracking`, `user_data_model`, `user_data_os`, `user_data_os_version`, `user_data_os_version_android`, `user_data_past_cross_platform_ids`, `user_data_platform`, `user_data_prob_cross_platform_ids`, `user_data_roku_rida`, `user_data_screen_height`, `user_data_screen_width`, `user_data_sdk_version`, `user_data_user_agent`, `user_data_windows_aid`, `user_data_device_locale`, `user_data_carrier_name`, `user_data_opted_in_status`, `user_data_app_store`, `user_data_dma_eea`, `user_data_dma_ad_personalization`, `user_data_dma_ad_user_data`, `measurement_metadata_method_type`, `measurement_metadata_method_name`.
- `report.filter` (array of enum) — Filter by fields and boolean operators against fields of the LogInstalls model; must be URI encoded and JSON parsed. Example: ["eq", "name", "PURCHASE"]. Note: Add each syntax as its own string. One of `eq`, `gt`, `gte`, `lt`, `lte`, `like`, `between`, `in`, `and`, `or`, `not`, `array_contains`, `app_id`, `app_name`, `attributed`, `content_items`, `custom_data`, `customer_event_alias`, `days_from_last_attributed_touch_to_event`, `deep_linked`, `di_match_click_token`, `event_data_ad_type`, `event_data_affiliation`, `event_data_coupon`, `event_data_currency`, `event_data_description`, `event_data_exchange_rate`, `event_data_revenue`, `event_data_revenue_in_usd`, `event_data_search_query`, `event_data_shipping`, `event_data_tax`, `event_data_transaction_id`, `event_data_local_currency`, `event_data_local_currency_exchange_rate`, `event_data_revenue_in_local_currency`, `event_timestamp`, `existing_user`, `external_intent_uri`, `universal_link_url`, `android_app_link_url`, `first_event_for_user`, `hours_from_last_attributed_touch_to_event`, `id`, `install_activity_attributed`, `install_activity_data_has_clicked_ad`, `install_activity_data_has_clicked_email`, `install_activity_timestamp`, `install_activity_touch_data_additional_data_tilde_ad_id`, `install_activity_touch_data_additional_data_tilde_ad_set_id`, `install_activity_touch_data_additional_data_tilde_campaign_id`, `install_activity_touch_data_additional_data_tilde_creative_id`, `install_activity_touch_data_dollar_3p`, `install_activity_touch_data_plus_via_features`, `install_activity_touch_data_plus_web_format`, `install_activity_touch_data_tilde_ad_name`, `install_activity_touch_data_tilde_ad_set_name`, `install_activity_touch_data_tilde_advertising_partner_id`, `install_activity_touch_data_tilde_agency`, `install_activity_touch_data_tilde_agency_id`, `install_activity_touch_data_tilde_campaign`, `install_activity_touch_data_tilde_channel`, `install_activity_touch_data_tilde_creative_name`, `install_activity_touch_data_tilde_customer_ad_name`, `install_activity_touch_data_tilde_customer_ad_set_name`, `install_activity_touch_data_tilde_customer_campaign`, `install_activity_touch_data_tilde_customer_keyword`, `install_activity_touch_data_tilde_customer_placement`, `install_activity_touch_data_tilde_customer_secondary_publisher`, `install_activity_touch_data_tilde_customer_sub_site_name`, `install_activity_touch_data_tilde_feature`, `install_activity_touch_data_tilde_journey_name`, `install_activity_touch_data_tilde_keyword`, `install_activity_touch_data_tilde_placement`, `install_activity_touch_data_tilde_secondary_publisher`, `install_activity_touch_data_tilde_stage`, `install_activity_touch_data_tilde_tags`, `install_activity_touch_data_tilde_view_name`, `install_activity_touch_type`, `last_attributed_touch_data_custom_fields`, `last_attributed_touch_data_plus_current_feature`, `last_attributed_touch_data_tilde_id`, `last_attributed_touch_data_plus_touch_id`, `last_cta_view_data_plus_touch_id`, `last_attributed_touch_data_plus_via_features`, `last_attributed_touch_data_plus_web_format`, `last_attributed_touch_data_plus_attribution_method`, `last_attributed_touch_data_plus_attribution_method_type`, `last_attributed_touch_data_tilde_ad_id`, `last_attributed_touch_data_tilde_ad_name`, `last_attributed_touch_data_tilde_ad_set_id`, `last_attributed_touch_data_tilde_ad_set_name`, `last_attributed_touch_data_tilde_advertising_account_name`, `last_attributed_touch_data_tilde_advertising_account_id`, `last_attributed_touch_data_tilde_advertising_partner_id`, `last_attributed_touch_data_tilde_advertising_partner_name`, `last_attributed_touch_data_tilde_agency`, `last_attributed_touch_data_tilde_agency_id`, `last_attributed_touch_data_tilde_banner_dimensions`, `last_attributed_touch_data_tilde_branch_ad_format`, `last_attributed_touch_data_tilde_campaign`, `last_attributed_touch_data_tilde_campaign_id`, `last_attributed_touch_data_tilde_campaign_type`, `last_attributed_touch_data_tilde_channel`, `last_attributed_touch_data_tilde_creative_name`, `last_attributed_touch_data_tilde_creative_id`, `last_attributed_touch_data_tilde_customer_ad_name`, `last_attributed_touch_data_tilde_customer_ad_set_name`, `last_attributed_touch_data_tilde_customer_campaign`, `last_attributed_touch_data_tilde_customer_keyword`, `last_attributed_touch_data_tilde_customer_placement`, `last_attributed_touch_data_tilde_customer_secondary_publisher`, `last_attributed_touch_data_tilde_customer_sub_site_name`, `last_attributed_touch_data_tilde_external_touch_id`, `last_attributed_touch_data_tilde_feature`, `last_attributed_touch_data_tilde_journey_id`, `last_attributed_touch_data_tilde_journey_name`, `last_attributed_touch_data_tilde_keyword`, `last_attributed_touch_data_tilde_keyword_id`, `last_attributed_touch_data_tilde_optimization_model`, `last_attributed_touch_data_tilde_placement`, `last_attributed_touch_data_tilde_placement_id`, `last_attributed_touch_data_tilde_secondary_ad_format`, `last_attributed_touch_data_tilde_secondary_publisher`, `last_attributed_touch_data_tilde_secondary_publisher_id`, `last_attributed_touch_data_tilde_stage`, `last_attributed_touch_data_tilde_sub_site_name`, `last_attributed_touch_data_tilde_tags`, `last_attributed_touch_data_tilde_technology_partner`, `last_attributed_touch_data_tilde_touch_subtype`, `last_attributed_touch_data_tilde_view_id`, `last_attributed_touch_data_tilde_view_name`, `last_attributed_touch_timestamp`, `last_attributed_touch_timestamp_iso`, `last_attributed_touch_type`, `last_attributed_touch_data_tilde_organic_search_url`, `last_cta_view_data_custom_fields`, `last_cta_view_data_dollar_3p`, `last_attributed_touch_data_plus_referring_domain`, `last_cta_view_data_plus_via_features`, `last_cta_view_data_plus_web_format`, `last_cta_view_data_tilde_ad_id`, `last_cta_view_data_tilde_ad_name`, `last_cta_view_data_tilde_ad_set_id`, `last_cta_view_data_tilde_ad_set_name`, `last_cta_view_data_tilde_advertising_partner_name`, `last_cta_view_data_tilde_agency`, `last_cta_view_data_tilde_banner_dimensions`, `last_cta_view_data_tilde_branch_ad_format`, `last_cta_view_data_tilde_campaign`, `last_cta_view_data_tilde_campaign_id`, `last_cta_view_data_tilde_campaign_type`, `last_cta_view_data_tilde_channel`, `last_cta_view_data_tilde_creative_id`, `last_cta_view_data_tilde_creative_name`, `last_cta_view_data_tilde_external_touch_id`, `last_cta_view_data_tilde_feature`, `last_cta_view_data_tilde_id`, `last_cta_view_data_tilde_keyword_id`, `last_cta_view_data_tilde_optimization_model`, `last_cta_view_data_tilde_placement`, `last_cta_view_data_tilde_secondary_ad_format`, `last_cta_view_data_tilde_secondary_publisher`, `last_cta_view_data_tilde_stage`, `last_cta_view_data_tilde_tags`, `last_cta_view_data_tilde_technology_partner`, `last_cta_view_timestamp`, `last_cta_view_timestamp_iso`, `match_guaranteed`, `minutes_from_last_attributed_touch_to_event`, `name`, `organization_id`, `organization_name`, `origin`, `reengagement_activity_attributed`, `reengagement_activity_data_has_clicked_ad`, `reengagement_activity_data_has_clicked_email`, `reengagement_activity_timestamp`, `reengagement_activity_touch_data_additional_data_tilde_ad_id`, `reengagement_activity_touch_data_additional_data_tilde_ad_set_id`, `reengagement_activity_touch_data_additional_data_tilde_campaign_id`, `reengagement_activity_touch_data_additional_data_tilde_creative_id`, `reengagement_activity_touch_data_dollar_3p`, `reengagement_activity_touch_data_plus_via_features`, `reengagement_activity_touch_data_plus_web_format`, `reengagement_activity_touch_data_tilde_ad_name`, `reengagement_activity_touch_data_tilde_ad_set_name`, `reengagement_activity_touch_data_tilde_advertising_partner_id`, `reengagement_activity_touch_data_tilde_advertising_partner_name`, `reengagement_activity_touch_data_tilde_agency`, `reengagement_activity_touch_data_tilde_agency_id`, `reengagement_activity_touch_data_tilde_campaign`, `reengagement_activity_touch_data_tilde_channel`, `reengagement_activity_touch_data_tilde_creative_name`, `reengagement_activity_touch_data_tilde_customer_ad_name`, `reengagement_activity_touch_data_tilde_customer_ad_set_name`, `reengagement_activity_touch_data_tilde_customer_campaign`, `reengagement_activity_touch_data_tilde_customer_keyword`, `reengagement_activity_touch_data_tilde_customer_placement`, `reengagement_activity_touch_data_tilde_customer_secondary_publisher`, `reengagement_activity_touch_data_tilde_customer_sub_site_name`, `reengagement_activity_touch_data_tilde_feature`, `reengagement_activity_touch_data_tilde_journey_name`, `reengagement_activity_touch_data_tilde_keyword`, `reengagement_activity_touch_data_tilde_placement`, `reengagement_activity_touch_data_tilde_secondary_publisher`, `reengagement_activity_touch_data_tilde_stage`, `reengagement_activity_touch_data_tilde_tags`, `reengagement_activity_touch_data_tilde_view_name`, `reengagement_activity_touch_type`, `referrer_click_timestamp`, `seconds_from_install_to_event`, `seconds_from_last_attributed_touch_to_event`, `seconds_from_last_attributed_touch_to_store_install_begin`, `site_event_items_count`, `store_install_begin_timestamp`, `timestamp`, `timestamp_iso`, `user_data_aaid`, `user_data_android_id`, `user_data_app_package_name`, `user_data_app_version`, `user_data_brand`, `user_data_browser`, `user_data_build`, `user_data_cpu_type`, `user_data_cross_platform_id`, `user_data_developer_identity`, `user_data_device_type`, `user_data_environment`, `user_data_geo_city_code`, `user_data_geo_city_en`, `user_data_geo_country_code`, `user_data_geo_country_en`, `user_data_geo_dma_code`, `user_data_geo_lat`, `user_data_geo_lon`, `user_data_geo_postal_code`, `user_data_geo_region_en`, `user_data_geo_region_code`, `user_data_http_referrer`, `user_data_idfa`, `user_data_idfv`, `user_data_installer_package_name`, `user_data_internet_connection_type`, `user_data_ip`, `user_data_is_jailbroken`, `user_data_kindle_id`, `user_data_language`, `user_data_limit_ad_tracking`, `user_data_model`, `user_data_os`, `user_data_os_version`, `user_data_os_version_android`, `user_data_past_cross_platform_ids`, `user_data_platform`, `user_data_prob_cross_platform_ids`, `user_data_roku_rida`, `user_data_screen_height`, `user_data_screen_width`, `user_data_sdk_version`, `user_data_user_agent`, `user_data_windows_aid`, `user_data_device_locale`, `user_data_carrier_name`, `user_data_opted_in_status`, `user_data_app_store`, `user_data_dma_eea`, `user_data_dma_ad_personalization`, `user_data_dma_ad_user_data`, `measurement_metadata_method_type`, `measurement_metadata_method_name`.

### Responses

- `200` — Status of aggregate export.
- `401` — Auth Client failed response.
- `404` — User not found.
- `500` — Internal server error.

### Returns

Status of aggregate export. Returns `401`, `404`, and `500` on failure — see the response panel for the error shape.

### Example request

```bash
curl 'https://api2.branch.io/scheduled-exports/logs/subscribe?app_id=%3Capp_id%3E' \
  --request POST \
  --header 'Access-Token: <Access-Token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "report": {
      "cadence": "hourly",
      "response_format": "csv",
      "response_format_compression": "gz",
      "report_type": "eo_install",
      "report_fields": [
        "name"
      ]
    },
    "destination": {
      "subscription_type": "cloud",
      "cloud": "s3",
      "bucket": "my-branch-export-bucket",
      "prefix": "my-folder",
      "resource_access_id": "arn:aws:iam::xxxxxxxxxxxx:role/role-name-here"
    }
  }'
```

### Example responses

`200`

```json
{
  "subscription_id": "XXXX-0000-xxxx",
  "status": "PENDING",
  "description": "Generating sample report. Subscription will finish after Report is uploaded",
  "subscription_url": "https://api2.branch.io/scheduled-exports/exports/logs/subscription/{SUBSCRIPTION_ID}?app_id={APP_ID}"
}
```

`401`

```json
{
  "error": {
    "message": "Auth Client didn't return anything for the user id: $userid.",
    "code": 401
  }
}
```

`404`

```json
{
  "error": {
    "message": "Not authorized for the user id: $userid.",
    "code": 404
  }
}
```

`500`

```json
{
  "error": {
    "message": "Our product is failing to serve your request at this moment. Please try again later.",
    "code": 500
  }
}
```

## Deactivate subscription

`DELETE https://api2.branch.io/scheduled-exports/logs/subscription/{subscription_id}`

Deactivates a single export subscription for a given subscription ID.

### Parameters

- `subscription_id` (string, path, required) — A persistent ID for the specific subscription. 

### Responses

- `200` — Status of aggregate export.
- `400` — Bad request—typically an invalid or missing credential or parameter.
- `404` — Job ID not found.

### Returns

Status of aggregate export. Returns `400` and `404` on failure — see the response panel for the error shape.

### Example request

```bash
curl 'https://api2.branch.io/scheduled-exports/logs/subscription/XXXX-0000-xxxx?app_id=%3Capp_id%3E' \
  --request DELETE \
  --header 'Access-Token: <Access-Token>'
```

### Example responses

`200`

```json
{
  "status": "SUCCESS",
  "description": "Subscription deactivated successfully"
}
```

`400`

```json
{
  "error": {
    "message": "Authentication failed.",
    "code": 400
  }
}
```
