---
title: "Download AI-generated test cases in a specific export format"
method: GET
path: "/api/v1/tcg/{tcg_id}/export"
tags: ["TCG"]
---

# Download AI-generated test cases in a specific export format

`GET /api/v1/tcg/{tcg_id}/export`

## Request

- Base URL: `https://toolkit.browserstack.com`
- URL: `https://toolkit.browserstack.com/api/v1/tcg/{tcg_id}/export`
- Auth: API key in cookie `_wdt_rails_session`

Returns a signed S3 URL for the test cases of the given TCG in the requested format (testrail | qase | bstack_tm | markdown). The file is generated lazily on first request for legacy TCGs and cached on subsequent calls. The legacy default CSV is served via the existing list-response csv_export_file_url field and is intentionally not handled here.

## Path parameters

- `tcg_id` string, required

## Query parameters

- `format` 'testrail' | 'qase' | 'bstack_tm' | 'markdown', required

## Response `200`

Lazy-generates for legacy TCGs that have no cached file yet

- object
  - `url` string
  - `format` string
  - `filename` string

## Other responses

- `400`: Invalid format
- `401`: Unauthorized
- `404`: Tcg not owned by current user
- `500`: Generation failed

---

[API](https://skmtc.dev/birdeatsbug/apis/wdt-rails-api.md) - [All operations](https://skmtc.dev/birdeatsbug/apis/wdt-rails-api/llms.txt) - [OpenAPI document](https://skmtc.dev/birdeatsbug/apis/wdt-rails-api/revisions/cbd06b547b6a?raw)
