---
title: "Api Generate Sql Result"
method: POST
path: "/api/generations/{id}/sql-generation"
tags: ["Aggregated Generation"]
---

# Api Generate Sql Result

`POST /api/generations/{id}/sql-generation`

## Request

- The document declares no server URL.
- Auth: API key in header `X-API-Key`

## Path parameters

- `id` string, required

## Request body

- SQLRequest
  - `sql` string, required

## Response `201`

Successful Response

- GenerationResponse
  - `id` string, required
  - `db_connection_id` string, required
  - `prompt_text` string, required
  - `created_by` string
  - `updated_by` string
  - `organization_id` string
  - `display_id` string
  - `slack_info` SlackInfo
    - `user_id` string
    - `channel_id` string
    - `thread_ts` string
    - `username` string
  - `message` string
  - `sql` string
  - `confidence_score` number
  - `sql_generation_error` string
  - `nl_generation_text` string
  - `updated_at` string, date-time
  - `created_at` string, date-time
  - `status` 'INITIALIZED' | 'IN_PROGRESS' | 'NOT_VERIFIED' | 'VERIFIED' | 'ERROR' | 'REJECTED': An enumeration.

## Other responses

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

---

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