---
title: Convert JSON to XML API
slug: convert-json-to-xml
url: https://apyhub.com/apyhub/service/convert-json-to-xml
provider: ApyHub
categories: [Output Kit]
tags: [json-to-xml, xml-conversion, json-conversion, file-conversion, developer-tools]
auth: api_key
version: 1.0.0
service_type: sync
endpoints: 9
atoms: 50
mcp: true
alias: converter-json-xml
---

# Convert JSON to XML API

Convert raw JSON, uploaded files, or JSON URLs into XML. Returns an XML string, a downloadable .xml file, or a pre-signed S3 link.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-file-xml-raw` | What it does Converts an uploaded JSON file into a raw XML string. The request uploads a JSON file,… | 50 |
| POST | `https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-file-xml-url` | What it does Converts an uploaded JSON file into an XML file and returns a pre-signed S3 URL for th… | 50 |
| POST | `https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-raw-xml-raw` | What it does Converts the raw JSON request body into a raw XML string. The endpoint accepts any non… | 50 |
| POST | `https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-file-xml-file` | What it does Converts an uploaded JSON file into a downloadable XML file. The request uploads the J… | 50 |
| POST | `https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-raw-xml-file` | What it does Converts the raw JSON object sent in the request body into an XML file and returns the… | 50 |
| POST | `https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-raw-xml-url` | What it does Converts the raw JSON request body into an XML file and returns a pre-signed S3 URL wh… | 50 |
| POST | `https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-url-xml-file` | What it does Converts a JSON resource available at a public URL into a downloadable .xml file. The… | 50 |
| POST | `https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-url-xml-raw` | What it does Converts the JSON resource located at the provided URL into a raw XML string. The requ… | 50 |
| POST | `https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-url-xml-url` | What it does Converts the JSON document available at a publicly accessible URL into an XML file and… | 50 |

## Endpoint reference

### Convert uploaded JSON file to raw XML string

`POST https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-file-xml-raw` · 50 atoms · accepts `multipart/form-data` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `file` | body | string (binary) | yes | JSON file to convert (MIME type must be application/json). |

#### Quickstart

Upload a JSON file to convert it into XML.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-file-xml-raw" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/file.json"
```

#### What you'll get back

Returns a plain XML string, not a JSON object. The response body is the XML output directly, such as:

```xml
<root><id>1</id><name>Alice</name></root>
```

### Convert uploaded JSON file to pre-signed S3 URL for .xml file

`POST https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-file-xml-url` · 50 atoms · accepts `multipart/form-data` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `file` | body | string (binary) | yes | JSON file to convert (MIME type must be application/json). |
| `output` | query | string | no | Default: `sample-output`. Example: `my-output`. |

#### Quickstart

Upload a JSON file and get back a pre-signed URL to the converted XML file.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-file-xml-url?output=my-output" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/file.json"
```

#### What you'll get back

Returns a JSON object with a `data` string field containing a pre-signed S3 URL for the converted `.xml` file.

```json
{
  "data": "https://s3.amazonaws.com/bucket/uuid_sample-output.xml?..."
}
```

### Convert raw JSON body to raw XML string

`POST https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-raw-xml-raw` · 50 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `body` | body | object | yes | Any non-empty JSON object. The entire request body is used as-is as the conversion input — there are no fixed or required properties. Do not treat any example property names as required fields; they… |

#### Quickstart

Send any non-empty JSON object to convert it into raw XML.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-raw-xml-raw" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"id":1,"name":"Alice"}'
```

#### What you'll get back

Returns a plain XML string, not a JSON object. The response body is the XML output directly.

```xml
<root><id>1</id><name>Alice</name></root>
```

### Convert uploaded JSON file to downloadable .xml file

`POST https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-file-xml-file` · 50 atoms · accepts `multipart/form-data` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `file` | body | string (binary) | yes | JSON file to convert (MIME type must be application/json). |
| `output` | query | string | no | Default: `sample-output`. Example: `my-output`. |

#### Quickstart

