Flatten JSON
data.flatten_json
Overview
When you send a nested JSON object, we return a deterministic list of path/value/type entries using dot, JSON Pointer, or bracket notation. You choose how arrays are indexed, serialized, or skipped. Reversible with data.unflatten_json for compatible settings. Do not use this for documents that exceed depth or transport size limits. Accepts file input via file_ref — no need to extract file content first.
Agents flatten JSON inconsistently. You get the same path list every time for the same object and options.
Reliability
VERIFIABLE and deterministic for the same input and options. Provide exactly one of json or file_ref. Validation errors (not retryable — fix input): missing or non-object json; both json and file_ref supplied; maxDepth exceeded during traversal. Pair with data.unflatten_json using the same pathStyle for round-trips.
Context footprint
Returns paths, pathCount, maxDepthObserved, and warnings. A successful call costs 1 execution credit.
When to use it
Before diffing, mapping, or tabular conversion of JSON you already have.
When the document exceeds configured depth or transport size limits.
Scope
Non-goals
- Does not fetch remote JSON
- Does not transform or coerce values
- Does not validate against an external schema
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
File limits
Constraints this skill applies to your input and generated files. The “Limited by” column shows the static source of each cap; none of these can be raised by upgrading your plan.
| Limit | Value | Limited by |
|---|---|---|
| Maximum size per input file | 2 MiB | Skill maximum |
How we handle your data
What this means
This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response may contain submitted or transformed content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| json | object | No | Purpose-bound nested JSON object whose additional properties are the document members to flatten; omit it when file_ref is the source. Values are unconstrained RFC 8259 JSON items. |
| file_ref | string | No | Tenant-scoped uploaded JSON reference. Omit it to use the required inline json; never send both. |
| pathStyle | string | No | Path notation; omit it for dot. |
| arrayMode | string | No | How arrays are emitted; omit it for index. |
| includeNulls | boolean | No | Whether null leaves are kept; omit it for true. |
| maxDepth | integer | No | Walk depth ceiling; omit it for 64. |
| sortPaths | boolean | No | Whether paths are sorted lexicographically; omit it for true. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| paths | array | Yes | Bounded array of flattened path/value/type entries in the chosen order. |
| pathCount | integer | Yes | How many path entries were returned. |
| maxDepthObserved | integer | Yes | Deepest nesting level seen in the input. |
| warnings | array | Yes | Bounded array of 0 through 64 flatten warnings with code, message, and severity. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"data.flatten_json","input":{"json":{"customer":{"name":"Alice"}}}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("data.flatten_json", {"json":{"customer":{"name":"Alice"}}});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not fetch remote JSON
- Does not transform or coerce values
- Does not validate against an external schema
- Extremely deep or oversized documents beyond limits
- When you need in-place mutation of the original object
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "data.flatten_json",
"input": {
"json": {
"customer": {
"name": "Alice"
}
}
}
}Examples
Nested customer name with dot paths
{
"json": {
"customer": {
"name": "Alice"
}
}
}{
"paths": [
{
"path": "customer.name",
"type": "string",
"value": "Alice"
}
],
"maxDepthObserved": 2,
"warnings": [],
"pathCount": 1
}String array with bracket path style
{
"json": {
"tags": [
"x",
"y"
]
},
"pathStyle": "bracket"
}{
"paths": [
{
"path": "tags[0]",
"type": "string",
"value": "x"
},
{
"path": "tags[1]",
"type": "string",
"value": "y"
}
],
"maxDepthObserved": 2,
"warnings": [],
"pathCount": 2
}Recommended use cases
- Prepare JSON for diffing or CSV conversion
- Map nested fields to columns
- Inspect structure before transformation
Avoid for
- Extremely deep or oversized documents beyond limits
- When you need in-place mutation of the original object
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.