REST ClientDatasphere

list

View as MarkdownOpen in Claude

List documents in the project.

Query parameters

page_numberintegerOptional>=0Defaults to 0
The page number to retrieve (0-indexed).
page_sizeintegerOptional1-1000Defaults to 50
Specify the number of results to return on a single page. The default page size is `50` and the maximum is `1000`.
page_tokenstringOptional
Token for cursor-based pagination. Required when `page_number` > 0.

Response

datalist of objectsRequired
A list of documents.

Response Example

Response
1{
2 "data": [
3 {
4 "id": "acaa5c49-be5e-4477-bce0-48f4b23b7720",
5 "filename": "player_list.pdf",
6 "status": "in_progress",
7 "tags": [
8 "sports",
9 "football",
10 "game"
11 ],
12 "chunking_strategy": "sentence",
13 "max_sentences_per_chunk": 80,
14 "split_newlines": true,
15 "overlap_size": 10,
16 "chunk_size": 50,
17 "number_of_chunks": 2345,
18 "chunks_uri": "/api/rest/datasphere/documents/acaa5c49-be5e-4477-bce0-48f4b23b7720/chunks",
19 "created_at": "2024-05-06T12:20-12Z",
20 "updated_at": "2024-05-06T12:20-12Z"
21 }
22 ],
23 "links": {
24 "self": "https://{space_name}.signalwire.com/api/datasphere/documents?page_number=0&page_size=50",
25 "first": "https://{space_name}.signalwire.com/api/datasphere/documents?page_number=0&page_size=50",
26 "next": "https://{space_name}.signalwire.com/api/datasphere/documents?page_number=1&page_size=50&page_token=PAbff61159-faab-48b3-959a-3021a8f5beca",
27 "prev": "https://{space_name}.signalwire.com/api/datasphere/documents?page_number=0&page_size=50&page_token=PBbff61159-faab-48b3-959a-3021a8f5beca"
28 }
29}

Example

1from signalwire.rest import RestClient
2
3client = RestClient(
4 project="your-project-id",
5 token="your-api-token",
6 host="your-space.signalwire.com",
7)
8
9result = client.datasphere.documents.list()
10for doc in result.get("data", []):
11 print(doc.get("name"), doc.get("id"))