TypeScript
TypeScript SDK (Content)
import { Orchata } from '@orchata-ai/sdk'; const client = new Orchata({ apiKey: 'oai_your_api_key' }); // Upload raw content const { 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>", "indexingType": "<string>", "createdAt": "2023-11-07T05:31:56Z", "updatedAt": "2023-11-07T05:31:56Z", "metadata": "<unknown>" } }
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
Was this page helpful?