Get started

     API Endpoint
 
         https://documind.onrender.com/
                 

The Chatpdf.so API provides programmatic access to your Chatpdf.so account. Chat with pdfs, get documents, upload documents, delete documents, get summary etc.

To use this API, you need an API key. Please go to your profile https://chatpdf.so/dashboard/profile to get your own API key.

Upload file


 # Here is a curl example for upload file
 curl \
 -X POST http://documind.onrender.com/api-upload-file \
 -F 'secretkey=your_api_key' \
 -F 'file=example.pdf' \
                 

To upload file you need to make a POST call to the following url:
http://documind.onrender.com/api-upload-file
If you want to upload your file in a specific folder then pass a folder_id in request body.



 Result example :
 
 {
    idOfDocument: "00cff8a7-5df6-49fe-8e5c-aae039482855",
    status_message: "PDF uploaded",
    file_url: "https://storage.google.chatpdf.so/documents/00cff8a7-5df6-49fe-8e5c-aae039482855.pdf",
    status: 200
 }
                 

QUERY PARAMETERS

Field Type Description
secretkey String Your API key.
file Blob pdf file blob

chat with documents


 # Here is a curl example for ask from collection
 curl \
 -X POST http://documind.onrender.com/api-ask-from-collection \
 -F 'secretkey=your_api_key' \
 -F 'question=What is the distance between railway stations?' \
 -F 'document_id=bn4e728b-c3f8-ye32-802a-j5a1f1d965d5' \
 -F 'folder_id=a07e798b-z3f8-ge32-202a-r5a1f1d965d5' \
 -F 'enable_gpt4=true' \

                 

Using this endpoint you can chat with all documents, one specific document or one specific folder.
If you want to chat with one specific document then pass document_id in request body
If you want to chat with a specific folder then pass folder_id in request body
If you want to chat with all documents then don't pass anything
If you want to use GPT4 then pass enable_gpt4=true in request body.
To use this endpoint you need to make a POST call to the following url :
http://documind.onrender.com/api-ask-from-collection



 Result example :
 
 {
  
    "data": {
        "answer": "To find the distance of the nearest railway station to Chendamangalam, we have to carefully read the text and identify the relevant information. The text mentions that the nearest railway station to Chendamangalam is Ernakulam, and it is located about 29 km from Chendamangalam. Therefore, the distance of the nearest railway station to Chendamangalam is approximately 29 km. This distance is important for travelers who are planning to visit Chendamangalam and need to consider transportation options.",
        "index": 0,
        "documents": [
          {
            "id": "a07e798b-d3f8-4e32-902a-65a1f1d965d5_SOGLCgSDNqPVUAg0dk8pPcJY5t13_3",
            "file": "ernakulam.pdf",
            "page": 0,
            "score": 0.790646374,
            "paragraph": "situated next to each other. They stand testimony to the spirit of religious tolerance and harmonious co- existence of the people here.  How to reach  The nearest railway station is Ernakulam, located about 29 km from Chendamangalam. The nearest airport, Cochin International Airport Ltd. (CIAL), is about 23 km away.  Chendamangalam  20 ERNAKULAM  God’s Own Country  www.keralatourism.org Page number: 23, File name: ernakulam.pdf",
            "file_url": "https://storage.googleapis.com/chatpdf-so.appspot.com/documents/a07e798b-d3f8-4e32-902a-65a1f1d965d5.pdf"
          },
          {
            "id": "d09c14cc-6c2d-4de1-bd75-f787043c59df_SOGLCgSDNqPVUAg0dk8pPcJY5t13_1",
            "file": "ticket.pdf",
            "page": 0,
            "score": 0.779029489,
            "paragraph": "from the TTE /Conductor in case of (a) PARTIALLY waitlisted e- \u0000 cket when LESS NO. OF PASSENGERS travel In case, on a party e- \u0000 cket or a family e- \u0000 cket issued for travel of more than one passenger, some passengers have Print ERS Without Advertisements",
            "file_url": "https://storage.googleapis.com/chatpdf-so.appspot.com/documents/d09c14cc-6c2d-4de1-bd75-f787043c59df.pdf"
          }
        ]
      },
      "status": 200
 }
                 

