---
title: "Api Create Generation"
method: POST
path: "/api/generations"
tags: ["Aggregated Generation"]
---

# Api Create Generation

`POST /api/generations`

## Request body

- GenerationRequest
  - `prompt` string, required
  - `db_connection_id` string
  - `slack_info` SlackInfoRequest
    - `user_id` string
    - `channel_id` string
    - `thread_ts` string
    - `username` string
    - `workspace_id` string

## Response `201`

Successful Response.

- GenerationSlackResponse
  - `id` string, required
  - `display_id` string, required
  - `nl_generation_text` string
  - `sql` string, required
  - `exec_time` number
  - `is_above_confidence_threshold` boolean

## Other responses

- `404` — Not found
- `422` — Validation Error

---

[API](https://skmtc.net/dataherald/apis/fastapi.md) · [All operations](https://skmtc.net/dataherald/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/dataherald/fastapi/versions/e168e98625a8/schema)
