# generator/create

Use this endpoint to create a new presentation from a .pptx template file and JSON data.

## generator/create

<mark style="color:green;">`POST`</mark> `https://gen.powerpointgeneratorapi.com/v1.0/generator/create`

#### Headers

| Name                                            | Type   | Description                 |
| ----------------------------------------------- | ------ | --------------------------- |
| Content-Type<mark style="color:red;">\*</mark>  | String | multipart/form-data         |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer authentication token |

#### Request Body

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| files<mark style="color:red;">\*</mark>    | Object | .pptx file  |
| jsonData<mark style="color:red;">\*</mark> | String | JSON data   |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}
{% endtabs %}

### Example request

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request POST 'https://gen.powerpointgeneratorapi.com/v1.0/generator/create' \
-H 'Content-Type: multipart/form-data' \
-H 'Authorization: Bearer {add_your_token_here}' \
-F 'files=@my_dummy_presentation.pptx' \
-F 'jsonData={"presentation":{"template":"my_dummy_presentation.pptx","export_version":"Pptx2010","resultFileName":"quick_start_example","slides":[{"type":"slide","slide_index":0,"shapes":[{"name":"Title 1","content":"Your generated PowerPoint presentation"},{"name":"Subtitle 2","content":"Create,fill and manage PowerPoint documents through simple API requests."}]}]}}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

payload={'jsonData': '{"template":"my_dummy_presentation.pptx","export_version":"Pptx2010","resultFileName":"quick_start_example","slides":[{"type":"slide","slide_index":0,"shapes":[{"name":"Title 1","content":"Your generated PowerPoint presentation"},{"name":"Subtitle 2","content":"Create, fill and manage PowerPoint documents through simple API requests."}]}]}'}

files=[
  ('files', ('my_dummy_presentation.pptx', open('./my_dummy_presentation.pptx','rb'), 'application/vnd.openxmlformats-officedocument.presentationml.presentation'))
]

response = requests.post(
    'https://gen.powerpointgeneratorapi.com/v1.0/generator/create',
    data=payload,
    files=files,
    headers={
        'Authorization': f'Bearer {add_your_token_here}',
    },
    timeout=360
)

with open("./generated.pptx", "wb") as file:
    file.write(response.content)
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const formData = new FormData();

  formData.append("jsonData", JSON.stringify('{"presentation":{"template":"url of title_slide_template.pptx","export_version":"Pptx2010","resultFileName":"quick_start_example","slides":[{"type":"slide","slide_index":0,"shapes":[{"name":"Title 1","content":"YourgeneratedPowerPointpresentation"},{"name":"Subtitle 2","content":"Create,fillandmanagePowerPointdocumentsthroughsimpleAPIrequests."}]}]}}'));

  const request = new XMLHttpRequest();
  request.open(
    "POST",
    "https://gen.powerpointgeneratorapi.com/v1.0/generator/create",
    true
  );
  request.setRequestHeader(
    "Authorization",
    "Bearer {add_your_token_here}"
  );

  request.responseType = "blob";

  request.onload = function () {
    if (request.readyState === request.DONE && request.status === 200) {
      var blob = new Blob([request.response], {
      type: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
      });
      var link = document.createElement("a");
      link.href = window.URL.createObjectURL(blob);
      link.download = "generated.pptx";
      link.click();      
    }
  };

  request.send(formData);
```

{% endtab %}

{% tab title="Postman" %}

1. Select the `Authorization` tab,  enter your `Token` .

   <figure><img src="/files/HxYtsXf5dpRrh6H4zXpk" alt=""><figcaption></figcaption></figure>
2. Select the `Body` tab, select `form-data` , add the two key-value parameters below:

   <table><thead><tr><th width="116">KEY</th><th>VALUE</th></tr></thead><tbody><tr><td><code>files</code></td><td>upload/ attach your <code>.pptx</code> file </td></tr><tr><td><code>jsonData</code></td><td>copy and paste the data from your <code>.json</code>  payload</td></tr></tbody></table>

<figure><img src="/files/hBmd4IBlaScX8DCmwQbC" alt=""><figcaption></figcaption></figure>

3. Click the down arrow next to `Send` then select `Send and Download` . Once the result is successfully received, save the output as `.pptx`.

![](/files/jYPHKFy2jCkrtz6ajqFu)
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.powerpointgeneratorapi.com/api-reference/generator-create.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