QUERY PARAMETERS

Field Type Description
secretkey String Your API key.
question String Question you want to ask.
document_id String Put document id here.
folder_id String Put folder id here.
enable_gpt4 Boolean Set to true to use GPT4.

chat with documents stream


 # Here is a curl example for ask from collection stream. 
 curl \
 -X POST http://documind.onrender.com/api-ask-from-collection-stream \
 -F 'secretkey=your_api_key' \
 -F 'question=Where is NYC city located?' \
 -F 'document_id=bn4e728b-c3f8-ye32-802a-j5a1f1d965d5' \
 -F 'folder_id=a07e798b-z3f8-ge32-202a-r5a1f1d965d5' \
 -F 'enable_gpt4=true' \

                 

This is the streaming version of /api-ask-from-collection. It follows the Server-sent events (SSE) format. It will stream the answer one by one.
Using this endpoint you can chat with all documents, one specific document or one specific folder.
If you want to chat with one specific document then pass document_id in request body
If you want to chat with a specific folder then pass folder_id in request body
If you want to chat with all documents then don't pass anything
If you want to use GPT4 then pass enable_gpt4=true in request body.
To use this endpoint you need to make a POST call to the following url :
http://documind.onrender.com/api-ask-from-collection-stream



 Result example :
 
 data:{"data":{"answer":"The","index":0,"documents":[{"id":"f519377c-5b87-4871-9932-are43ccf6668_SOGLCgSDNqPVUAg5dk8pPcJY5t13_1","file":"Share_Holder_Agreement.pdf","page":0,"score":0.733903646,"paragraph":"to;  Shares   ordinary shares of £0.000001 each in the capital of the Company; andStart modification of or amendment to it, and all  statutory instruments or orders made under it;  g. reference to the time of day is to a time in London; and  h. reference to   writing   or   written   includes faxes and email but not any other type of electronic  communication.  3. The headings in this document are for convenience only and do not affect the interpretation of this  Agreement.  PRELIMINARIES  Start and duration  5. This Agreement:  a. takes effect on the Start Date;  b. will continue in effect until the Company's winding up begins; and  c. will bind each Shareholder as long as he continues to be a Shareholder, but subject to the  Miscellaneous Section below.  6. The Company will carry on the Business and continue until wound up in line with the Act.  Administration  7. The Directors of the Company will initially be the individuals listed in Schedule 3.  8. Unless otherwise agreed by the Board:  a. the registered office of the Company will be 167c Jerningham Road, New Cross, London, SE145N  Articles of association  9. On the Start Date the Company's Articles are modified Model Articles.","file_url":"https://storage.chatpdf.so/documents/f519327c-5b87-4871-9932-ade43ccf6668.pdf"},{"id":"f519377c-5b87-4871-9932-ade43cxf6668_SOGLCgSDNqPVUAgxdk8pPcJY5t13_2","file":"Share_Holder_Agreement.pdf","page":0,"score":0.720264196,"paragraph":"will be  emailed by the authorising Director(s).any Shareholder are  outstanding.  SHARES  Issues of additional Shares  23. If the Company wishes to issue Shares in addition to those provided for in this Agreement, the  Shareholders will ensure (as far as lawfully possible) that the Company gives notice to each Shareholder  stating the number of Shares to be issued and the issue price per Share (the   Issue Notice ).  24. Each Shareholder can (but is not obliged to)","file_url":"https://storage.chatpdf.so/documents/f519377c-5b87-4871-9932-ade42ccf6668.pdf"},{"id":"a07e798b-d3f8-4e32-912a-65a1f1d965d5_SOGLCgSDNqzVUAg0dk8pPcJY5t13_4","file":"ernakulam.pdf","page":0,"score":0.71586895,"paragraph":"","file_url":"https://storage.chatpdf.so/documents/a07e798b-d3f8-4e32-902a-65a1f1d965d5.pdf"}]},"status":200}

 data:{"data":{"answer":"The NYC","index":0,"documents":[{"id":"f519377c-5b87-4871-9932-are43ccf6668_SOGLCgSDNqPVUAg5dk8pPcJY5t13_1","file":"Share_Holder_Agreement.pdf","page":0,"score":0.733903646,"paragraph":"to;  Shares   ordinary shares of £0.000001 each in the capital of the Company; andStart modification of or amendment to it, and all  statutory instruments or orders made under it;  g. reference to the time of day is to a time in London; and  h. reference to   writing   or   written   includes faxes and email but not any other type of electronic  communication.  3. The headings in this document are for convenience only and do not affect the interpretation of this  Agreement.  PRELIMINARIES  Start and duration  5. This Agreement:  a. takes effect on the Start Date;  b. will continue in effect until the Company's winding up begins; and  c. will bind each Shareholder as long as he continues to be a Shareholder, but subject to the  Miscellaneous Section below.  6. The Company will carry on the Business and continue until wound up in line with the Act.  Administration  7. The Directors of the Company will initially be the individuals listed in Schedule 3.  8. Unless otherwise agreed by the Board:  a. the registered office of the Company will be 167c Jerningham Road, New Cross, London, SE145N  Articles of association  9. On the Start Date the Company's Articles are modified Model Articles.","file_url":"https://storage.chatpdf.so/documents/f5193772-5b87-4871-9932-ade43ccf6668.pdf"},{"id":"f519377c-5b87-4871-9932-ade43cxf6668_SOGLCgSDNqPVUAgxdk8pPcJY5t13_2","file":"Share_Holder_Agreement.pdf","page":0,"score":0.720264196,"paragraph":"will be  emailed by the authorising Director(s).any Shareholder are  outstanding.  SHARES  Issues of additional Shares  23. If the Company wishes to issue Shares in addition to those provided for in this Agreement, the  Shareholders will ensure (as far as lawfully possible) that the Company gives notice to each Shareholder  stating the number of Shares to be issued and the issue price per Share (the   Issue Notice ).  24. Each Shareholder can (but is not obliged to)","file_url":"https://storage.chatpdf.so/documents/f519377c-5287-4871-9932-ade43ccf6668.pdf"},{"id":"a07e798b-d3f8-4e32-912a-65a1f1d965d5_SOGLCgSDNqzVUAg0dk8pPcJY5t13_4","file":"ernakulam.pdf","page":0,"score":0.71586895,"paragraph":"","file_url":"https://storage.chatpdf.so/documents/a07e798b-d3f8-4e32-902a-65a1f1d965d5.pdf"}]},"status":200}

 data:{"data":{"answer":"The NYC is","index":0,"documents":[{"id":"f519377c-5b87-4871-9932-are43ccf6668_SOGLCgSDNqPVUAg5dk8pPcJY5t13_1","file":"Share_Holder_Agreement.pdf","page":0,"score":0.733903646,"paragraph":"to;  Shares   ordinary shares of £0.000001 each in the capital of the Company; andStart modification of or amendment to it, and all  statutory instruments or orders made under it;  g. reference to the time of day is to a time in London; and  h. reference to   writing   or   written   includes faxes and email but not any other type of electronic  communication.  3. The headings in this document are for convenience only and do not affect the interpretation of this  Agreement.  PRELIMINARIES  Start and duration  5. This Agreement:  a. takes effect on the Start Date;  b. will continue in effect until the Company's winding up begins; and  c. will bind each Shareholder as long as he continues to be a Shareholder, but subject to the  Miscellaneous Section below.  6. The Company will carry on the Business and continue until wound up in line with the Act.  Administration  7. The Directors of the Company will initially be the individuals listed in Schedule 3.  8. Unless otherwise agreed by the Board:  a. the registered office of the Company will be 167c Jerningham Road, New Cross, London, SE145N  Articles of association  9. On the Start Date the Company's Articles are modified Model Articles.","file_url":"https://storage.chatpdf.so/documents/f519277c-5b87-4871-9932-ade43ccf6668.pdf"},{"id":"f519377c-5b87-4871-9932-ade43cxf6668_SOGLCgSDNqPVUAgxdk8pPcJY5t13_2","file":"Share_Holder_Agreement.pdf","page":0,"score":0.720264196,"paragraph":"will be  emailed by the authorising Director(s).any Shareholder are  outstanding.  SHARES  Issues of additional Shares  23. If the Company wishes to issue Shares in addition to those provided for in this Agreement, the  Shareholders will ensure (as far as lawfully possible) that the Company gives notice to each Shareholder  stating the number of Shares to be issued and the issue price per Share (the   Issue Notice ).  24. Each Shareholder can (but is not obliged to)","file_url":"https://storage.chatpdf.so/documents/f519377c-5b87-4871-9932-ade43ccf6668.pdf"},{"id":"a07e798b-d3f8-4e32-912a-65a1f1d965d5_SOGLCgSDNqzVUAg0dk8pPcJY5t13_4","file":"ernakulam.pdf","page":0,"score":0.71586895,"paragraph":"","file_url":"https://storage.chatpdf.so/documents/a07e798b-d3f8-4e32-902a-65a1f1d965d5.pdf"}]},"status":200}

                 

