TOML to JSON Converter API
Convert TOML to JSON or JSON to TOML (TOML 1.0). TOML dates become ISO 8601 strings in JSON; notes explain anything that can't be represented exactly.
POST /api/v1/tools/toml-json-converterMCP toml_json_converterData & ConversionConvert TOML to JSON and JSON to TOML in your browser. Shows the line and column of syntax errors, keeps dates as ISO strings and explains what TOML cannot hold.
Input
Send these as a JSON object. Unknown fields are rejected.
- input
- The TOML or JSON text. (string, required)
- to
- Target format. (string, one of json, toml, required)
- indent
- Spaces per indent level for JSON output (0 for a single line). (integer, 0 to 8, default 2)
- convertDates
- When converting to TOML, turn ISO 8601 date strings into TOML dates. (boolean, default false)
curl https://pithlab.com/api/v1/tools/toml-json-converter \n -H "Authorization: Bearer $PITHLAB_KEY" \n -H "Content-Type: application/json" \n -d '{"input":"[server]\nhost = \"0.0.0.0\"\nport = 8080\n\n[database]\nurl = \"postgres://localhost/app\"\npool = 5","to":"json"}'Example response
{
"ok": true,
"result": {
"output": "{\"server\":{\"host\":\"0.0.0.0\",\"port\":8080},\"database\":{\"url\":\"postgres://localhost/app\",\"pool\":5}}",
"notes": []
}
}