Import a spreadsheet into a new database
Parses an uploaded or provider-hosted spreadsheet once and creates a database with the mapped fields and rows, returning the created database with its field, record, and skipped-row counts. Requires `databases:write`, plus `files:read` when importing an uploaded file. Malformed or oversized workbooks are rejected as validation errors; passing a `clientMutationId` makes the import replay-safe, and reusing one while its import is still running, or with different input, is reported as an in-progress or conflicting-mutation error. Send an `Idempotency-Key` header to make retries safe; a replay within the window returns the original response.
Authorization
apiKey Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/v1/workspaces/string/data-sources/import-spreadsheet" \ -H "Content-Type: application/json" \ -d '{ "label": "string", "kind": "file", "fields": [ { "sourcePath": "string", "fieldKey": "string", "label": "string", "kind": "text" } ] }'{ "data": { "databaseId": "string", "itemId": "string", "label": "string", "fieldCount": 0, "recordCount": 0, "skippedRowCount": 0, "sheetNameUsed": "string" }}{ "_tag": "ApiNotFound", "error": "not_found", "message": "That item does not exist, or this key cannot see it.", "status": 404}{ "_tag": "ApiNotFound", "error": "not_found", "message": "That item does not exist, or this key cannot see it.", "status": 404}Preview the rows a data source config would return
Fetches the source described by the request without persisting anything and returns a sample of rows with inferred columns, the JSON path or sheet that was used, and a warning when the source is empty. Requires `data_sources:write` rather than read, because a preview exercises stored connection secrets against a caller-supplied URL; HTTP sources are restricted to public addresses, and fetch failures come back as validation errors with secret values redacted. Sample size is capped at 50 rows (default 20).
Get a data source
Returns one data source with its configuration, schedule, latest status, and target database. Requires `data_sources:read` and view access to the data source's workspace item. Returns a not-found error when the workspace has no data source with that id.