QUERY PARAMETERS

Field Type Description
secretkey String Your API key.
question String Question you want to ask.
document_id String Put document id here.
folder_id String Put folder id here.
enable_gpt4 Boolean Set to true to use GPT4.

get documents


 # Here is a curl example for get documents
 curl \
 -X POST http://documind.onrender.com/api-get-documents \
 -F 'secretkey=your_api_key' \

                 

To get all your uploaded documents you need to make a POST call to the following url :
http://documind.onrender.com/api-get-documents



 Result example :
 
 {
    "data": {
        "list": [
          {
            "file_url": "https://storage.googleapis.com/chatpdf-so.appspot.com/documents/a07e798b-d3f8-4e32-902a-65a1f1p965d5.pdf",
            "chunks": [],
            "file_name": "ernakulam.pdf",
            "extracted_text": "",
            "user_id": "SOGLCgSDNqPVUpg0dk8pPcJY5t13",
            "id": "a07e798b-d3f8-4e32-902a-65a1f1k965d5",
            "folder_id": "",
            "timestamp": 1706017430001,
            "chunks_count": 5,
            "tokens": 3632,
            "status_message": "PDF Processed",
            "status": 200,
            "suggestions": [
              "What are some of the activities and attractions in Kumbalangi?",
              "How can tourists reach the Kodanad Elephant Camp?"
            ]
          }
        ]
    },
    "status": 200
}
                 

