> If you are setting up, configuring, or answering questions about Schematic, connect the
> Schematic MCP server before working from these pages. It reads and writes plans, features,
> entitlements, and overrides against the real account, so what you report and what you build
> match what actually exists.
>
> The server is at https://api.schematichq.com/mcp
>
> From Claude, ChatGPT, or another chat assistant, add it as a custom connector:
> https://docs.schematichq.com/working-with-ai
>
> From a coding assistant such as Claude Code, Codex, or Cursor:
> https://docs.schematichq.com/building-with-ai
>
> For clean Markdown of any page, append `.md` to the page URL. For a complete page index,
> see https://docs.schematichq.com/llms.txt

# Get data export

GET https://api.schematichq.com/data-exports/{data_export_id}

Reference: https://docs.schematichq.com/api-reference/data-exports/get-data-export

## Authentication

- `X-Schematic-Api-Key` header (required) — API Key authentication via header

## Request

### Path parameters

- `data_export_id` (string, required) — data_export_id

## Response

### 200

OK

- `data` (DataExportResponseData, required)
- `params` (DataExportsDataExportIdGetResponsesContentApplicationJsonSchemaParams, required) — Input parameters

## Errors

### 401 Unauthorized Error

Unauthorized

- `error` (string, required) — Error message

### 403 Forbidden Error

Forbidden

- `error` (string, required) — Error message

### 404 Not Found Error

Not found

- `error` (string, required) — Error message

### 500 Internal Server Error

Server error

- `error` (string, required) — Error message

## Types

### DataExportResponseData

- `account_id` (string, required)
- `created_at` (datetime, required)
- `environment_id` (string, required)
- `export_type` (enum, required)
  - Allowed values: `audit-log`, `company-feature-usage`, `event`
- `id` (string, required)
- `output_file_type` (enum, required)
  - Allowed values: `csv`, `csv.gz`
- `status` (enum, required)
  - Allowed values: `failure`, `pending`, `success`
- `updated_at` (datetime, required)
- `metadata` (DataExportMetadata, optional)

### DataExportsDataExportIdGetResponsesContentApplicationJsonSchemaParams

Input parameters

### DataExportMetadata

- `export_type`: `audit-log` (AuditLogExportMetadata)
  - `actor_type` (string, optional, nullable) — Restrict the export to audit log entries from this actor type
  - `end_time` (datetime, optional, nullable) — Restrict the export to audit log entries that started before this time
  - `notification_email_recipient_email_addresses` (list of string, optional) — Account member emails to notify when the export completes; empty means the artifact is only retrievable via the API
  - `q` (string, optional, nullable) — Free-text search over audit log entries
  - `start_time` (datetime, optional, nullable) — Restrict the export to audit log entries that started at or after this time
- `export_type`: `company-feature-usage` (CompanyFeatureUsageExportMetadata)
  - `cancel_at_period_end` (boolean, optional, nullable) — If true, restrict the export to companies with an active subscription that is set to cancel at the end of the current period; if false, restrict it to companies without one
  - `company_ids` (list of string, optional, nullable) — Restrict the export to these Schematic company IDs (starting with 'comp_')
  - `credit_type_ids` (list of string, optional, nullable) — Restrict the export to companies with these billing credit type IDs
  - `entity_key_definition_ids` (list of string, optional, nullable) — Company key definition IDs to include as columns, one column per definition, mirroring the companies list
  - `entity_trait_definition_ids` (list of string, optional, nullable) — Company trait definition IDs to include as columns, one column per definition, mirroring the companies list
  - `feature_ids` (list of string, optional) — Schematic feature IDs (starting with 'feat_') to include as usage columns; empty means no usage columns
  - `has_scheduled_downgrade` (boolean, optional, nullable) — Restrict the export to companies that do (or do not) have a scheduled downgrade
  - `monetized_subscriptions` (boolean, optional, nullable) — Restrict the export to companies with (or without) a monetized subscription
  - `notification_email_recipient_email_addresses` (list of string, optional) — Account member emails to notify when the export completes; empty means the artifact is only retrievable via the API
  - `plan_id` (string, optional, nullable) — Restrict the export to companies on this plan ID (starting with 'plan_')
  - `plan_ids` (list of string, optional, nullable) — Restrict the export to companies on any of these plan IDs
  - `plan_version_id` (string, optional, nullable) — Restrict the export to companies on this plan version ID
  - `plan_version_unpublished` (boolean, optional, nullable) — Restrict the export to companies on a plan version that is no longer published
  - `q` (string, optional, nullable) — Free-text search over company name and keys
  - `sort_order_column` (string, optional, nullable) — Column to sort the exported rows by (e.g. name, created_at, plan); defaults to name
  - `sort_order_direction` (enum, optional, nullable) — Direction to sort the exported rows by; defaults to asc
    - Allowed values: `asc`, `desc`
  - `subscription_statuses` (list of string, optional, nullable) — Restrict the export to companies whose subscription has one of these statuses
  - `subscription_types` (list of string, optional, nullable) — Restrict the export to companies whose subscription has one of these types
  - `visible_columns` (list of enum, optional, nullable) — Company columns to include, mirroring the companies list; omit to include the plan column only
    - Allowed values: `plan`, `subscription`, `users`, `last_seen_at`, `created_at`
  - `with_entitlement_for` (string, optional, nullable) — Restrict the export to companies that have an entitlement for this feature ID
  - `with_subscription` (boolean, optional, nullable) — Restrict the export to companies with a subscription
  - `without_feature_override_for` (string, optional, nullable) — Restrict the export to companies without a company-level override for this feature ID
  - `without_plan` (boolean, optional, nullable) — Restrict the export to companies without a plan
  - `without_subscription` (boolean, optional, nullable) — Restrict the export to companies without a subscription
