Skip to main content

Confirm Document Upload

POST 

/v1/:workspace_id/upload/confirm

Confirm a document upload and sends document metadata and final path. Start extraction if is original file.

Args: workspace_id (str): The ID of the workspace to upload the document to. document_metadata_confirm (DocumentMetadataCreate): The document metadata to be uploaded. metadata_repository (DocumentMetadataRepository): The repository for managing document metadata. document_repository (DocumentRepository): The repository for managing documents. user (TokenData): The token data of the authenticated user.

Body:

    {
"temp_key": "string",
"folder": "Optionsl[string]",
"document_metadata": {
"name": "string", #filename with extension
"tags": [
"string"
],
"categories": [
"string"
],
"summary": "string",
"slots": "dict" # custom metadata
"access": {
"curators": [string] # curator emails
}
"collection_id": "string | If added to a workspace collection",
"is_original": "bool | Defaults to true",
"original_file_id": "Optional[string]"
"connector_id": "string | If added from a connector",
"chat_id": "string | If added to a chat collection",
"chat_session": Optional {
"workspace_id": "018f4e6b-3c00-7232-9717-dcfd79e68aba",
"channel": "aumorag",
"channel_plugin": "web",
"channel_id": "018f4e6b-3e48-7f58-9673-b3aab57e37de",
"channel_session_id": "018f4e6b-4060-75cf-b9e8-e6dabce743b6"
},
"source_url": "string | None, the url of the document (if it exists)"
}
}

Returns

DocumentMetadataRead: The uploaded document metadata.

Important observations:

  • It is necessary to provide one of collection_id, chat_id or chat_session. Otherwise, the file will not be uploaded.
  • If is_original is True, the extraction process will be started.
  • If the file already exists with the same name and hash, the file will not be uploaded again but its metadata will be updated.
  • If the file already exists with the same name but different hash, the file will be updated.

Request

Responses

Successful Response