Airfold API
How to ingest data using the API
Use the Airfold API to send data directly to your workspace. No intermediary database, storage, or batching layer required!
Create a Source
Before you can send data to your workspace, you first need to create a Source and define its schema. Follow the instructions in the Sources section to create a Source using either the UI or CLI.
Ingest
Now that you have your Source, you can ingest data into it with a few lines of code.
Replace source_name
and api_key
with your actual Source name and API key. Define the data to ingest using the data variable:
Sources can ingest data in JSON format easily! Check out the page on JSON mapping to see how you can configure your Source schema to be able to ingest nested JSON.
Here are some examples in practice:
Get Data Schema
You may also get the data source schema with the following API call: