---
title: "Push generated test cases into a connected test management tool"
method: POST
path: "/api/v1/tcg/{tcg_id}/push-export"
tags: ["TCG"]
---

# Push generated test cases into a connected test management tool

`POST /api/v1/tcg/{tcg_id}/push-export`

## Request

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

Starts an asynchronous export of the TCG's generated test cases into TestRail, Xray, Azure Test Plans or Zephyr Scale via the central integrations service. Returns immediately with the run record; poll the companion GET endpoint for progress. Every export CREATES new cases in the target tool — nothing is updated in place, so exporting twice produces two independent sets.

## Path parameters

- `tcg_id` string, required

## Request body

- object
  - `tool` 'testrail' | 'xray' | 'azure-testplan' | 'zephyr-scale', required: Integration key of the target tool. qTest and QMetry are not accepted: their connectors are read-only upstream.
  - `project_id` string, required: Project in the target tool
  - `folder_id` string: Destination container, interpreted per tool and stored on a typed target record: a section id for TestRail (required there), a folder PATH for Xray and Zephyr Scale, a test plan id for Azure Test Plans.
  - `suite_id` string: TestRail multi-suite projects, and the test suite id for Azure Test Plans
  - `area_path` string: Azure Test Plans only
  - `iteration_path` string: Azure Test Plans only
  - `create_preconditions` boolean: Xray only: create each case's precondition as its own linked Jira issue
  - `skip_exported` boolean: Dedupe. Any case an earlier run already created in this PROJECT is left alone, so a second export does not duplicate it. DEFAULTS TO TRUE — send false only to force a fresh set, which is what someone who deleted the cases in their tool needs, since these records track what we created rather than what still exists. Reported back as status.skipped.
  - `folder_name` string: Creates (or reuses) a per-run home of this name and targets it: a section under folder_id for TestRail, a folder path for Xray and Zephyr Scale, and a whole TEST PLAN (root suite included) for Azure Test Plans, where it replaces any caller-picked plan and suite.

## Response `202`

Export accepted and queued

- object
  - `data` object
    - `id` string
    - `type` string
    - `attributes` object
      - `export-type` string
      - `status` object: Run state. Lives on the tool-specific target, so a future tool can report progress its own way.
        - `state` 'pending' | 'in_progress' | 'success' | 'partial' | 'failed'
        - `total` integer
        - `succeeded` integer
        - `failed` integer
        - `skipped` integer: Cases dedupe held back. Counted from their own rows, NOT derived as total - succeeded - failed: a run that stops on its time budget leaves cases with no row at all, so that subtraction no longer holds.
        - `skip_exported` boolean
        - `attempts` integer
      - `target` object: Where this run is sending its cases, flattened from the per-tool target record.
        - `type` string
        - `project-id` string
        - `container` string
        - `site-url` string
      - `total-count` integer
      - `success-count` integer
      - `failure-count` integer

## Other responses

- `404`: TCG not found for this user
- `422`: Unsupported tool, missing project, or nothing to export

---

[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)
