---
title: "Api Add User Upload Golden Sql"
method: POST
path: "/api/golden-sqls"
tags: ["Golden SQL"]
---

# Api Add User Upload Golden Sql

`POST /api/golden-sqls`

## Request

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

## Request body

- GoldenSQLRequest[]
  - `db_connection_id` string, required
  - `prompt_text` string, required
  - `sql` string, required
  - `metadata` object

## Response `201`

Successful Response

- GoldenSQLResponse[]
  - `db_connection_id` string, required
  - `prompt_text` string, required
  - `sql` string, required
  - `id` string, required
  - `created_at` string, date-time
  - `metadata` GoldenSQLMetadata
    - `dh_internal` DHGoldenSQLMetadata
      - `prompt_id` string
      - `organization_id` string
      - `source` 'USER_UPLOAD' | 'VERIFIED_QUERY': An enumeration.
      - `display_id` string

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