Skip to main content

Create a Document

POST 

/documents

Creates a Datasphere Document

Request

Body

required

    oneOf

    max_sentences_per_chunk integer

    Maximum number of sentences per chunk.

    Default value: 50
    Example: 40
    chunking_strategy string

    Strategy for chunking the document

    Possible values: [sentence]

    Example: sentence
    split_newlines boolean

    Whether to split chunks on new lines.

    Default value: false

    Default value: false
    Example: false
    url urirequired

    URL of the document.

    Example: https://example.com/document.pdf
    tags string[]

    Document tags.

    Example: ["sports","football","game"]

Responses

The request has succeeded and a new resource has been created as a result.

Schema

    id uuidrequired

    Unique ID of a Document.

    filename stringrequired

    Name of the Document.

    Example: player_list.pdf
    status DocumentStatus (string)required

    The current Status of the Document.

    Possible values: [submitted, in_progress, completed, failed]

    tags string[]required

    Document tags.

    Example: ["sports","football","game"]
    chunking_strategy ChunkingStrategy (string)required

    Strategy to use when chunking the document.

    Possible values: [sentence, paragraph, page, sliding]

    max_sentences_per_chunk stringrequired

    Max Sentences per Chunk (only used for chunking type 'sentence')

    Example: 80
    split_newlines booleanrequired

    Split on Newlines (only used for chunking type 'sentence')

    Example: true
    overlap_size stringrequired

    Overlap Size (only used for chunking type 'sliding')

    Example: 10
    chunk_size stringrequired

    Chunk Size (only used for chunking type 'sliding')

    Example: 50
    number_of_chunks integerrequired

    Number of Chunks in the Document.

    Example: 2345
    created_at date-timerequired

    Document Creation Date.

    Example: 2024-05-06T12:20-12Z
    updated_at date-timerequired

    Document Update Date.

    Example: 2024-05-06T12:20-12Z