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

# JSON Tools: Parse, Query and Transform JSON

> Parse JSON strings, query values with JSONPath, and merge, flatten or reshape objects inside your workflows, with no code step needed.

The JSON Tools connector provides operations for parsing, querying with JSONPath, and transforming JSON data within your workflows.

> [!NOTE]
>
> No connection required; this utility connector works out of the box.

## Tools

> [accordion] parse: Parse a JSON string
>
> Parse a JSON string into a structured object.
>
> **json** `string` *required*
>
> JSON string to parse.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "json": "{\"name\":\"Alice\",\"age\":30,\"active\":true}"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "name": "Alice",
>   "age": 30,
>   "active": true
> }
> ```

> [accordion] stringify: Convert to JSON string
>
> Serialize data to a JSON string.
>
> **data** `any` *required*
>
> Data to serialize.
>
> **pretty** `boolean` (default: true)
>
> Pretty-print with indentation.
>
> **indent** `number` (default: 2)
>
> Number of indentation spaces.
>
> **encoding** `enum` (default: utf8)
>
> Output encoding for the `result` field: `utf8` (default) or `base64` (for email attachments, SFTP uploads, or knowledge-base embedding). The response includes an `encoding` tag.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "data": { "name": "Alice", "roles": ["admin", "user"] },
>   "pretty": false
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> "{\"name\":\"Alice\",\"roles\":[\"admin\",\"user\"]}"
> ```

> [accordion] query: Query with JSONPath
>
> Extract data using JSONPath expressions.
>
> **data** `any` *required*
>
> JSON data to query.
>
> **path** `string` *required*
>
> JSONPath expression (e.g., `$.store.book[*].author`).
>
> **Example request:**
>
> ```json theme={null}
> {
>   "data": {
>     "store": {
>       "books": [
>         { "title": "Dune", "price": 12.99 },
>         { "title": "Neuromancer", "price": 9.99 },
>         { "title": "Foundation", "price": 14.99 }
>       ]
>     }
>   },
>   "path": "$.store.books[?(@.price<13)]"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> [
>   { "title": "Dune", "price": 12.99 },
>   { "title": "Neuromancer", "price": 9.99 }
> ]
> ```

> [accordion] flatten: Flatten nested JSON
>
> Convert nested objects to flat dot-notation keys.
>
> **data** `any` *required*
>
> JSON data to flatten.
>
> **delimiter** `string` (default: .)
>
> Key separator.
>
> **safe** `boolean` (default: false)
>
> Preserve arrays instead of flattening them.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "data": {
>     "user": {
>       "name": "Alice",
>       "address": { "city": "Portland", "zip": "97201" }
>     }
>   }
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "user.name": "Alice",
>   "user.address.city": "Portland",
>   "user.address.zip": "97201"
> }
> ```

> [accordion] unflatten: Unflatten dot notation
>
> Convert flat dot-notation keys back to nested objects.
>
> **data** `any` *required*
>
> Flattened data.
>
> **delimiter** `string` (default: .)
>
> Key separator.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "data": {
>     "user.name": "Alice",
>     "user.address.city": "Portland",
>     "user.address.zip": "97201"
>   }
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "user": {
>     "name": "Alice",
>     "address": { "city": "Portland", "zip": "97201" }
>   }
> }
> ```

> [accordion] merge: Deep merge objects
>
> Deep merge multiple objects together.
>
> **objects** `any[]` *required*
>
> Array of objects to merge.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "objects": [
>     { "theme": "dark", "lang": "en", "notifications": { "email": true } },
>     { "lang": "fr", "notifications": { "sms": true } }
>   ]
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "theme": "dark",
>   "lang": "fr",
>   "notifications": {
>     "email": true,
>     "sms": true
>   }
> }
> ```

> [accordion] diff: Compare two objects
>
> Find differences between two JSON objects.
>
> **obj1** `any` *required*
>
> First object.
>
> **obj2** `any` *required*
>
> Second object.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "obj1": { "name": "Alice", "age": 30, "city": "Portland" },
>   "obj2": { "name": "Alice", "age": 31, "role": "admin" }
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> [
>   { "path": "age", "type": "changed", "oldValue": 30, "newValue": 31 },
>   { "path": "city", "type": "removed", "oldValue": "Portland" },
>   { "path": "role", "type": "added", "newValue": "admin" }
> ]
> ```

