Edit Presentation
POST
https://api.slidespeak.co/api/v1/presentation/edit
Edits an existing PowerPoint presentation by replacing the content of specified shapes. Upload a .pptx file and provide a configuration object detailing which shapes to update and their new content. This endpoint is useful for personalizing presentations, or programmatically modifying slides at scale. The response includes a URL to download the edited presentation.
Headers
Section titled “Headers” Content-Type: string
multipart/form-data
X-API-Key: string
The API key to use for the request.
<YOUR_API_KEY>
Body Parameters
Section titled “Body Parameters” pptx_file: file
The PowerPoint you wish to edit.
config: json
A JSON object containing the values to change. Expects a replacements key with a list of dictionaries.
Replacement items keys:
shape_name: string
The name of the shape to replace.
content: string
The new content for the shape.
Code Examples
Section titled “Code Examples”curl -X POST "https://api.slidespeak.co/api/v1/presentation/edit" -H "x-api-key: YOUR_API_KEY" -F "pptx_file=@path/to/your-presentation.pptx" -F "config={ "replacements": [ { "shape_name": "TARGET_TITLE", "content": "Your new title" }, { "shape_name": "TARGET_SUBTITLE", "content": "A new fancy subtitle" }, { "shape_name": "TARGET_CONTENT", "content": "Some new content" } ] }"
const pptxFile = /* your PPTX file (Blob or File) */;const configObject = { replacements: [ { shape_name: "TARGET_TITLE", content: "Your new title" }, { shape_name: "TARGET_SUBTITLE", content: "A new fancy subtitle" }, { shape_name: "TARGET_CONTENT", content: "Some new content" } ]};
const formData = new FormData(); formData.append('pptx_file', pptxFile);formData.append('config', JSON.stringify(configObject));
fetch('https://api.slidespeak.co/api/v1/presentation/edit', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY' }, body: formData}) .then(response => response.json()) .then(data => { console.log('Edit response:', data);}) .catch(error => { console.error('Error:', error);});
import requestsimport json
url = "https://api.slidespeak.co/api/v1/presentation/edit"
headers = { "x-api-key": "YOUR_API_KEY"}
config_data = { "replacements": [ { "shape_name": "TARGET_TITLE", "content": "Your new title" }, { "shape_name": "TARGET_SUBTITLE", "content": "A new fancy subtitle" }, { "shape_name": "TARGET_CONTENT", "content": "Some new content" } ]}
files = { "pptx_file": ("your-presentation.pptx", open("path/to/your-presentation.pptx", "rb"), "application/vnd.openxmlformats-officedocument.presentationml.presentation"), "config": (None, json.dumps(config_data), "application/json")}
response = requests.post(url, headers=headers, files=files)print(response.json())
<?phprequire 'vendor/autoload.php';
use GuzzleHttpClient;
$client = new Client();
$configData = [ 'replacements' => [ [ 'shape_name' => 'TARGET_TITLE', 'content' => 'Your new title' ], [ 'shape_name' => 'TARGET_SUBTITLE', 'content' => 'A new fancy subtitle' ], [ 'shape_name' => 'TARGET_CONTENT', 'content' => 'Some new content' ] ]];
$response = $client->post('https://api.slidespeak.co/api/v1/presentation/edit', [ 'headers' => [ 'x-api-key' => 'YOUR_API_KEY' ], 'multipart' => [ [ 'name' => 'pptx_file', 'contents' => fopen('path/to/your-presentation.pptx', 'rb'), 'filename' => 'your-presentation.pptx' ], [ 'name' => 'config', 'contents' => json_encode($configData), 'headers' => ['Content-Type' => 'application/json'] ] ]]);
$body = $response->getBody();$data = json_decode($body, true);
print_r($data);
Example config
Section titled “Example config”{ "replacements": [ { "shape_name": "TARGET_TITLE", "content": "Your new title" }, { "shape_name": "TARGET_SUBTITLE", "content": "A new fancy subtitle" }, { "shape_name": "TARGET_CONTENT", "content": "Some new content" } ]}
Response
Section titled “Response”{ "url": "https://slidespeak-pptx-writer.s3.amazonaws.com/02776182-b4d2-46d9-90c4-f40dbcbb3cfe.pptx"}