---
title: "Upload documents"
method: POST
path: "/documents/"
tags: ["Document"]
---

# Upload documents

`POST /documents/`

Upload files as documents and kick off async processing for the given entity.

## Query parameters

- `cookie_name` string, nullable

## Response `201`

Successful Response

- Document[]
  - `id` integer, nullable — Primary key for the document.
  - `created_at` string, date-time — Timestamp when the document was created.
  - `updated_at` string, date-time — Timestamp when the document was last updated.
  - `creator_user_id` integer, required — ID of the user who created the document.
  - `tenant_id` integer, required — ID of the tenant that owns the document.
  - `project_id` integer, nullable, required — ID of the project the document belongs to, if any.
  - `chat_id` integer, nullable, required — ID of the chat the document belongs to, if any.
  - `assistant_id` integer, nullable — ID of the assistant the document belongs to, if any.
  - `message_id` integer, nullable — ID of the message the document is associated with, if any.
  - `library_id` integer, nullable — ID of the library the document belongs to, if any.
  - `filename` string, required — Original filename of the document.
  - `content_type` string — MIME content type of the document.
  - `description` string, nullable, required — Optional description of the document.
  - `content_id` integer, nullable — ID of the associated document content record.
  - `src` string, nullable, required — Source identifier of the document (e.g. connector source).
  - `url` string, nullable, required — External URL of the document, if any.
  - `sp_site_id` string, nullable, required — SharePoint site ID the document originated from.
  - `sp_drive_id` string, nullable, required — SharePoint drive ID the document originated from.
  - `sp_drive_item_id` string, nullable, required — SharePoint drive item ID of the document.
  - `sp_parent_folder_id` string, nullable, required — SharePoint parent folder ID of the document.
  - `sp_parent_path` string, nullable, required — SharePoint parent folder path of the document.
  - `sp_last_modified_date_time` string, date-time, nullable, required — Last-modified timestamp reported by SharePoint.
  - `sp_import_folder_id` string, nullable, required — SharePoint folder ID used as the import root.
  - `autosync` boolean, nullable, required — Whether the document is automatically synced from its source.
  - `import_token` string, uuid, nullable, required — Token identifying the import batch for this document.
  - `import_started_at` string, date-time, nullable, required — Timestamp when the import started.
  - `import_finished_at` string, date-time, nullable, required — Timestamp when the import finished.
  - `import_error` string, nullable — Error message captured during import, if any.

## Other responses

- `401` — Missing or invalid authentication.
- `403` — Usage limit exceeded, or caller lacks access to the target entity.
- `404` — The referenced project, chat, assistant, or library does not exist.
- `422` — Validation Error

---

[API](https://skmtc.net/neulandai/apis/neuland-ai-hub-api.md) · [All operations](https://skmtc.net/neulandai/apis/neuland-ai-hub-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/neulandai/neuland-ai-hub-api/versions/b53e89b98c2b/schema)
