TypeScript
import { Orchata } from '@orchata-ai/sdk'; const client = new Orchata({ apiKey: 'oai_your_api_key' }); const doc = await client.documents.getByFilename({ spaceId: 'space_123', filename: 'to-do.md' }); console.log(doc.content);
{ "id": "<string>", "filename": "<string>", "status": "<string>", "metadata": {}, "content": "<string>", "mimeType": "<string>", "fileSize": "<string>", "createdAt": "<string>", "updatedAt": "<string>" }
Retrieve a document by filename within a space. Includes document content. Useful when you know the filename but not the document ID.
The ID of the space containing the document
"space_123"
The filename to search for
"my-notes.md"
Successfully retrieved document
Show child attributes
Was this page helpful?