Generate Curated
const url = 'https://example.com/api/v2/codegen/curated';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"flow_name":"example","source_table":"example","source_tables":["example"],"target_name":"example","trigger_type":"scheduled","schedule":{"cron":"example","timezone":"UTC"},"sql":"example","target_schema":{"description":"example","columns":[{"name":"example","type":"example","description":"","pk":false,"not_null":false,"pii":false,"glossary_terms":["example"]}],"foreign_keys":[{"column":"example","parent_table":"example","parent_column":"example"}]},"load_options":{"truncate":false,"merge":false,"dedup_columns":["example"],"dedup_order_by":"example"},"audit_columns":{"additionalProperty":"example"},"warehouse":"example","requested_by":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v2/codegen/curated \ --header 'Content-Type: application/json' \ --data '{ "flow_name": "example", "source_table": "example", "source_tables": [ "example" ], "target_name": "example", "trigger_type": "scheduled", "schedule": { "cron": "example", "timezone": "UTC" }, "sql": "example", "target_schema": { "description": "example", "columns": [ { "name": "example", "type": "example", "description": "", "pk": false, "not_null": false, "pii": false, "glossary_terms": [ "example" ] } ], "foreign_keys": [ { "column": "example", "parent_table": "example", "parent_column": "example" } ] }, "load_options": { "truncate": false, "merge": false, "dedup_columns": [ "example" ], "dedup_order_by": "example" }, "audit_columns": { "additionalProperty": "example" }, "warehouse": "example", "requested_by": "example" }'Generate Curated (Silver) layer artifacts - V2.
This is the simplified curated layer generation that:
- Requires SQL in input (SELECT, INSERT, or procedure call)
- trigger_type: “scheduled” or “streaming” only
- Template selection based on SQL content:
- SELECT → INSERT or TRUNCATE+INSERT (based on load_options.truncate)
- INSERT → used as-is
- Procedure → wrapped in procedure template
- For streaming: creates Dynamic Table
Response contains:
- DDL artifact at sql/ddl/{flow_name}.sql
- SQL artifact at sql/silver/{flow_name}.sql
- Task SQL at sql/tasks/{flow_name}_task.sql (scheduled only)
- Changelog at docs/changelog/silver_{flow_name}.md
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Input model for Silver layer code generation.
Simplified model focused on silver layer with:
- trigger_type: Only “scheduled” or “streaming”
- sql: Always required (contains SELECT, INSERT, or procedure call)
Template selection is based on sql content:
- SELECT statement → wrapped in INSERT/TRUNCATE+INSERT
- INSERT statement → used directly
- CALL/procedure → wrapped in procedure template
Example payload: { “flow_name”: “silver_customer”, “source_table”: “dev.raw.customer”, “target_name”: “dev.silver.customer”, “trigger_type”: “scheduled”, “schedule”: {“cron”: “USING CRON 0 * * * * UTC”, “timezone”: “UTC”}, “sql”: “SELECT customer_id, TRIM(name) as name FROM dev.raw.customer”, “target_schema”: { “description”: “Customer dimension”, “columns”: [ {“name”: “customer_id”, “type”: “STRING”, “pk”: true}, {“name”: “name”, “type”: “STRING”} ] }, “load_options”: {“truncate”: true}, “warehouse”: “COMPUTE_WH”, “requested_by”: “user” }
object
Schedule configuration for tasks.
object
Table schema definition.
object
Foreign key definition.
object
Load options for declarative ETL.
object
Responses
Section titled “Responses”Successful Response
Standard response for all codegen endpoints.
object
Example
{ "status": "success", "artifacts": [ { "is_base64": false } ]}Validation Error
object
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}