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

# Convert JSON to GraphQL Schema API

Convert raw JSON, uploaded files, or JSON URLs into GraphQL SDL. Returns inline text, a .graphql download, or a pre-signed S3 URL.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/apyhub/convert-json-to-graphql-sdl/json-file-graphql-url` | What it does Converts an uploaded JSON file into GraphQL SDL and returns a pre-signed S3 URL for th… | 50 |
| POST | `https://api.eu.apyhub.com/apyhub/convert-json-to-graphql-sdl/json-raw-graphql-raw` | What it does Converts a raw JSON object in the request body into GraphQL SDL and returns the SDL as… | 50 |
| POST | `https://api.eu.apyhub.com/apyhub/convert-json-to-graphql-sdl/json-raw-graphql-url` | What it does Converts a raw JSON object sent in the request body into GraphQL SDL, then returns a p… | 50 |
| POST | `https://api.eu.apyhub.com/apyhub/convert-json-to-graphql-sdl/json-url-graphql-file` | What it does Converts the JSON document available at a public URL into a GraphQL SDL file for downl… | 50 |
| POST | `https://api.eu.apyhub.com/apyhub/convert-json-to-graphql-sdl/json-raw-graphql-file` | What it does Converts a raw JSON object in the request body into a downloadable GraphQL SDL file. T… | 50 |
| POST | `https://api.eu.apyhub.com/apyhub/convert-json-to-graphql-sdl/json-url-graphql-raw` | What it does Converts the JSON document available at a public URL into GraphQL SDL and returns the… | 50 |
| POST | `https://api.eu.apyhub.com/apyhub/convert-json-to-graphql-sdl/json-url-graphql-url` | What it does Converts the JSON file available at the provided URL into GraphQL SDL, then returns a… | 50 |
| POST | `https://api.eu.apyhub.com/apyhub/convert-json-to-graphql-sdl/json-file-graphql-raw` | What it does Uploads a JSON file and returns GraphQL SDL as the response. The input must be a JSON… | 50 |
| POST | `https://api.eu.apyhub.com/apyhub/convert-json-to-graphql-sdl/json-file-graphql-file` | What it does Converts an uploaded JSON file into a downloadable GraphQL SDL file. The request uploa… | 50 |

## Endpoint reference

### Convert uploaded JSON file to GraphQL SDL (S3 signed URL)

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

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `file` | body | string (binary) | yes | JSON file to convert. Must have MIME type application/json and contain a non-empty JSON object. |
| `output` | query | string | no | Default: `sample-output`. Example: `my-schema`. |

#### Quickstart

Upload a JSON file to convert it into GraphQL SDL.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/convert-json-to-graphql-sdl/json-file-graphql-url?output=my-schema" \
  -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 to the converted file.

```json
{
  "data": "https://example-bucket.s3.amazonaws.com/converted-file"
}
```

### Convert raw JSON body to GraphQL SDL (inline response)

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

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `body` | body | object | yes | A non-empty JSON object (not an array) to convert to GraphQL SDL. |

#### Quickstart

Convert a JSON object to GraphQL SDL by sending the object in the request body.

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

#### What you'll get back

Returns a JSON string containing the generated GraphQL SDL.

```json
"type User {\n  id: Int\n  name: String\n}\n\ntype Query {\n  user: User\n}"
```

### Convert raw JSON body to GraphQL SDL (S3 signed URL)

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

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `body` | body | object | yes | A non-empty JSON object (not an array) to convert to GraphQL SDL. |
| `output` | query | string | no | Default: `sample-output`. Example: `my-schema`. |

#### Quickstart

