---
title: "Generate a test dataset for a form"
method: POST
path: "/api/v1/toolkit_ai/generate-dataset"
tags: ["Toolkit AI"]
---

# Generate a test dataset for a form

`POST /api/v1/toolkit_ai/generate-dataset`

## Request

- Base URL: `https://toolkit.browserstack.com`
- URL: `https://toolkit.browserstack.com/api/v1/toolkit_ai/generate-dataset`
- Auth: API key in cookie `_wdt_rails_session`

Generates N cohesive rows of synthetic test data for a form, honouring per-field natural-language rules (LV-3626). Also serves column regeneration via targetFields + existingRows.

## Request body

- object
  - `fields` object[], required
    - `name` string
    - `type` string
    - `label` string
    - `rule` string
    - `options` string[]
  - `rowCount` integer
  - `formContext` string
  - `locale` string
  - `targetFields` string[]
  - `existingRows` object[]

## Response `200`

Dataset generated successfully

- object
  - `success` boolean
  - `response` object

## Other responses

- `400`: Invalid request payload
- `402`: Form filler quota exhausted
- `403`: Forbidden - user lacks access

---

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