For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
  • Core
    • Overview
    • Authorization
    • Base URL
    • Data formats
    • Paging
    • Error codes
    • Permissions
  • Calling
  • Datasphere
      • POSTCreate document
      • DELDelete document
      • GETGet document
      • GETList documents
      • POSTSearch documents
      • PATCHUpdate document
  • Logs
  • Messaging
  • Phone Number Management
  • Platform
  • Resource Management
LogoLogoSignalWire Docs
Log inSign up
Support
DatasphereDocuments

Create document

|View as Markdown|Open in Claude|
POST
https://{your_space_name}.signalwire.com/api/datasphere/documents
POST
/api/datasphere/documents
$curl -X POST https://{your_space_name}.signalwire.com/api/datasphere/documents \
> -H "Content-Type: application/json" \
> -u "<project_id>:<api_token>" \
> -d '{
> "url": "https://example.com/document.pdf"
>}'
1{
2 "id": "acaa5c49-be5e-4477-bce0-48f4b23b7720",
3 "filename": "player_list.pdf",
4 "status": "in_progress",
5 "tags": [
6 "sports",
7 "football",
8 "game"
9 ],
10 "chunking_strategy": "sentence",
11 "max_sentences_per_chunk": 80,
12 "split_newlines": true,
13 "overlap_size": 10,
14 "chunk_size": 50,
15 "number_of_chunks": 2345,
16 "chunks_uri": "/api/rest/datasphere/documents/acaa5c49-be5e-4477-bce0-48f4b23b7720/chunks",
17 "created_at": "2024-05-06T12:20-12Z",
18 "updated_at": "2024-05-06T12:20-12Z"
19}

Creates a Datasphere Document.

Permissions

The API token used to authenticate must have the following scope(s) enabled to make a successful request: DataSphere.

Learn more about API scopes.

Was this page helpful?
Previous

Delete document

Next
Built with

Authentication

AuthorizationBasic
SignalWire Basic Authentication using Project ID and API Token. The client sends HTTP requests with the Authorization header containing the word Basic followed by a space and a base64-encoded string of project_id:token. The project ID will be used as the username and the API token as the password. Example: ``` Authorization: Basic base64(project_id:token) ```

Request

This endpoint expects an object.
Sentence strategyobjectRequired
OR
Sliding strategyobjectRequired
OR
Page strategyobjectRequired
OR
Paragraph strategyobjectRequired

Response

The request has succeeded and a new resource has been created as a result.
idstringformat: "uuid"
Unique ID of the Document.
filenamestring
Name of the Document.
statusenum
Status of the Document.
Allowed values:
tagslist of strings
Document tags.
chunking_strategyenum
Strategy used to chunk the document.
Allowed values:
max_sentences_per_chunkinteger or null
Max Sentences per Chunk. Only present when chunking strategy is 'sentence', null otherwise.
split_newlinesboolean or null
Split on Newlines. Only present when chunking strategy is 'sentence', null otherwise.
overlap_sizeinteger or null
Overlap Size. Only present when chunking strategy is 'sliding', null otherwise.
chunk_sizeinteger or null
Chunk Size. Only present when chunking strategy is 'sliding', null otherwise.
number_of_chunksinteger
Number of Chunks in the Document.
chunks_uristring
URI path to the chunks for this document.
created_atdatetime
Document Creation Date.
updated_atdatetime
Document Update Date.

Errors

400
Bad Request Error
401
Unauthorized Error
422
Unprocessable Entity Error
500
Internal Server Error

SignalWire Basic Authentication using Project ID and API Token.

The client sends HTTP requests with the Authorization header containing the word Basic followed by a space and a base64-encoded string of project_id:token. The project ID will be used as the username and the API token as the password.

Example:

Authorization: Basic base64(project_id:token)