getChunk

View as MarkdownOpen in Claude

Retrieve a specific chunk from a document.

Path parameters

documentIdstringRequiredformat: "uuid"
Unique ID of the parent Document.
chunkIdstringRequiredformat: "uuid"
Unique ID of a Chunk.

Response

idstringRequiredformat: "uuid"
Unique ID of the chunk.
datasphere_document_idstringRequiredformat: "uuid"
Unique ID of the chunk's datasphere document.
project_idstringRequiredformat: "uuid"
Unique ID of the project.
statusenumRequired
Status of the chunk.
tagslist of stringsRequired
The tags of the document associated with the chunk.
contentstringRequired
Content of the chunk.
created_atdatetimeRequired
Chunk Creation Date.
updated_atdatetimeRequired
Chunk Update Date.

Response Example

Response
{
"id": "acaa5c49-be5e-4477-bce0-48f4b23b7720",
"datasphere_document_id": "acaa5c49-be5e-4477-bce0-48f4b23b7720",
"project_id": "d369a402-7b43-4512-8735-9d5e1f387814",
"status": "completed",
"tags": [
"sports",
"football",
"game"
],
"content": "This is the content from the original document that was chunked.",
"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 chunk = await client.datasphere.documents.getChunk("document-id", "chunk-id");
console.log(chunk.text);