Convert a JSON file to an XML file by uploading the JSON file and naming the output.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-file-xml-file?output=my-output" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/file.json"
```

#### What you'll get back

Returns the raw XML file content as a binary `.xml` response body, not a JSON object. There is no `value` field in the response.

```xml
<...XML file content...>
```

### Convert raw JSON body to downloadable .xml file

`POST https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-raw-xml-file` · 50 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `body` | body | object | yes | Any non-empty JSON object. The entire request body is used as-is as the conversion input — there are no fixed or required properties. Do not treat any example property names as required fields; they… |
| `output` | query | string | no | Default: `sample-output`. Example: `my-output`. |

#### Quickstart

Convert a JSON object to an XML file with one POST request. The `output` query parameter is optional, so this minimal example sends just the JSON body.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-raw-xml-file" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"key1":"value1","key2":123}'
```

#### What you'll get back

Returns the raw XML file content as a binary `.xml` response body, not a JSON object. The schema does not declare any JSON fields.

### Convert raw JSON body to pre-signed S3 URL for .xml file

`POST https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-raw-xml-url` · 50 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `body` | body | object | yes | Any non-empty JSON object. The entire request body is used as-is as the conversion input — there are no fixed or required properties. Do not treat any example property names as required fields; they… |
| `output` | query | string | no | Default: `sample-output`. Example: `my-output`. |

#### Quickstart

Convert a JSON object to XML and get back a pre-signed download URL for the `.xml` file.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-raw-xml-url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"key1":"value1","key2":123}'
```

#### What you'll get back

Returns a JSON object with a single `data` string field containing a pre-signed S3 URI for the converted `.xml` file.

```json
{
  "data": "https://s3.amazonaws.com/bucket/uuid_sample-output.xml?..."
}
```

### Convert JSON at URL to downloadable .xml file

`POST https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-url-xml-file` · 50 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `url` | body | string (uri) | yes | Publicly accessible URL pointing to a JSON resource. Example: `https://assets.apyhub.com/samples/sample.json`. |
| `output` | query | string | no | Default: `sample-output`. Example: `my-output`. |

#### Quickstart

Convert a JSON file from a public URL into an XML file by sending the source URL in the request body.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-url-xml-file" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.json"}'
```

#### What you'll get back

Returns the raw XML file content as a binary `.xml` response body, not a JSON object. No `value` field exists.

### Convert JSON at URL to raw XML string

`POST https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-url-xml-raw` · 50 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `url` | body | string (uri) | yes | Publicly accessible URL pointing to a JSON resource. Example: `https://assets.apyhub.com/samples/sample.json`. |

#### Quickstart

Convert a JSON resource at a public URL into raw XML.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-url-xml-raw" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.json"}'
```

#### What you'll get back

Returns a plain XML string, not a JSON object. The response body is the XML output directly, for example:

```xml
<root><id>1</id><name>Alice</name></root>
```

### Convert JSON at URL to pre-signed S3 URL for .xml file

`POST https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-url-xml-url` · 50 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `url` | body | string (uri) | yes | Publicly accessible URL pointing to a JSON resource. Example: `https://assets.apyhub.com/samples/sample.json`. |
| `output` | query | string | no | Default: `sample-output`. Example: `my-output`. |

#### Quickstart

Convert a JSON file from a public URL into XML by sending the source URL in the request body.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/convert-json-to-xml/json-url-xml-url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.json"}'
```

#### What you'll get back

Returns a JSON object with a `data` string field containing a pre-signed S3 URL to the converted `.xml` file.

```json
{
  "data": "https://s3.amazonaws.com/bucket/uuid_sample-output.xml?..."
}
```

## About

## What it does
JSON to XML Converter turns JSON into XML from three input styles: raw JSON in the request body, a JSON file upload, or a publicly accessible JSON URL. You can receive the result as a raw XML string, a downloadable .xml file, or a pre-signed S3 URL to the converted file.

Use the raw endpoints when you want XML inline in the response. Use the file endpoints when your workflow starts with an uploaded JSON document and you need a binary .xml file back. Use the URL endpoints when the source JSON already lives at a public URL and you want the converter to fetch it for you.

For raw JSON requests, send any non-empty JSON object in the body. For URL-based requests, send a `url` pointing to a publicly accessible JSON resource. For file-based requests, upload a `file` with MIME type `application/json`. Some file and URL endpoints also accept an optional `output` query value that is used to name the generated .xml file or S3 object.

JSON to XML Converter fits backend jobs, integrations, and document pipelines where a system stores JSON but downstream consumers expect XML. It gives you a simple way to transform data without adding conversion logic to your app.

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/apyhub/service/convert-json-to-xml
