# Ask Document Question

The "Ask Document Question" endpoint allows you to ask specific questions about a document stored in Google Drive. By specifying the document ID and providing a question prompt, the AI will analyze the content of the document and return an answer based on the information within.

### Endpoint

```bash
POST /v1/drive/document-question
```

### Parameters

* **document\_id** (required, string): The ID of the document you want to query. This ID can be obtained from the Document Index or directly from the Google Drive URL.

  Example URL: `https://drive.google.com/file/d/1X2Y3Z4A5B6C7D8E9F/view`

  In this example, the document ID is `1X2Y3Z4A5B6C7D8E9F`.
* **question** (required, string): The specific question you want to ask about the document (e.g., "What are the key financial highlights in this report?").

**Note:** The user must be logged in with an account that is authorized to access the specified document in Google Drive.

### Example Request

```http
POST /v1/drive/document-question
{
  "document_id": "1X2Y3Z4A5B6C7D8E9F",
  "question": "What are the key financial highlights in this report?"
}
```

### Example Response

```json
jsonCopy code{
  "document_id": "1X2Y3Z4A5B6C7D8E9F",
  "question": "What are the key financial highlights in this report?",
  "answer": "The key financial highlights in this report include a 10% increase in revenue, a 5% reduction in operational costs, and a 15% year-over-year growth in net profit."
}
```

### Usage Notes

* **Document ID Retrieval:** You can obtain the document ID from the Google Drive URL or through the Document Index endpoint.
* **Question Prompt:** Be specific in your question to receive the most accurate and relevant information from the document.
* **Authorization:** Ensure that you are logged in with an account that has access to the document you are querying.

### Example Use Case: Due Diligence Document Query

During a due diligence process, it may be necessary to extract specific pieces of information from lengthy reports or agreements. By using the "Ask Document Question" endpoint, you can quickly retrieve targeted answers from documents stored in Google Drive, saving time and ensuring accuracy in your review process.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.corpdev.ai/corpdev.ai-docs/document-api/ask-document-question.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
