Create a Document
POST/documents
Creates a Datasphere Document
Request
- application/json
Body
required
- Sentence strategy
- Sliding strategy
- Page strategy
- Paragraph strategy
oneOf
Maximum number of sentences per chunk.
50
40
Strategy for chunking the document
Possible values: [sentence
]
sentence
Whether to split chunks on new lines.
Default value: false
false
false
URL of the document.
https://example.com/document.pdf
Document tags.
["sports","football","game"]
Number of words per chunk.
50
50
Strategy for chunking the document
Possible values: [sliding
]
sliding
Amount of overlap between chunks, in number of words.
10
10
URL of the document.
https://example.com/document.pdf
Document tags.
["sports","football","game"]
Strategy for chunking the document
Possible values: [page
]
page
URL of the document.
https://example.com/document.pdf
Document tags.
["sports","football","game"]
Strategy for chunking the document
Possible values: [paragraph
]
paragraph
URL of the document.
https://example.com/document.pdf
Document tags.
["sports","football","game"]
Responses
- 201
- 401
- 404
- 422
The request has succeeded and a new resource has been created as a result.
- application/json
- Schema
- Example (from schema)
Schema
Unique ID of a Document.
Name of the Document.
player_list.pdf
The current Status of the Document.
Possible values: [submitted
, in_progress
, completed
, failed
]
Document tags.
["sports","football","game"]
Strategy to use when chunking the document.
Possible values: [sentence
, paragraph
, page
, sliding
]
Max Sentences per Chunk (only used for chunking type 'sentence')
80
Split on Newlines (only used for chunking type 'sentence')
true
Overlap Size (only used for chunking type 'sliding')
10
Chunk Size (only used for chunking type 'sliding')
50
Number of Chunks in the Document.
2345
Document Creation Date.
2024-05-06T12:20-12Z
Document Update Date.
2024-05-06T12:20-12Z
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"filename": "player_list.pdf",
"status": "submitted",
"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,
"created_at": "2024-05-06T12:20-12Z",
"updated_at": "2024-05-06T12:20-12Z"
}
Access is unauthorized.
- application/json
- Schema
Schema
string
Possible values: [Unauthorized
]
The server cannot find the requested resource.
- application/json
- Schema
Schema
string
Possible values: [Not Found
]
Client error
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
errors
object[]
required
Error type.
Error code.
Error details.
Request parameter associated with this error.
Link to developer resource for this error.
{
"errors": [
{
"type": "validation_error",
"code": "invalid_parameter",
"message": "Invalid chunking_strategy",
"attribute": "chunking_strategy",
"url": "https://developer.signalwire.com/rest/overview/error-codes#{code}"
}
]
}