> [accordion] pick: Pick specific keys
>
> Extract selected keys from an object.
>
> **data** `any` *required*
>
> Source object.
>
> **keys** `string[]` *required*
>
> Keys to pick.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "data": { "id": 1, "name": "Alice", "email": "alice@example.com", "password": "hashed_pw" },
>   "keys": ["id", "name", "email"]
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "id": 1,
>   "name": "Alice",
>   "email": "alice@example.com"
> }
> ```

> [accordion] omit: Remove specific keys
>
> Remove selected keys from an object.
>
> **data** `any` *required*
>
> Source object.
>
> **keys** `string[]` *required*
>
> Keys to remove.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "data": { "id": 1, "name": "Alice", "email": "alice@example.com", "password": "hashed_pw" },
>   "keys": ["password"]
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "id": 1,
>   "name": "Alice",
>   "email": "alice@example.com"
> }
> ```

> [accordion] get: Get value at path
>
> Retrieve a value using dot-notation path.
>
> **data** `any` *required*
>
> Source object.
>
> **path** `string` *required*
>
> Dot-notation path (e.g., `user.address.city`).
>
> **defaultValue** `any`
>
> Default value if path not found.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "data": {
>     "user": {
>       "address": { "city": "Portland", "state": "OR" }
>     }
>   },
>   "path": "user.address.city"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> "Portland"
> ```

> [accordion] set: Set value at path
>
> Set a value at a dot-notation path.
>
> **data** `any` *required*
>
> Source object.
>
> **path** `string` *required*
>
> Dot-notation path.
>
> **value** `any` *required*
>
> Value to set.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "data": { "user": { "name": "Alice" } },
>   "path": "user.address.city",
>   "value": "Portland"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "user": {
>     "name": "Alice",
>     "address": { "city": "Portland" }
>   }
> }
> ```

> [accordion] minify: Minify JSON
>
> Remove all whitespace from a JSON string.
>
> **json** `string` *required*
>
> JSON string to minify.
>
> **encoding** `enum` (default: utf8)
>
> Output encoding for the `result` field: `utf8` (default) or `base64` (for email attachments, SFTP uploads, or knowledge-base embedding). The response includes an `encoding` tag.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "json": "{\n  \"name\": \"Alice\",\n  \"age\": 30\n}"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> "{\"name\":\"Alice\",\"age\":30}"
> ```

> [accordion] prettify: Prettify JSON
>
> Format a JSON string with indentation.
>
> **json** `string` *required*
>
> JSON string to format.
>
> **indent** `number` (default: 2)
>
> Number of indentation spaces.
>
> **encoding** `enum` (default: utf8)
>
> Output encoding for the `result` field: `utf8` (default) or `base64` (for email attachments, SFTP uploads, or knowledge-base embedding). The response includes an `encoding` tag.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "json": "{\"name\":\"Alice\",\"age\":30}",
>   "indent": 4
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> "{\n    \"name\": \"Alice\",\n    \"age\": 30\n}"
> ```

> [accordion] keys: Get all keys
>
> Extract all keys from an object.
>
> **data** `any` *required*
>
> Source object.
>
> **deep** `boolean` (default: false)
>
> Include nested keys with dot-notation.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "data": {
>     "name": "Alice",
>     "address": { "city": "Portland", "zip": "97201" }
>   },
>   "deep": true
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> ["name", "address.city", "address.zip"]
> ```

> [accordion] values: Get all values
>
> Extract all values from an object.
>
> **data** `any` *required*
>
> Source object.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "data": { "name": "Alice", "age": 30, "active": true }
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> ["Alice", 30, true]
> ```

> [accordion] validate: Validate JSON string
>
> Check if a string is valid JSON.
>
> **json** `string` *required*
>
> String to validate.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "json": "{name: 'Alice'}"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "valid": false,
>   "error": "Expected property name or '}' at position 1"
> }
> ```

> [card] [Try this free for 14 days](https://preview.condotta.ai/signup)
>
> Start a 14-day trial on Band 1. At day 14, choose your band, or stop.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.