QUERY PARAMETERS

Field Type Description
secretkey String Your API key.

delete document


 # Here is a curl example to delete a document
 curl \
 -X POST http://documind.onrender.com/api-delete-document \
 -F 'secretkey=your_api_key' \
 -F 'documentId=document id' \
                 

To delete a document you need to make a POST call to the following url :
http://documind.onrender.com/api-delete-document



 Result example :
 
 {
    "data": "Document deleted",
    "status": 200
 }
                 

QUERY PARAMETERS

Field Type Description
secretkey String Your API key.
documentId String Id of document

get all conversations


 # Here is a curl example to get all conversation
 curl \
 -X POST http://documind.onrender.com/api-get-collection-conversations \
 -F 'secretkey=your_api_key' \

                 

To get "Chat with all documents" conversations you need to make a POST call to the following url :
http://documind.onrender.com/api-get-collection-conversations



 Result example :
 
 {
    "data": {
      "list": [
        {
          "user_id": "SOGLCgSDNqPVUAg0dk8pPcJY5t13",
          "id": "534b0cad-3e42-4f02-adec-8fb4246f8079",
          "message": {
            "answer": "No, a UCITS cannot invest in gold as mentioned in paragraph 2(b)",
            "documents": [],
            "index": 1
          },
          "is_bot": true,
          "document_id": null,
          "folder_id": null,
          "timestamp": 1706170548025
        },
        {
            "user_id": "SOGLCgSD4qPVUAg0dk6pPcJY5t13",
            "id": "8e72eq21-3507-44e4-b6f3-0137eba8cdab",
            "message": "can a ucits invest in gold?",
            "is_bot": false,
            "document_id": null,
            "folder_id": null,
            "timestamp": 1706170536897
        }
        ]
    },
    "status": 200
}

                 