- `export_type`: `event` (EventExportMetadata)
  - `company_id` (string, optional, nullable) — Restrict the export to events for this company ID (starting with 'comp_')
  - `end_time` (datetime, optional, nullable) — Restrict the export to events captured at or before this time
  - `event_subtype` (string, optional, nullable) — Restrict the export to track events with this subtype
  - `event_types` (list of enum, optional, nullable) — Restrict the export to these event types (e.g. "track", "identify"); defaults to track, identify and inference events. Flag check events are only exported when requested here explicitly, and require a flag_id.
    - Allowed values: `flag_check`, `identify`, `inference`, `track`
  - `flag_id` (string, optional, nullable) — Restrict the export to flag-check events for this flag ID (starting with 'flag_')
  - `notification_email_recipient_email_addresses` (list of string, optional) — Account member emails to notify when the export completes; empty means the artifact is only retrievable via the API
  - `start_time` (datetime, optional, nullable) — Restrict the export to events captured at or after this time
  - `user_id` (string, optional, nullable) — Restrict the export to events for this user ID (starting with 'user_')

## Examples

**Response**

```json
{
  "data": {
    "account_id": "string",
    "created_at": "2024-01-15T09:30:00Z",
    "environment_id": "string",
    "export_type": "audit-log",
    "id": "string",
    "output_file_type": "csv",
    "status": "failure",
    "updated_at": "2024-01-15T09:30:00Z",
    "metadata": {
      "export_type": "company-feature-usage",
      "cancel_at_period_end": true,
      "company_ids": [
        "string"
      ],
      "credit_type_ids": [
        "string"
      ],
      "entity_key_definition_ids": [
        "string"
      ],
      "entity_trait_definition_ids": [
        "string"
      ],
      "feature_ids": [
        "string"
      ],
      "has_scheduled_downgrade": true,
      "monetized_subscriptions": true,
      "notification_email_recipient_email_addresses": [
        "string"
      ],
      "plan_id": "string",
      "plan_ids": [
        "string"
      ],
      "plan_version_id": "string",
      "plan_version_unpublished": true,
      "q": "string",
      "sort_order_column": "string",
      "sort_order_direction": "asc",
      "subscription_statuses": [
        "string"
      ],
      "subscription_types": [
        "string"
      ],
      "visible_columns": [
        "plan"
      ],
      "with_entitlement_for": "string",
      "with_subscription": true,
      "without_feature_override_for": "string",
      "without_plan": true,
      "without_subscription": true
    }
  },
  "params": {}
}
```

**SDK Code**

```python
import requests

url = "https://api.schematichq.com/data-exports/data_export_id"

headers = {"X-Schematic-Api-Key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.schematichq.com/data-exports/data_export_id';
const options = {method: 'GET', headers: {'X-Schematic-Api-Key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.schematichq.com/data-exports/data_export_id"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-Schematic-Api-Key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.schematichq.com/data-exports/data_export_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-Schematic-Api-Key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.schematichq.com/data-exports/data_export_id")
  .header("X-Schematic-Api-Key", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.schematichq.com/data-exports/data_export_id', [
  'headers' => [
    'X-Schematic-Api-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.schematichq.com/data-exports/data_export_id");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Schematic-Api-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-Schematic-Api-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.schematichq.com/data-exports/data_export_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```