# JSON flatten

Flatten nested JSON into one level of dotted keys such as "user.address.city".

- Endpoint: `POST https://setget.net/v1/tools/json-flatten` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `json-flatten`
- Page: https://setget.net/tools/json-flatten

## Inputs

- `text` (required, string): The JSON to flatten.
- `separator` (optional, string, default `"."`): Text placed between key parts.
- `indent` (optional, integer, default `2`, range 0..8): Spaces per level. 0 gives one compact line.

## Example

```json
{"input":{"text":"{\"user\":{\"name\":\"Sam\",\"tags\":[\"a\",\"b\"]}}","indent":0}}
```

Result:

```json
{"text":"{\"user.name\":\"Sam\",\"user.tags.0\":\"a\",\"user.tags.1\":\"b\"}","keys":3}
```
