> ## 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.

# Generate Presentations Asynchronously

> Use Presenton’s Async API to schedule presentation generation and retrieve results via polling the status.

### 🎯 Endpoint

```
POST /api/v1/ppt/presentation/generate/async
```

Use this endpoint to **schedule presentation generation**.\
It immediately returns a **Task ID** which you can later use to **check status** and **download the presentation**.

<Note>
  For detailed information about the request format, please see the [API Reference](/api-reference/presentation/generate-presentation-async).
</Note>

### 🔐 Authentication

Before calling the API, log in to Presenton and create an API key from your account page: [Presenton Account](https://presenton.ai/api-key).\
Your key will look like `sk-presenton-xxxxx`.

Include this key in every request using the Authorization header:

```http theme={null}
Authorization: Bearer sk-presenton-xxxxx
```

***

### 📤 Example Request

<CodeGroup>
  ```bash bash theme={null}
  curl -X POST https://api.presenton.ai/api/v1/ppt/presentation/generate/async \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-presenton-xxxxx" \
    -d '{
      "content": "Introduction to Machine Learning",
      "n_slides": 5,
      "language": "English",
      "template": "general",
      "export_as": "pptx"
    }'
  ```

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

  url = "https://api.presenton.ai/api/v1/ppt/presentation/generate/async"
  data = {
      "content": "Introduction to Machine Learning",
      "n_slides": 10,
      "language": "English",
      "template": "modern",
      "export_as": "pptx"
  }
  headers = {
      "Content-Type": "application/json",
      "Authorization": "Bearer sk-presenton-xxxxx"
  }
  response = requests.post(url, json=data, headers=headers)
  print(response.json())
  ```

  ```javascript javascript theme={null}
  const data = {
    content: "Introduction to Machine Learning",
    n_slides: 10,
    language: "English",
    template: "modern",
    export_as: "pptx"
  };

  fetch("https://api.presenton.ai/api/v1/ppt/presentation/generate/async", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "Authorization": "Bearer sk-presenton-xxxxx"
    },
    body: JSON.stringify(data)
  })
    .then(response => response.json())
    .then(task => {
      console.log(task); // contains task id
    })
    .catch(error => {
      console.error("Error:", error);
    });
  ```
</CodeGroup>

***

### 📥 Example Response (Task Creation)

```json theme={null}
{
  "id": "task-9a827c13f4",
  "status": "pending",
  "message": "Presentation generation task created",
  "created_at": "2025-09-14T08:00:00Z",
  "updated_at": "2025-09-14T08:00:00Z",
  "data": {}
}
```

* `id`: The unique Task ID (use this to check status)
* `status`: Current state of the task (`pending`, `processing`, `completed`, `failed`)
* `message`: Human-readable status message
* `created_at` / `updated_at`: Timestamps

It gives error regarding credits and other things immediately on this request itself.

Check [API reference](/api-reference/presentation/generate-presentation-async) of asynchronous generation for more details on options.

***

## 🔄 Checking Task Status

Use the following endpoint to then check the status of your async task:

```
GET /api/v1/ppt/presentation/status/{id}
```

Replace `{id}` with the Task ID returned earlier.

<Note>
  Once the task is **completed**, the response will include the presentation file path and editor link.
</Note>

### Example Status Check

<CodeGroup>
  ```bash bash theme={null}
  curl -X GET https://api.presenton.ai/api/v1/ppt/presentation/status/task-9a827c13f4 \
    -H "Authorization: Bearer sk-presenton-xxxxx"
  ```

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

  task_id = "task-9a827c13f4"
  url = f"https://api.presenton.ai/api/v1/ppt/presentation/status/{task_id}"
  headers = {
      "Authorization": "Bearer sk-presenton-xxxxx"
  }
  response = requests.get(url, headers=headers)
  print(response.json())
  ```

  ```javascript javascript theme={null}
  const taskId = "task-9a827c13f4";

  fetch(`https://api.presenton.ai/api/v1/ppt/presentation/status/${taskId}`, {
    method: "GET",
    headers: {
      "Authorization": "Bearer sk-presenton-xxxxx"
    }
  })
    .then(response => response.json())
    .then(status => {
      console.log(status);
    })
    .catch(error => {
      console.error("Error:", error);
    });
  ```
</CodeGroup>

***

### ✅ Example Completed Response

```json theme={null}
{
  "id": "task-9a827c13f4",
  "status": "completed",
  "message": "Presentation generated successfully",
  "created_at": "2025-09-14T08:00:00Z",
  "updated_at": "2025-09-14T08:01:30Z",
  "data": {
    "presentation_id": "d3000f96-096c-4768-b67b-e99aed029b57",
    "path": "https://api.presenton.ai/static/user_data/d3000f96-096c-4768-b67b-e99aed029b57/Introduction_to_Machine_Learning.pptx",
    "edit_path": "https://presenton.ai/presentation?id=d3000f96-096c-4768-b67b-e99aed029b57",
    "credits_consumed": 5
  }
}
```

Check [API Reference](/api-reference/presentation/check-async-presentation-generation-status) of status check for more details.
