update

View as MarkdownOpen in Claude

Update an existing document.

Path parameters

idstringRequiredformat: "uuid"
Unique ID of a Document.

Request

tagslist of stringsRequired
Document tags.

Response

idstringRequiredformat: "uuid"
Unique ID of the Document.
filenamestringRequired
Name of the Document.
statusenumRequired
Status of the Document.
tagslist of stringsRequired
Document tags.
chunking_strategyenumRequired
Strategy used to chunk the document.
max_sentences_per_chunkinteger or nullRequired
Max Sentences per Chunk. Only present when chunking strategy is 'sentence', null otherwise.
split_newlinesboolean or nullRequired
Split on Newlines. Only present when chunking strategy is 'sentence', null otherwise.
overlap_sizeinteger or nullRequired
Overlap Size. Only present when chunking strategy is 'sliding', null otherwise.
chunk_sizeinteger or nullRequired
Chunk Size. Only present when chunking strategy is 'sliding', null otherwise.
number_of_chunksintegerRequired
Number of Chunks in the Document.
chunks_uristringRequired
URI path to the chunks for this document.
created_atdatetimeRequired
Document Creation Date.
updated_atdatetimeRequired
Document Update Date.

Response Example

Response
{
"id": "acaa5c49-be5e-4477-bce0-48f4b23b7720",
"filename": "player_list.pdf",
"status": "in_progress",
"tags": [
"sports",
"football",
"game"
],
"chunking_strategy": "sentence",
"max_sentences_per_chunk": 80,
"split_newlines": true,
"overlap_size": 10,
"chunk_size": 50,
"number_of_chunks": 2345,
"chunks_uri": "/api/rest/datasphere/documents/acaa5c49-be5e-4477-bce0-48f4b23b7720/chunks",
"created_at": "2024-05-06T12:20-12Z",
"updated_at": "2024-05-06T12:20-12Z"
}

Example

import { RestClient } from "@signalwire/sdk";
const client = new RestClient({
project: "your-project-id",
token: "your-api-token",
host: "your-space.signalwire.com"
});
const updated = await client.datasphere.documents.update("document-id", {
tags: ["support", "updated"],
});
console.log(updated.tags);