---
title: "Export multiple BDD test cases as Gherkin feature files"
method: POST
path: "/testcase/bdd-feature-files"
tags: ["TestCase"]
---

# Export multiple BDD test cases as Gherkin feature files

`POST /testcase/bdd-feature-files`

## Request

- Base URL: `https://app.testiny.io/api/v1`
- URL: `https://app.testiny.io/api/v1/testcase/bdd-feature-files`
- Auth: API key in header `X-Api-Key`
- TypeScript: <https://skmtc.dev/testiny/apis/testiny-api/docs/testcase/bdd-feature-files/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates one Gherkin .feature file per given test case using the BDD template, in the order of the requested ids (duplicates are exported once). Fails if any of the test cases does not exist or does not use the BDD template.

## Request body

- BddFeatureFilesParams
  - `ids` integer[], required: Ids of the BDD test cases to export
  - `lang` string: Gherkin dialect to create the feature headers with - defaults to the dialect stored in each document
  - `link` boolean: If true, the synthesized feature files contain links to their test case

## Response `200`

Returns 'BddFeatureFilesResult'

- BddFeatureFilesResult: The synthesized Gherkin feature files
  - `featureFiles` object[], required
    - `tcId` integer, required: The id of the exported test case
    - `lang` string, required: The Gherkin dialect the feature file was synthesized with
    - `gherkin` string, required: The synthesized Gherkin feature file

## Other responses

- `4XX`: The request failed because invalid request parameters or data were supplied or access was denied.
- `5XX`: The request failed because an error occurred during processing of the request.

---

[API](https://skmtc.dev/testiny/apis/testiny-api.md) - [All operations](https://skmtc.dev/testiny/apis/testiny-api/llms.txt) - [OpenAPI document](https://skmtc.dev/testiny/apis/testiny-api/revisions/8f7643b2429d?raw)
