{"uid":"cap_Z7S4Brdtl8T5yQtW4gNPm","slug":"data-toolkit-flatten-f45678a8","name":"Data Toolkit – Flatten","description":"Flatten a nested object/array into a single-level object whose keys are the delimited paths to each leaf (default delimiter `.`). Requires an object or array.","url":"https://data.openverbs.com/v1/flatten","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["data"],"properties":{"data":{"description":"The nested object or array to flatten."},"delimiter":{"type":"string","maxLength":8,"minLength":1,"description":"Path delimiter. Default `.`."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.004","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.004/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_loSfrLLAEfxBdMxnUTTIF","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Flattens a nested JSON object or array into a single-level key-value structure using a configurable path delimiter","exampleAgentPrompt":"Can you flatten this nested JSON object for me using a dot as the delimiter? The data is: {\"user\":{\"name\":\"Alice\",\"address\":{\"city\":\"New York\",\"zip\":\"10001\"}},\"score\":42}","exampleUseCases":[{"title":"Normalize API response for database storage","prompt":"I'm getting a deeply nested JSON response from a third-party API and need it flattened with dot-notation keys before I insert it into my flat SQL table — can you flatten this object: {\"order\":{\"id\":\"123\",\"customer\":{\"name\":\"Bob\",\"email\":\"bob@example.com\"},\"total\":99.99}}?"},{"title":"Prepare config file for environment variables","prompt":"I have a nested config object and need to flatten it using underscores as the delimiter so I can convert each key to an environment variable — here's the config: {\"app\":{\"db\":{\"host\":\"localhost\",\"port\":5432},\"debug\":true}}."},{"title":"Flatten survey response data for CSV export","prompt":"I collected survey responses as nested JSON and need them flattened to a single level so I can dump them into a spreadsheet — can you flatten this: {\"respondent\":{\"age\":34,\"location\":{\"country\":\"US\",\"state\":\"CA\"}},\"answers\":{\"q1\":\"yes\",\"q2\":\"no\"}}?"}],"resultDescription":"A flattened single-level JSON object where each key represents the full dot-delimited (or custom-delimited) path from the original nested structure to the leaf value, and each value is the corresponding scalar value from the input data.","failureModes":["Missing required 'data' field in body returns a validation error","Input data that is not an object or array may produce unexpected output","Custom delimiter longer than 8 characters is rejected by schema validation","Circular references in input objects may cause processing errors or timeouts","Empty objects or arrays may return an empty flattened result"],"whenToPreferThis":"Choose this endpoint when you need a simple, reliable, pay-per-call flattening of a nested JSON object or array without managing infrastructure. Ideal for ETL pipelines, data normalization before database ingestion, or preprocessing API responses for flat data stores. Prefer this over writing custom flattening code when you need a quick, deterministic transformation with a configurable delimiter in an automated agent workflow.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:42:15.173Z","isFirstParty":false}