TypeScript
TypeScript SDK (Content)
import { Orchata } from '@orchata/sdk';const client = new Orchata({ apiKey: 'oai_your_api_key' });// Upload raw contentconst { document } = await client.documents.upload({ spaceId: 'space_123', content: '# My Document\n\nSome markdown content...', filename: 'my-doc.md', metadata: { category: 'guides' }});
{ "document": { "id": "<string>", "orgId": "<string>", "spaceId": "<string>", "filename": "<string>", "mimeType": "<string>", "fileSize": "<string>", "storageUrl": "<string>", "status": "<string>", "errorMessage": "<string>", "embeddingModel": "<string>", "metadata": "<string>", "createdAt": "2023-12-25", "updatedAt": "2023-12-25" } }
Upload a new document to a space. Supports both file uploads (multipart/form-data) and raw markdown/text content (application/json).
The ID of the space to upload the document to
"space_123"
The file to upload
1 - 255
Document uploaded successfully
Show child attributes