Free plan

Config convert

Convert a settings file from one format to another
POST
/v1/data/config

About this tool

Settings files hold the options an app or website runs on, and they come in several styles (JSON, YAML, TOML, INI, .env and Java .properties). This tool rewrites one into another style. You can also lay a second file over the first so its values win, fill in ${NAME} placeholders, hide passwords and tokens, sort the keys or write only one group of settings.
For example, you have a YAML settings file but your app needs JSON, so you convert it and hide the password at the same time.

How to use it

  1. Choose this tool.
  2. Add your settings file with Upload or drag and drop. You can add a second file to lay over the first.
  3. Choose the format you want to write. The format of your file is usually recognised on its own.
  4. Switch on the extras you need, such as hiding secrets or sorting the keys, then press Generate.
  5. Download the converted file.

What you get back

You get a new settings file in the format you chose. Download it and use it in place of the old one.
GOOD TO KNOW
TOML has no null: empty values are left out and a note says so. INI sections nest with dots. Comments are not kept. Counts as one conversion per file.
TEST IT LIVE

Try Config convert in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Data
Plan
Free
Method
POST
Endpoint
/v1/data/config
Tool ID
data.config
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Data
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/data/config" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'file=@document.pdf' \
  -F 'from=auto' \
  -F 'to=yaml' \
  -F 'section=db'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.data.config({
    "file": 'document.pdf',
    "from": "auto",
    "to": "yaml",
    "section": "db"
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->data()->config([
    'file' => 'document.pdf',
    'from' => 'auto',
    'to' => 'yaml',
    'section' => 'db',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Convert settings files between JSON, YAML, TOML, INI, .env and Java .properties. Lay a second file over the first, fill in ${NAME} references, hide secrets, nest dotted names or flatten nested ones, and sort the keys.

Config convert works from text and settings, so no file is needed. The required inputs are to.

Config convert is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/data/config with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.