---
title: "Create document"
method: POST
path: "/api/datasphere/documents"
tags: ["Documents"]
---

# Create document

`POST /api/datasphere/documents`

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](/docs/platform/your-signalwire-api-space).

## Request body

- union
  - DatasphereDocumentCreateSentenceRequest
    - `url` string, uri, required — URL of the document.
    - `tags` string[] — Document tags.
  - DatasphereDocumentCreateSlidingRequest
    - `url` string, uri, required — URL of the document.
    - `tags` string[] — Document tags.
  - DatasphereDocumentCreatePageRequest
    - `url` string, uri, required — URL of the document.
    - `tags` string[] — Document tags.
  - DatasphereDocumentCreateParagraphRequest
    - `url` string, uri, required — URL of the document.
    - `tags` string[] — Document tags.

## Response `201`

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

- DatasphereDocument
  - `id` string, uuid, required — Universal Unique Identifier.
  - `filename` string, required — Name of the Document.
  - `status` 'submitted' | 'in_progress' | 'completed' | 'failed', required — The current Status of the Document.
  - `tags` string[], required — Document tags.
  - `chunking_strategy` 'sentence' | 'paragraph' | 'page' | 'sliding', required — Strategy to use when chunking the document.
  - `max_sentences_per_chunk` integer, nullable, required — Max Sentences per Chunk. Only present when chunking strategy is 'sentence', null otherwise.
  - `split_newlines` boolean, nullable, required — Split on Newlines. Only present when chunking strategy is 'sentence', null otherwise.
  - `overlap_size` integer, nullable, required — Overlap Size. Only present when chunking strategy is 'sliding', null otherwise.
  - `chunk_size` integer, nullable, required — Chunk Size. Only present when chunking strategy is 'sliding', null otherwise.
  - `number_of_chunks` integer, required — Number of Chunks in the Document.
  - `chunks_uri` string, required — URI path to the chunks for this document.
  - `created_at` string, date-time, required — Document Creation Date.
  - `updated_at` string, date-time, required — Document Update Date.

## Other responses

- `400` — The request is invalid.
- `401` — Access is unauthorized.
- `422` — The request contains invalid parameters. See errors for details.
- `500` — An internal server error occurred.

---

[API](https://skmtc.net/signalwire/apis/signalwire-rest-api.md) · [All operations](https://skmtc.net/signalwire/apis/signalwire-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/signalwire/signalwire-rest-api/versions/05c5164b85c7/schema)
