Onboard a new data source, step 1: create a data spec and get upload URL(s)
onboard_data_sourceCreate a data spec to start data integration: upload a sample file for presigned URL, or generate an AI SQL query from workspace tables, then finalize.
Instructions
First step of setting up a new data integration: creates a data spec. sourceType "file" (default) returns presigned upload URL(s) for a sample file; upload, then call finish_data_source_onboarding. sourceType "tables" derives/aggregates data already loaded into workspace tables via an AI-generated SQL query instead, and requires autoRefresh (how the spec stays up to date: spec_success, schedule, or none).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| merge | No | Upsert instead of plain append when true (default false). | |
| specName | Yes | Name for the new data spec. | |
| sourceType | No | Defaults to file. Use tables to query existing workspace table(s). | |
| autoRefresh | No | sourceType tables only. Required for it: spec_success, schedule, or none (manual-only, re-run with run_data_job). | |
| description | No | Optional description of the data spec. | |
| workspaceId | No | Workspace to act on. Defaults to your only workspace if you have exactly one. | |
| sourceTables | No | sourceType tables only: source tables the generated query reads from. Required for sourceType tables. | |
| targetOption | No | Where transformed data lands: auto-infer (default), existing-tables (needs targetTables), or target-schema-file (needs targetSchemaFileName). | |
| targetTables | No | Names of existing workspace tables to target. Required when targetOption is existing-tables. | |
| formatFileName | No | sourceType file only. File name of an optional format spec file. | |
| sampleFileName | No | sourceType file only (required for it). File name of the sample data file. | |
| additionalPrompt | No | Instructions for the AI schema inference / query generation. Stored on the spec and reused on future re-analysis. | |
| autoRefreshFrequency | No | Required when autoRefresh is schedule. | |
| targetSchemaFileName | No | File name of a target schema file. Required when targetOption is target-schema-file. | |
| autoRefreshUpstreamSpecName | No | Required when autoRefresh is spec_success. |