# Delete a presentation
Source: https://slidesgpt.com/docs/api-reference/endpoint/delete
DELETE /v1/presentations/{id}
Delete a presentation by id
# Download a presentation
Source: https://slidesgpt.com/docs/api-reference/endpoint/download
GET /v1/presentations/{id}/download
Downloads a presentation by id
# Embed a presentation
Source: https://slidesgpt.com/docs/api-reference/endpoint/embed
GET /v1/presentations/{id}/embed
Returns a redirect URL to view the presentation in Microsoft PowerPoint Online viewer, which can be used in an iframe or opened directly
# Generate presentation
Source: https://slidesgpt.com/docs/api-reference/endpoint/generate
POST /v1/presentations/generate
Generates a presentation based on the provided prompt
# Retrieve a presentation
Source: https://slidesgpt.com/docs/api-reference/endpoint/get
GET /v1/presentations/{id}
Get a presentation by id
# Authentication
Source: https://slidesgpt.com/docs/getting-started/authentication
To use the **SlidesGPT API**, you need an API key for authentication. This key must be included in every request as a Bearer token in the `Authorization` header.
### How to Get an API Key
1. Sign up or log in to [SlidesGPT](https://slidesgpt.com).
2. Navigate to the [API Keys](https://slidesgpt.com/keys) page.
3. Generate a new API key.
4. Optionally, give your key a name.
5. Save your key.
### Using the API Key
Include it in your request headers:
```
Authorization: Bearer YOUR_API_KEY
```
Keep your key secure and do not share it.
# Deleting a Presentation
Source: https://slidesgpt.com/docs/getting-started/delete-presentation
The **SlidesGPT API** allows you to delete a generated presentation permanently. Once deleted, the presentation cannot be recovered.
### Request Example
Send a `DELETE` request to:
```
https://api.slidesgpt.com/v1/presentations/{id}
```
#### Sample Code (cURL)
```sh
curl -X DELETE "https://api.slidesgpt.com/v1/presentations/12345" \
-H "Authorization: Bearer YOUR_API_KEY"
```
#### Sample Code (JavaScript)
```js
async function deletePresentation(id) {
try {
const response = await fetch(`${API_BASE_URL}/presentations/${id}`, {
method: "DELETE",
headers: { Authorization: `Bearer ${token}` },
});
if (response.ok) console.log("Presentation deleted successfully.");
else console.error("Failed to delete presentation.");
} catch (err) {
console.error(err);
}
}
```
> **Note:** You must include your API key in the `Authorization` header. If you don’t have one, follow the steps in the [Authentication Guide](/getting-started/authentication) to get your API key.
Use this API call carefully, as deletions are **irreversible**.
# Downloading a Presentation
Source: https://slidesgpt.com/docs/getting-started/download-presentation
The **SlidesGPT API** allows you to download a generated presentation as a PowerPoint (`.pptx`) file.
### Request Example
Send a `GET` request to:
```
https://api.slidesgpt.com/v1/presentations/{id}/download
```
#### Sample Code (JavaScript)
```js
import fs from "fs";
async function downloadPresentation(id) {
try {
const response = await fetch(`${API_BASE_URL}/presentations/${id}/download`, {
method: "GET",
headers: { Authorization: `Bearer ${token}` },
});
const buffer = await response.arrayBuffer();
fs.writeFileSync(`presentation-${id}.pptx`, Buffer.from(buffer));
} catch (err) {
console.error(err);
}
}
```
This function fetches the `.pptx` file and saves it locally.
#### Sample Code (wget)
```sh
wget --header="Authorization: Bearer YOUR_API_KEY" \
-O presentation.pptx \
"https://api.slidesgpt.com/v1/presentations/12345/download"
```
> **Note:** You must include your API key in the `Authorization` header. If you don’t have one, follow the steps in the [Authentication Guide](/getting-started/authentication) to get your API key.
# Embedding a Presentation
Source: https://slidesgpt.com/docs/getting-started/embed-presentation
The **SlidesGPT API** provides an easy way to embed presentations using Microsoft PowerPoint Online. The `embed` route returns a **redirect response** to the PowerPoint Online viewer.
### Request Example
Send a `GET` request to:
```
https://api.slidesgpt.com/v1/presentations/{id}/embed
```
#### Sample Code (cURL)
```sh
curl -X GET "https://api.slidesgpt.com/v1/presentations/12345/embed" \
-H "Authorization: Bearer YOUR_API_KEY"
```
> **Note:** You must include your API key in the `Authorization` header. If you don’t have one, follow the steps in the [Authentication Guide](/getting-started/authentication) to get your API key.
### Behavior
This request **does not return JSON**. Instead, it redirects the user to PowerPoint Online, where the presentation can be viewed.
> **Note:** You can directly use this endpoint in an `