Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Jatin-Mehra119/PDF-Insight-Beta/llms.txt

Use this file to discover all available pages before exploring further.

PDF Insight Pro provides three session management endpoints that give clients full control over a conversation’s lifecycle. Use them to inspect the messages exchanged so far, reset the conversation without re-uploading the document, or permanently destroy the session and reclaim server storage once you are done.

POST /chat-history

Retrieve the complete chat history for a session as an ordered list of user/assistant message pairs.

Request

Method: POST
Path: /chat-history
Content-Type: application/json
session_id
string
required
The UUID returned by POST /upload-pdf that identifies the session whose history you want to retrieve.
{
  "session_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}

curl example

curl -X POST http://localhost:8000/chat-history \
  -H "Content-Type: application/json" \
  -d '{"session_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"}'

Response

Status: 200 OK
status
string
Always "success" when the session is found.
history
array
Ordered list of conversation turns. Each element is an object with two string fields.
{
  "status": "success",
  "history": [
    {
      "user": "What is the main topic of this document?",
      "assistant": "The document focuses on renewable energy policy frameworks..."
    },
    {
      "user": "Which countries are discussed?",
      "assistant": "The analysis covers the EU, United States, and China..."
    }
  ]
}

Errors

StatusDetail
404Session not found

POST /clear-history

Wipe the chat history for a session while keeping the uploaded PDF and its FAISS index intact. Subsequent /chat calls will start a fresh conversation against the same document.

Request

Method: POST
Path: /clear-history
Content-Type: application/json
session_id
string
required
The UUID of the session whose conversation history you want to clear.
{
  "session_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}

curl example

curl -X POST http://localhost:8000/clear-history \
  -H "Content-Type: application/json" \
  -d '{"session_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"}'

Response

Status: 200 OK
status
string
Always "success" when the history is cleared.
message
string
Always "Chat history cleared".
{
  "status": "success",
  "message": "Chat history cleared"
}

Errors

StatusDetail
404Session not found

POST /remove-pdf

Permanently delete the PDF file and the entire session — including its FAISS index and chat history — from the server. Use this when you are finished with a document and want to free storage.

Request

Method: POST
Path: /remove-pdf
Content-Type: application/json
session_id
string
required
The UUID of the session to remove.
{
  "session_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}

curl example

curl -X POST http://localhost:8000/remove-pdf \
  -H "Content-Type: application/json" \
  -d '{"session_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"}'

Response

Status: 200 OK
status
string
Always "success" when the session is removed.
message
string
Always "PDF file and session removed successfully".
{
  "status": "success",
  "message": "PDF file and session removed successfully"
}

Errors

StatusDetail
404Session not found or could not be removed
This operation is irreversible. Calling /remove-pdf permanently deletes the uploaded PDF file and its associated FAISS index from the server. The session_id becomes invalid immediately, and no further requests can be made against it. If you need to query the same document again you must re-upload it via POST /upload-pdf.

Build docs developers (and LLMs) love