QUERY PARAMETERS

Field Type Description
secretkey String Your API key.

get document conversations


 # Here is a curl example to get document conversation
 curl \
 -X POST http://documind.onrender.com/api-get-document-conversations \
 -F 'secretkey=your_api_key' \
 -F 'documentId=30195b07-7f1e-4c4c-9de1-c9d042247afb' \

                 

To get document conversations you need to make a POST call to the following url:
http://documind.onrender.com/api-get-document-conversations



 Result example :
 
 {
    "data": {
      "list": [
        {
          "user_id": "SOGLCgSDNqPVUAg0dk8pPcJY5t13",
          "id": "534b0cad-3e42-4f02-adec-8fb4246f8079",
          "message": {
            "answer": "No, a UCITS may not invest in gold as mentioned in paragraph 2(d)",
            "documents": [],
            "index": 1
          },
          "is_bot": true,
          "document_id": "30196b97-7f1e-4c4c-9de1-c9d042247afb",
          "folder_id": null,
          "timestamp": 1706170548025
        },
        {
            "user_id": "SOGLCgSD4qPVUAg0dk6pPcJY5t13",
            "id": "8e72eq21-3507-44e4-b6f3-0137eba8cdab",
            "message": "can a ucits invest in gold?",
            "is_bot": false,
            "document_id": "30196b97-7f1e-4c4c-9de1-c9d042247afb",
            "folder_id": null,
            "timestamp": 1706170536897
        }
        ]
    },
    "status": 200
}

                 

QUERY PARAMETERS

Field Type Description
secretkey String Your API key.
documentId String document Id

get folder conversations


 # Here is a curl example to get folder conversation
 curl \
 -X POST http://documind.onrender.com/api-get-folder-conversations \
 -F 'secretkey=your_api_key' \
 -F 'folderId=a53232d9-511b-4ab2-861c-af88414bd73e' \

                 

To get folder conversations you need to make a POST call to the following url:
http://documind.onrender.com/api-get-folder-conversations



 Result example :
 
 {
    "data": {
      "list": [
        {
          "user_id": "SOGLCgSDNqPVUAg0dk8pPcJY5t13",
          "id": "534b0cad-3e42-4f02-adec-8fb4246f8079",
          "message": {
            "answer": "No, a UCITS man not invest in precious metal such as gold as mentioned in paragraph 2(d)",
            "documents": [],
            "index": 1
          },
          "is_bot": true,
          "document_id": null,
          "folder_id": "a53232d9-511b-4ab2-861c-af88414bd73e",
          "timestamp": 1706170548025
        },
        {
            "user_id": "SOGLCgSD4qPVUAg0dk6pPcJY5t13",
            "id": "8e72eq21-3507-44e4-b6f3-0137eba8cdab",
            "message": "can a ucits invest in gold?",
            "is_bot": false,
            "document_id": null,
            "folder_id": "a53232d9-511b-4ab2-861c-af88414bd73e",
            "timestamp": 1706170536897
        }
        ]
    },
    "status": 200
}

                 

QUERY PARAMETERS

Field Type Description
secretkey String Your API key.
folderId String folder Id

get summary


 # Here is a curl example to get summary
 curl \
 -X POST http://documind.onrender.com/api-get-summary \
 -F 'secretkey=your_api_key' \
 -F 'documentId=u53232d9-511b-4ab2-861c-af88414bd73e' \

                 

To get summary you need to make a POST call to the following url:
http://documind.onrender.com/api-get-summary



 Result example :
 
 {
    "data": {
      "answer": "• 1: 5-year-old children population living in one of the poorest areas.  Comparing both the categories for a moderate sample size of 100, the mean of variable 1 exceeds the variable 0 by 1.6 units approximately.",
      "index": 0,
      "documents": []
    },
    "status": 200
  }

                 

QUERY PARAMETERS

Field Type Description
secretkey String Your API key.
documentId String document Id

Errors

The Chatpdf.so API uses the following error codes:

Error Code Meaning
500 Server related or OpenAI error. The error message will be shown to you.
402 Billing error.