Skip to main content
POST
/
api
/
documents
/
{id}
/
append
TypeScript SDK
import { Orchata } from '@orchata-ai/sdk';

const client = new Orchata({ apiKey: 'oai_your_api_key' });

// Add a new item to a to-do list without fetching first
const { document } = await client.documents.append('doc_123', {
  spaceId: 'space_123',
  content: '- [ ] New task added by AI'
});
{
  "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>"
  }
}

Authorizations

Oai-Api-Key
string
header
required

Path Parameters

id
string
required
Example:

"document_123"

Body

application/json

Content to append

spaceId
string
required

The ID of the space containing the document

Example:

"space_123"

content
string
required

Content to append to the document (max 10MB)

Required string length: 1 - 10000000
Example:

"\n- New item added"

separator
string

Separator between existing and new content (default: '\n\n')

Example:

"\n\n"

Response

Content appended successfully

document
object
required