Upload a Document
POST
https://api.slidespeak.co/api/v1/document/upload
Uploads a document file to SlideSpeak for later use in presentation generation. Supported file types
include PowerPoint, Word, Excel, PDF, plain text and markdown formats. Once uploaded, the document can
be referenced in other API endpoints to generate presentations. This endpoint is typically the first
step in workflows that require extracting content or converting documents into presentations.
Headers
Content-Type: string
multipart/form-data X-API-Key: string
The API key to use for the request.
<YOUR_API_KEY> Body Parameters
file: file
The document you wish to upload.
Supported file types:
Supported file types:
.pptx, .ppt, .docx, .doc,
.xlsx, .pdf, .txt, .md Code Examples
curl -X POST "https://api.slidespeak.co/api/v1/document/upload" -H "X-API-Key: YOUR_API_KEY" -F "file=@path/to/your-document"const file = /* your document (Blob or File) */;
const formData = new FormData(); formData.append('file', file);
fetch('https://api.slidespeak.co/api/v1/document/upload', { method: 'POST', headers: { 'X-API-Key': 'YOUR_API_KEY' }, body: formData}) .then(response => response.json()) .then(data => { console.log('Upload response:', data);}) .catch(error => { console.error('Error:', error);});import requestsimport json
url = "https://api.slidespeak.co/api/v1/document/upload"
headers = { "X-API-Key": "YOUR_API_KEY"}
files = { "file": ("your-document", open("path/to/your-document", "rb"), "<file-type>"),}
response = requests.post(url, headers=headers, files=files)print(response.json())<?phprequire 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post('https://api.slidespeak.co/api/v1/document/upload', [ 'headers' => [ 'X-API-Key' => 'YOUR_API_KEY' ], 'multipart' => [ [ 'name' => 'file', 'contents' => fopen('path/to/your-document', 'rb'), 'filename' => 'your-document' ], ]]);
$body = $response->getBody();$data = json_decode($body, true);
print_r($data);Response
{
"task_id": "353509d6-8efe-401c-a8a9-53ca64b520a3"
}