v1

latestOpenAPI 3.1.0raw.githubusercontent.com2026-06-25173140700.7 KB
Document

Upload documents

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

post/documents/

Query parameters

cookie_namestring nullable

Response

Successful Response

idinteger nullable

Primary key for the document.

created_atstring date-time

Timestamp when the document was created.

updated_atstring date-time

Timestamp when the document was last updated.

creator_user_idinteger required

ID of the user who created the document.

tenant_idinteger required

ID of the tenant that owns the document.

project_idinteger nullable required

ID of the project the document belongs to, if any.

chat_idinteger nullable required

ID of the chat the document belongs to, if any.

assistant_idinteger nullable

ID of the assistant the document belongs to, if any.

message_idinteger nullable

ID of the message the document is associated with, if any.

library_idinteger nullable

ID of the library the document belongs to, if any.

filenamestring required

Original filename of the document.

content_typestring

MIME content type of the document.

descriptionstring nullable required

Optional description of the document.

content_idinteger nullable

ID of the associated document content record.

srcstring nullable required

Source identifier of the document (e.g. connector source).

urlstring nullable required

External URL of the document, if any.

sp_site_idstring nullable required

SharePoint site ID the document originated from.

sp_drive_idstring nullable required

SharePoint drive ID the document originated from.

sp_drive_item_idstring nullable required

SharePoint drive item ID of the document.

sp_parent_folder_idstring nullable required

SharePoint parent folder ID of the document.

sp_parent_pathstring nullable required

SharePoint parent folder path of the document.

sp_last_modified_date_timestring date-time nullable required

Last-modified timestamp reported by SharePoint.

sp_import_folder_idstring nullable required

SharePoint folder ID used as the import root.

autosyncboolean nullable required

Whether the document is automatically synced from its source.

import_tokenstring uuid nullable required

Token identifying the import batch for this document.

import_started_atstring date-time nullable required

Timestamp when the import started.

import_finished_atstring date-time nullable required

Timestamp when the import finished.

import_errorstring nullable

Error message captured during import, if any.

Example response

[
  {
    "id": 1,
    "created_at": "2026-06-23T12:00:00Z",
    "updated_at": "2026-06-23T12:00:00Z",
    "creator_user_id": 1,
    "tenant_id": 1,
    "project_id": 1,
    "chat_id": 1,
    "assistant_id": 1,
    "message_id": 1,
    "library_id": 1,
    "filename": "report.pdf",
    "content_type": "application/pdf",
    "description": "Quarterly financial report",
    "content_id": 1,
    "src": "SHAREPOINT",
    "url": "https://example.sharepoint.com/doc.pdf",
    "sp_site_id": "contoso.sharepoint.com,guid1,guid2",
    "sp_drive_id": "b!abcdef123456",
    "sp_drive_item_id": "01ABCDEF1234567890",
    "sp_parent_folder_id": "01ABCDEFPARENT",
    "sp_parent_path": "/Shared Documents/Reports",
    "sp_last_modified_date_time": "2026-06-23T12:00:00Z",
    "sp_import_folder_id": "01ABCDEFIMPORT",
    "autosync": true,
    "import_token": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "import_started_at": "2026-06-23T12:00:00Z",
    "import_finished_at": "2026-06-23T12:05:00Z",
    "import_error": "Permission denied"
  }
]