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

# JSON to XML

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

## Request

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

Serialise a JSON string as XML. Object keys become element names, array items repeat the parent key, null and empty objects become self-closing tags, and the root element name is yours to choose. A top-level array is wrapped in the root with one item element per entry.

## Request body

- object
  - `json` string
  - `rootName` string
  - `declaration` boolean

## Response `200`

Successful result

- object
  - `ok` boolean
  - `data` object
    - `xml` 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)
