Documents

List documents.

List documents for a given user. If sort_column is not specified, the output is sorted by by last update time in descending order.

get/documents

Request

Query parameters

offsetinteger

How many documents to skip before returning.

limitinteger

How many documents to return.

sort_column'name' | 'username' | 'type' | 'size' | 'page_count' | 'connector' | 'uri' | 'original_type' | 'original_mtime' | 'status' | 'updated_at'

Sort column.

ascendingboolean

When true, returns sorted by sort_column in ascending order.

with_summariesboolean

When true, returns also summary and summary_parameter with other common attributes of the document.

metadata_filterstring

String containing metadata json dict to filter collections by metadata.

usernamestring

Filter documents by the username of the uploader (exact match).

statusstring

Filter documents by ingestion status (exact match). Values: unknown, scheduled, queued, running, completed, failed, canceled, agent_only.

sourcestring

Filter documents by connector source (case-insensitive match, e.g. SharePoint, url, upload, Agent).

chat_session_idstring

Filter to the documents generated by this chat session. Only agent-generated files record a source session, so any value excludes every user-uploaded document. Pair with the same parameter on /documents/count to page a filtered list.

group_by_source_chatboolean

When true, order by the source chat session first, so every page returns whole, contiguous groups; sort_column then orders rows within each group. Documents with no source chat come last.

Response

Successful operation

idstring required

A unique identifier of the document

namestring required

Name of the document

usernamestring required

A username owning the document

typestring required

Type of the document

sizeinteger required

Size of the document in bytes

page_countinteger required

A number of pages contained in the document

status'unknown' | 'scheduled' | 'queued' | 'running' | 'completed' | 'failed' | 'canceled' | 'agent_only' required

Status of the document

usage_statsstring

Usage stats

connectorstring
original_typestring
original_mtimestring datetime
created_atstring date-time required

Time when document was created

updated_atstring date-time required

Last time when document was modified

uristring
summarystring
summary_parametersstring
metadata_dictMetadata
is_encryptedboolean

Whether the document files are encrypted at rest

chat_session_idstring

A unique identifier of the chat session that generated the document. Returned by GET /documents. Only set for agent-generated files, null for user-uploaded documents.

chat_session_namestring

Name of the chat session that generated the document. Returned by GET /documents. Null when the document was not generated by an agent, or when the session is not visible to the caller.

chat_session_visibleboolean

Whether the caller can open the chat session that generated the document. Returned by GET /documents. Distinct from chat_session_name being null, which also happens when a visible session has no name yet.

Example response

[
  {
    "id": "123e4567-e89b-12d3-a456-426655440000",
    "name": "The Hitchhiker's Guide to the Galaxy",
    "chat_session_id": "123e4567-e89b-12d3-a456-426655440000"
  }
]

Changes

No recorded changes to this operation across all 1 revision of this API.