> ## Documentation Index
> Fetch the complete documentation index at: https://docs.presenton.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Presentation From JSON

> Create a presentation directly from JSON by selecting a template layout and providing content.

In this guide, you'll create a presentation directly from JSON by choosing a template, picking slide layouts, and supplying content that matches each layout's schema.

## What you'll do

* List available templates
* Inspect a template to see its slide layouts and JSON schema
* Create a presentation from your own JSON
* Download the exported file or open it in the editor

***

## Step 1: List templates

Use this to find built‑in and custom templates you can use.

```http theme={null}
GET /api/v3/standard-template/all
```

<Info>
  API reference: [Get all templates](/api-reference/v3-standard-template/get-all-standard-templates)
</Info>

<CodeGroup>
  ```bash cURL theme={null}
  curl -s https://api.presenton.ai/api/v3/standard-template/all \
    -H "Authorization: Bearer sk-presenton-xxxxx"
  ```
</CodeGroup>

Example response:

```json theme={null}
[
  { "id": "general",  "name": "Default" },
  { "id": "modern",   "name": "Default" },
  { "id": "standard", "name": "Default" },
  { "id": "swift",    "name": "Default" },
  { "id": "custom-20f600db-e55d-4f14-b373-5c43c1668170", "name": "Template with flower" },
  { "id": "custom-88ac23b3-3e1f-4bb0-af7a-860350ab645f", "name": "One Slide Template" }
]
```

***

## Step 2: Inspect a template (layouts + schema)

Fetch a specific template to see its available slides and the JSON schema for each layout.

```http theme={null}
GET /api/v3/standard-template/{template_id}
```

<Info>
  API reference: [Get template by ID](/api-reference/v3-standard-template/get-standard-template-by-id)
</Info>

<CodeGroup>
  ```bash cURL theme={null}
  curl -s https://api.presenton.ai/api/v3/standard-template/custom-20f600db-e55d-4f14-b373-5c43c1668170 \
    -H "Authorization: Bearer sk-presenton-xxxxx"
  ```
</CodeGroup>

Example response (truncated):

```json theme={null}
{
  "name": "custom-20f600db-e55d-4f14-b373-5c43c1668170",
  "ordered": false,
  "slides": [
    {
      "id": "custom-20f600db-e55d-4f14-b373-5c43c1668170:header-subtitle-decorative-illustration-slide",
      "name": "dynamicSlideLayout",
      "description": "A slide with a centered header, centered subtitle, and a decorative illustration in the corner",
      "json_schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "title": {
            "description": "Centered header text. Max 5 words",
            "type": "string",
            "minLength": 12,
            "maxLength": 32
          },
          "subtitle": {
            "description": "Centered subtitle text under the header. Max 16 words",
            "type": "string",
            "minLength": 40,
            "maxLength": 95
          }
        },
        "required": ["title", "subtitle"],
        "additionalProperties": false
      }
    }
  ]
}
```

<Tip>
  Your slide <code>content</code> must match the layout's <code>json\_schema</code>.
  Use the layout <code>id</code> as the <code>layout</code> value in your request.
</Tip>

***

## Step 3: Create a presentation from JSON

Endpoint:

```http theme={null}
POST /api/v3/presentation/from-json
```

<Info>
  API reference: [Create presentation from JSON](/api-reference/v3-presentation/create-presentation-from-json-sync-v3)
</Info>

Payload structure:

```json theme={null}
{
  "title": "Your Presentation Title",
  "standard_template": "<template_id>",
  "theme": "professional-dark",
  "export_as": "pdf",
  "slides": [
    {
      "layout": "<slide_layout_id>",
      "content": { /* must conform to the layout's json_schema */ }
    }
  ]
}
```

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.presenton.ai/api/v3/presentation/from-json \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-presenton-xxxxx" \
    -d '{
      "title": "Taco Bell",
      "standard_template": "custom-20f600db-e55d-4f14-b373-5c43c1668170",
      "theme": "professional-dark",
      "export_as": "pdf",
      "slides": [
        {
          "layout": "custom-20f600db-e55d-4f14-b373-5c43c1668170:header-subtitle-decorative-illustration-slide",
          "content": {
            "title": "Introduction to Taco Bell",
            "subtitle": "Taco bell was a small shop opened by a small town guy who was recognized greatest chef"
          }
        }
      ]
    }'
  ```

  ```python Python theme={null}
  import requests

  payload = {
      "title": "Taco Bell",
      "standard_template": "custom-20f600db-e55d-4f14-b373-5c43c1668170",
      "theme": "professional-dark",
      "export_as": "pdf",
      "slides": [
          {
              "layout": "custom-20f600db-e55d-4f14-b373-5c43c1668170:header-subtitle-decorative-illustration-slide",
              "content": {
                  "title": "Introduction to Taco Bell",
                  "subtitle": "Taco bell was a small shop opened by a small town guy who was recognized greatest chef"
              }
          }
      ]
  }

  response = requests.post(
      "https://api.presenton.ai/api/v3/presentation/from-json",
      json=payload,
      headers={"Authorization": "Bearer sk-presenton-xxxxx"}
  )

  print(response.status_code)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const axios = require("axios");

  async function run() {
    const payload = {
      title: "Taco Bell",
      standard_template: "custom-20f600db-e55d-4f14-b373-5c43c1668170",
      theme: "professional-dark",
      export_as: "pdf",
      slides: [
        {
          layout: "custom-20f600db-e55d-4f14-b373-5c43c1668170:header-subtitle-decorative-illustration-slide",
          content: {
            title: "Introduction to Taco Bell",
            subtitle: "Taco bell was a small shop opened by a small town guy who was recognized greatest chef"
          }
        }
      ]
    };

    const { data } = await axios.post(
      "https://api.presenton.ai/api/v3/presentation/from-json",
      payload,
      { headers: { Authorization: "Bearer sk-presenton-xxxxx" } }
    );

    console.log(data);
  }

  run();
  ```
</CodeGroup>

Response:

```json theme={null}
{
  "presentation_id": "f60f4fb2-5dba-4daf-86ae-e7cb39f693c6",
  "path": "https://presenton-public.s3.amazonaws.com/users/1d5ec2f2-3119-4132-b483-df5c3c6b05c4/exports/Taco%20Bell-e46c34d6-e8a0-4d80-9671-e81ee95a3521.pdf",
  "edit_path": "https://presenton.ai/presentation?id=f60f4fb2-5dba-4daf-86ae-e7cb39f693c6",
  "credits_consumed": 0.5
}
```

<Tip>
  Open <code>edit\_path</code> in your browser to refine the design visually.
</Tip>

***

## Notes and tips

* **Validate content**: Respect each layout's <code>minLength</code>/<code>maxLength</code> and required fields.
* **Themes**: See available built‑in themes and customization options in the
  [Templates & Themes guide](generate-presentation-with-templates-and-themes).
* **Export formats**: Use <code>export\_as</code> like <code>pptx</code> or <code>pdf</code>.

***

## Next steps

1. Try other layouts from your chosen template and mix multiple slides.
2. Explore built‑in templates and themes: [Templates & Themes](generate-presentation-with-templates-and-themes).
3. Edit an existing presentation in place: [Edit via API](edit-presentation-using-api).
