{"uid":"cap_ovpFfp7Y-NhxWoQ30E-ne","slug":"agent402-tools-json-flatten-unflatten-99f5db0d","name":"agent402.tools JSON Flatten/Unflatten","description":"Flatten nested JSON to dot-path keys, or unflatten dot-path keys back to nested JSON. mode: flatten (default) | unflatten.","url":"https://agent402.tools/api/json-flatten?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"json":{"description":"JSON value"},"mode":{"type":"string","description":"flatten | unflatten"}}},"responseSchema":{"type":"json","example":{"result":{"a.b":1}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm__FlMjGk6ooe6GWO_WfqFM","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Flattens nested JSON objects to dot-path key-value pairs, or unflattens dot-path keys back into nested JSON structures.","exampleAgentPrompt":"Flatten this nested JSON into dot-path keys: {\"user\":{\"name\":\"Alice\",\"address\":{\"city\":\"NYC\",\"zip\":\"10001\"}}} — use flatten mode.","exampleUseCases":null,"resultDescription":"Returns a JSON object where all nested keys have been collapsed into dot-notation flat keys (e.g. 'user.address.city': 'NYC') when flattening, or a fully nested JSON object reconstructed from dot-path keys when unflattening.","failureModes":["Invalid or malformed JSON input returns an error","Missing required 'json' field returns a validation error","Invalid mode value (not 'flatten' or 'unflatten') may return an error or default to flatten","Circular references in JSON may cause errors","Payment failure returns 402 status"],"whenToPreferThis":"Choose this endpoint when you need to programmatically flatten deeply nested JSON structures into flat dot-path dictionaries for easier iteration, storage, or diffing — or when you need to reconstruct nested JSON from dot-path keys. Ideal for config file normalization, data pipeline preprocessing, or debugging complex nested API responses.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-28T19:26:26.073Z","isFirstParty":false,"canonicalSlug":"agent402-tools-json-flatten-unflatten-99f5db0d"}