Convert a JSON object to GraphQL SDL and return a pre-signed download URL.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/convert-json-to-graphql-sdl/json-raw-graphql-url?output=my-schema" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"my-schema","version":1}'
```

#### What you'll get back

Returns a JSON object with a `data` string — a pre-signed S3 URI for the converted file.

```json
{
  "data": "https://s3.amazonaws.com/..."
}
```

### Convert JSON from URL to GraphQL SDL (downloadable file)

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

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `url` | body | string (uri) | yes | Public URL pointing to a JSON file. The response must have a content-type
that includes application/json, text/plain, application/octet-stream,
or binary/octet-stream; or a content-disposition header… |
| `output` | query | string | no | Default: `sample-output`. Example: `my-schema`. |

#### Quickstart

Convert a public JSON file URL into a downloadable GraphQL SDL file.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/convert-json-to-graphql-sdl/json-url-graphql-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 a downloadable GraphQL SDL file as binary data (`.graphql`).

```text
(binary file)
```

### Convert raw JSON body to GraphQL SDL (downloadable file)

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

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `body` | body | object | yes | A non-empty JSON object (not an array) to convert to GraphQL SDL. |
| `output` | query | string | no | Default: `sample-output`. Example: `my-schema`. |

#### Quickstart

Convert a JSON object into a GraphQL SDL file.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/convert-json-to-graphql-sdl/json-raw-graphql-file" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"sampleField":"sample-value"}'
```

#### What you'll get back

Returns a downloadable GraphQL SDL file (`.graphql`) as binary content.

```text
(binary file)
```

### Convert JSON from URL to GraphQL SDL (inline response)

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

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `url` | body | string (uri) | yes | Public URL pointing to a JSON file. The response must have a content-type
that includes application/json, text/plain, application/octet-stream,
or binary/octet-stream; or a content-disposition header… |

#### Quickstart

Convert a JSON file at a public URL into GraphQL SDL with a single request.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/convert-json-to-graphql-sdl/json-url-graphql-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 JSON string containing the generated GraphQL SDL.

```json
"type Query {\n  ...\n}"
```

### Convert JSON from URL to GraphQL SDL (S3 signed URL)

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

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `url` | body | string (uri) | yes | Public URL pointing to a JSON file. The response must have a content-type
that includes application/json, text/plain, application/octet-stream,
or binary/octet-stream; or a content-disposition header… |
| `output` | query | string | no | Default: `sample-output`. Example: `my-schema`. |

#### Quickstart

Convert a JSON file at a public URL into GraphQL SDL by sending the file URL in the request body.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/convert-json-to-graphql-sdl/json-url-graphql-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 file.

```json
{
  "data": "https://..."
}
```

### Convert uploaded JSON file to GraphQL SDL (inline response)

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

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `file` | body | string (binary) | yes | JSON file to convert. Must have MIME type application/json and contain a non-empty JSON object. |

#### Quickstart

Upload a JSON file to convert it into GraphQL SDL.

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

#### What you'll get back

Returns a plain string containing the generated GraphQL SDL.

```text
type Query {
  ...
}
```

### Convert uploaded JSON file to GraphQL SDL (downloadable file)

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

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `file` | body | string (binary) | yes | JSON file to convert. Must have MIME type application/json and contain a non-empty JSON object. |
| `output` | query | string | no | Default: `sample-output`. Example: `my-schema`. |

#### Quickstart

Upload a JSON file to convert it into a GraphQL SDL file.

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

#### What you'll get back

Returns a downloadable GraphQL SDL file (`.graphql`) as binary content.

```text
(binary file)
```

## About

## What it does
Convert JSON into GraphQL SDL with the JSON to GraphQL SDL service. Send a non-empty JSON object, or point it at a public JSON URL or uploaded JSON file, and get GraphQL schema definition language back as inline text, a downloadable `.graphql` file, or a pre-signed S3 URL.

Use the raw-body endpoints when you already have JSON in your request payload. Use the file-upload endpoints when your JSON lives in a file, and the URL endpoints when the source is hosted elsewhere. The file-based routes require a JSON file with MIME type `application/json`, while the URL-based routes accept a public URL that serves JSON-compatible content or a `.json` path.

The response format depends on the route you choose: inline endpoints return the generated SDL as a string, downloadable-file endpoints return binary GraphQL SDL, and S3-url endpoints return an object with a `data` field containing a pre-signed URI.

This is useful when you need to turn API payloads, sample responses, or data exports into a GraphQL schema draft for documentation, prototyping, or schema-first development.

## 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-graphql-sdl
