> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bondata.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# JSON

> Upload and sync data from JSON and JSON Lines files directly into BonData

JSON is the universal format for structured and semi-structured data, produced by virtually every API and application. With BonData, you can upload a JSON file - or paste JSON directly - to create data entities that integrate seamlessly with your Agent workflows, no external system required.

## Uploading a File

BonData reads your JSON, flattens nested structure into columns, and creates an entity you can use in playbooks.

### Step 1: Add the Data Source

1. Navigate to **Integrations** and click **Add Data Source**
2. Select **JSON** as the source type

### Step 2: Provide Your JSON

1. Drag and drop a `.json` or `.jsonl` file, click to browse, or paste JSON directly into the editor
2. BonData parses the content and detects the record structure:
   * An **array of objects** - each object becomes a row
   * **JSON Lines** (`.jsonl`) - each line is parsed as one record
   * A **single object** - imported as one record

### Step 3: Review and Confirm

1. Review the flattened columns and adjust data types if needed
2. Name your entity for easy reference
3. Confirm to create the entity

<Note>
  Nested objects are flattened into dot-notation columns (for example, `address.city`), and arrays of records are expanded into rows so the data lands in a clean tabular shape.
</Note>

## Primary Key Detection

BonData automatically detects a primary key by finding a field whose value is unique and present across every record. If no single field is unique, BonData supports composite keys - a combination of fields that together uniquely identify each record. You can override the detected key before confirming.

## Required Fields

| Field       | Description                                                                                       |
| ----------- | ------------------------------------------------------------------------------------------------- |
| File        | The `.json` or `.jsonl` file to upload, or pasted JSON content                                    |
| Primary Key | Unique field (or composite of fields) identifying each record - auto-detected, override if needed |

## Available Data

* **Records** - Each object (or JSON Lines row) becomes a record in the entity
* **Flattened fields** - Nested objects flattened into columns, arrays of records expanded into rows

<Tip>
  Supported formats: standard **JSON** and **JSON Lines** (`.jsonl`). To refresh the data, re-upload an updated file - BonData re-parses it and applies changes by primary key.
</Tip>
