POST /api/kiwi/import, the REST API lets tools and agents explore a source first, preview the exact pages an import would write, and keep a source in sync. The web UI import wizard in the Data sources panel is built on these endpoints.
A typical flow:
1
Browse
List the tables or collections in the source.
2
Infer fields
Sample records and get suggested field names and types.
3
Preview
See the paths and frontmatter for a few records without writing anything.
4
Import
Run
POST /api/kiwi/import. Live sources are saved as connections and auto-synced.Browse tables and collections
POST /api/kiwi/import/browse lists the tables or collections in a postgres, mysql, mongodb, or firestore source.
Terminal
Response
Preview pages
POST /api/kiwi/import/preview reads a few records and returns the path, frontmatter, and the start of the body for each one, without writing pages. It takes the same body as POST /api/kiwi/import, including path for markdown and obsidian and query for SQL sources.
Terminal
Response
limit defaults to 5 and is capped at 20.
Infer fields
POST /api/kiwi/import/infer-fields samples up to 100 records and suggests a type for each field. It takes the same body as preview.
Response
field_mappings on preview or import to rename, retype, or skip fields. Each mapping has source, target, type (string, number, boolean, or date), and skip. When you send any mappings, fields you leave out are dropped.
Saved connections
KiwiFS saves connection metadata in.kiwi/state/imports.json so you can re-run an import or keep it in sync. A successful POST /api/kiwi/import saves or updates a connection automatically, matched by source and prefix.
Re-running a connection takes the secrets again in the body, because KiwiFS never stores the
credentials or api_key fields:
Terminal
Auto-sync
Live sources can re-import on a schedule:postgres, mysql, mongodb, firestore, notion, airtable, and the Airbyte source firebase-rtdb.
When you import one of these sources over REST, KiwiFS saves the connection with auto-sync on and an interval of 1h. A background scheduler checks for due connections every 30 seconds.
Terminal
interval is a Go duration such as 5m, 1h, or 24h. Send {"enabled": false} to pause. Each connection reports a sync_status of idle, running, or error, with details in sync_error.
Scheduled runs don’t receive request secrets. They work when the connection string carries its own credentials, or when the server has them from its environment, such as NOTION_API_KEY, AIRTABLE_API_KEY, or Google Application Default Credentials.
Archived records
Scheduled syncs and REST imports of live sources without alimit run as a full sync. Pages from the same source that no longer appear in the latest run get an _archived_at timestamp in their frontmatter instead of being deleted. If the record comes back, the next import rewrites the page without the marker.
Response
Ingest documents
POST /api/kiwi/ingest converts a PDF, Word, PowerPoint, Excel, HTML, EPUB, or image file into markdown pages with MarkItDown. Use it for documents. Use import for structured records.
Terminal
Response
kiwi_ingest MCP tool.
Ingest runs the
markitdown command, which isn’t in the KiwiFS Docker image. Install it on the server with pip install 'markitdown[all]'.Related
Import API
Full request and response reference.
Web UI
The Data sources panel and import wizard.