---
title: "JSON to YAML"
method: POST
path: "/api/v1/tools/json-to-yaml"
tags: ["tools"]
---

# JSON to YAML

`POST /api/v1/tools/json-to-yaml`

## Request

- Base URL: `https://toolforte.com`
- URL: `https://toolforte.com/api/v1/tools/json-to-yaml`
- Auth: HTTP bearer

Convert a JSON string to YAML text. Strings are quoted only when a YAML reader would otherwise see a number, boolean, date or empty value, multi-line strings become block scalars, and keys can be sorted.

## Request body

- object
  - `json` string
  - `indent` integer
  - `sortKeys` boolean
  - `nullStyle` string

## Response `200`

Successful result

- object
  - `ok` boolean
  - `data` object
    - `yaml` string

## Other responses

- `400`: Missing or invalid request fields
- `401`: Invalid or missing API key
- `429`: Monthly plan limit reached

---

[API](https://skmtc.dev/toolforte/apis/toolforte-api.md) · [All operations](https://skmtc.dev/toolforte/apis/toolforte-api/llms.txt) · [OpenAPI document](https://skmtc.dev/toolforte/apis/toolforte-api/revisions/4d814d484dfc?raw)
