---
title: "Create agent definition + scenario and start generation workflow. Moves replay session to GENERATING state."
method: POST
path: "/tracer/replay-session/{id}/generate-scenario/"
tags: ["tracer"]
---

# Create agent definition + scenario and start generation workflow. Moves replay session to GENERATING state.

`POST /tracer/replay-session/{id}/generate-scenario/`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/tracer/replay-session/{id}/generate-scenario/`
- Auth: one of:
  - API key in header `X-Api-Key`
  - API key in header `X-Secret-Key`

URL params:
    pk: replay session uuid

Request body:
    agent_name: string (required)
    agent_description: string (optional)
    scenario_name: string (required)
    agent_type: "text" or "voice" (default: "text")
    no_of_rows: int (default: 20)
    personas: list of uuids (optional)
    custom_columns: list of dicts (optional)
    graph: dict (optional)
    generate_graph: bool (default: true)

## Request body

- GenerateScenario
  - `agent_name` string, required
  - `agent_description` string
  - `scenario_name` string, required
  - `agent_type` 'text' | 'voice'
  - `no_of_rows` integer
  - `personas` string[]
  - `custom_columns` object[]
  - `graph` object, nullable
  - `generate_graph` boolean

## Response `201`

Created

- GenerateScenario
  - `agent_name` string, required
  - `agent_description` string
  - `scenario_name` string, required
  - `agent_type` 'text' | 'voice'
  - `no_of_rows` integer
  - `personas` string[]
  - `custom_columns` object[]
  - `graph` object, nullable
  - `generate_graph` boolean

## Other responses

- `default`: Default error response

---

[API](https://skmtc.dev/futureagi/apis/future-agi-management-api.md) · [All operations](https://skmtc.dev/futureagi/apis/future-agi-management-api/llms.txt) · [OpenAPI document](https://skmtc.dev/futureagi/apis/future-agi-management-api/revisions/c8684118e142?raw)
