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, and PDF 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
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” file: file
The document you wish to upload.
Supported file types: .pptx
, .ppt
, .docx
, .doc
, .xlsx
, .pdf
Code Examples
Section titled “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 GuzzleHttpClient;
$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
Section titled “Response”{ "task_id": "353509d6-8efe-401c-a8a9-53ca64b520a3"}
Example Task Result
Section titled “Example Task Result”{ "task_id": "353509d6-8efe-401c-a8a9-53ca64b520a3", "task_status": "SUCCESS", "task_result": "e1f3ea4d-39f0-45e4-9cce-044ec63f8a5b", "task_info": "e1f3ea4d-39f0-45e4-9cce-044ec63f8a5b"}