---
title: "Run a playground query as the current workspace"
method: POST
path: "/playground/run"
tags: ["Playground"]
---

# Run a playground query as the current workspace

`POST /playground/run`

## Request

- Base URL: `https://api.flashdata.dev/v2`
- URL: `https://api.flashdata.dev/v2/playground/run`
- Auth: API key in cookie `__Host-fd_session` and API key in header `X-CSRF-Token`

## Request body

- object
  - `source` string, required
  - `mode` 'realtime' | 'async' | 'batch', required
  - `query` object, required: Source request body. In batch mode, also accepts an object containing only queries, an array of 1 to 20 request bodies. Every entry must match the selected source and its input schema. Search and Suggestions require query; Channel requires handle; Metadata, Transcript, Captions, Trainability and Download require an 11-character video_id matching [A-Za-z0-9_-]. Download batch entries must supply params.storage for customer storage; console browser delivery is not supported in this envelope. Account batch and pending-job limits still apply.

## Response `200`

Upstream Data API response captured for the playground

- object
  - `body` unknown, required
  - `endpoint` '/v1/queries' | '/v1/queries/batch' | '/v1/queries/realtime', required
  - `mode` 'realtime' | 'async' | 'batch', required
  - `status` integer, required

## Other responses

- `401`: Authentication required or invalid
- `422`: Request validation failed

---

[API](https://skmtc.dev/flashdata/apis/flashdata-customer-api.md) · [All operations](https://skmtc.dev/flashdata/apis/flashdata-customer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/flashdata/apis/flashdata-customer-api/revisions/109179fe9313?raw)
