> For the complete documentation index, see [llms.txt](https://docs.cloud.olakrutrim.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloud.olakrutrim.com/api-references/dis-apis.md).

# DIS APIs

## Extract text from a document

> Upload a document (digital or scanned) in Base64 format and extract its text. Returns a \`file\_id\` to track processing status.

```json
{"openapi":"3.1.0","info":{"title":"Krutrim LanguageLabs — Document Intelligence Services (DIS) API","version":"1.0.0"},"tags":[{"name":"Text Extraction","description":"Extract plain text from digital or scanned documents."}],"servers":[{"url":"https://cloud.olakrutrim.com","description":"Production server"}],"paths":{"/v1/document/extract_text":{"post":{"tags":["Text Extraction"],"summary":"Extract text from a document","description":"Upload a document (digital or scanned) in Base64 format and extract its text. Returns a `file_id` to track processing status.","operationId":"extractText","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["file_content","language","file_type"],"properties":{"file_content":{"type":"string","description":"Base64 encoded input document"},"language":{"type":"string","description":"Language of the input document","enum":["english"]},"file_type":{"type":"string","description":"Type of input document","enum":["Digital","Scanned"]}}}}}},"responses":{"200":{"description":"Text extraction initiated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer"},"data":{"type":"object","properties":{"file_id":{"type":"string","description":"The ID to track the status"},"action":{"type":"string"},"file_status":{"type":"string"},"output_type":{"type":"string"}}},"http_status":{"type":"string"},"timestamp":{"type":"integer","description":"Unix timestamp"},"status":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}}},"components":{"responses":{"BadRequest":{"description":"Bad Request — Invalid request format or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"Not Found — The requested resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"UnprocessableEntity":{"description":"Unprocessable Entity — Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"TooManyRequests":{"description":"Too Many Requests — Rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal Server Error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"BadGateway":{"description":"Bad Gateway — Upstream service error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ServiceUnavailable":{"description":"Service Unavailable — Try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ErrorResponse":{"type":"object","required":["status","message","detail"],"properties":{"status":{"type":"string","enum":["failed"]},"message":{"type":"string","description":"Human-readable error summary"},"detail":{"type":"object","description":"Additional diagnostic details","properties":{"info":{"type":"string","description":"Extra context about the error"}}}}}}}}
```

## Extract structured information from a document

> Upload a document (digital or scanned) in Base64 format and extract entities such as PII, NER, or key-value pairs. Optionally specify custom keys to extract.

```json
{"openapi":"3.1.0","info":{"title":"Krutrim LanguageLabs — Document Intelligence Services (DIS) API","version":"1.0.0"},"tags":[{"name":"Information Extraction","description":"Extract PII, NER, and key-value pairs; optionally specific keys."}],"servers":[{"url":"https://cloud.olakrutrim.com","description":"Production server"}],"paths":{"/v1/document/extract_information":{"post":{"tags":["Information Extraction"],"summary":"Extract structured information from a document","description":"Upload a document (digital or scanned) in Base64 format and extract entities such as PII, NER, or key-value pairs. Optionally specify custom keys to extract.","operationId":"extractInformation","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["file_content","language","entities","file_type"],"properties":{"file_content":{"type":"string","description":"Base64 encoded input document"},"language":{"type":"string","description":"Language of the input document","enum":["english"]},"entities":{"type":"array","description":"List of entity types to extract","items":{"type":"string","enum":["PII","NER","key_value"]}},"file_type":{"type":"string","description":"Type of input document","enum":["Digital","Scanned"]},"keys_to_extract":{"type":"array","description":"Optional list of specific keys to extract","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Information extraction initiated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer"},"data":{"type":"object","properties":{"file_id":{"type":"string","description":"The ID to track the status"},"action":{"type":"string"},"file_status":{"type":"string"},"output_type":{"type":"string"}}},"http_status":{"type":"string"},"timestamp":{"type":"integer","description":"Unix timestamp"},"status":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}}},"components":{"responses":{"BadRequest":{"description":"Bad Request — Invalid request format or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"Not Found — The requested resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"UnprocessableEntity":{"description":"Unprocessable Entity — Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"TooManyRequests":{"description":"Too Many Requests — Rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal Server Error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"BadGateway":{"description":"Bad Gateway — Upstream service error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ServiceUnavailable":{"description":"Service Unavailable — Try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ErrorResponse":{"type":"object","required":["status","message","detail"],"properties":{"status":{"type":"string","enum":["failed"]},"message":{"type":"string","description":"Human-readable error summary"},"detail":{"type":"object","description":"Additional diagnostic details","properties":{"info":{"type":"string","description":"Extra context about the error"}}}}}}}}
```

## Summarize a document

> Upload a document (digital or scanned) in Base64 format and generate a summarized version according to the specified word count.

```json
{"openapi":"3.1.0","info":{"title":"Krutrim LanguageLabs — Document Intelligence Services (DIS) API","version":"1.0.0"},"tags":[{"name":"Document Summarization","description":"Generate a condensed summary from an input document."}],"servers":[{"url":"https://cloud.olakrutrim.com","description":"Production server"}],"paths":{"/v1/document/doc_summarization":{"post":{"tags":["Document Summarization"],"summary":"Summarize a document","description":"Upload a document (digital or scanned) in Base64 format and generate a summarized version according to the specified word count.","operationId":"docSummarization","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["file_content","language","file_type","word_count_for_summarization"],"properties":{"file_content":{"type":"string","description":"Base64 encoded input document"},"language":{"type":"string","description":"Language of the input document","enum":["english"]},"file_type":{"type":"string","description":"Type of input document","enum":["Digital","Scanned"]},"word_count_for_summarization":{"type":"integer","description":"Target word count for summarization"}}}}}},"responses":{"200":{"description":"Document summarization initiated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer"},"data":{"type":"object","properties":{"file_id":{"type":"string","description":"The ID to track the status"},"action":{"type":"string"},"file_status":{"type":"string"},"output_type":{"type":"string"}}},"http_status":{"type":"string"},"timestamp":{"type":"integer","description":"Unix timestamp"},"status":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}}},"components":{"responses":{"BadRequest":{"description":"Bad Request — Invalid request format or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"Not Found — The requested resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"UnprocessableEntity":{"description":"Unprocessable Entity — Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"TooManyRequests":{"description":"Too Many Requests — Rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal Server Error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"BadGateway":{"description":"Bad Gateway — Upstream service error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ServiceUnavailable":{"description":"Service Unavailable — Try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ErrorResponse":{"type":"object","required":["status","message","detail"],"properties":{"status":{"type":"string","enum":["failed"]},"message":{"type":"string","description":"Human-readable error summary"},"detail":{"type":"object","description":"Additional diagnostic details","properties":{"info":{"type":"string","description":"Extra context about the error"}}}}}}}}
```

## Mask Personally Identifiable Information in a document

> Upload a document (digital or scanned) in Base64 format and mask sensitive fields like names, positions, and other specified keys.

```json
{"openapi":"3.1.0","info":{"title":"Krutrim LanguageLabs — Document Intelligence Services (DIS) API","version":"1.0.0"},"tags":[{"name":"PII Masking","description":"Mask personally identifiable information (PII) in documents."}],"servers":[{"url":"https://cloud.olakrutrim.com","description":"Production server"}],"paths":{"/v1/document/PII_masking":{"post":{"tags":["PII Masking"],"summary":"Mask Personally Identifiable Information in a document","description":"Upload a document (digital or scanned) in Base64 format and mask sensitive fields like names, positions, and other specified keys.","operationId":"piiMasking","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["file_content","language","file_type","keys_to_mask"],"properties":{"file_content":{"type":"string","description":"Base64 encoded input document"},"language":{"type":"string","description":"Language of the input document","enum":["english"]},"file_type":{"type":"string","description":"Type of input document","enum":["Digital","Scanned"]},"keys_to_mask":{"type":"array","description":"List of keys/fields to be masked in the document","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"PII masking initiated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer"},"data":{"type":"object","properties":{"file_id":{"type":"string","description":"The ID to track the status"},"action":{"type":"string"},"file_status":{"type":"string"},"output_type":{"type":"string"}}},"http_status":{"type":"string"},"timestamp":{"type":"integer","description":"Unix timestamp"},"status":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}}},"components":{"responses":{"BadRequest":{"description":"Bad Request — Invalid request format or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"Not Found — The requested resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"UnprocessableEntity":{"description":"Unprocessable Entity — Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"TooManyRequests":{"description":"Too Many Requests — Rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalServerError":{"description":"Internal Server Error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"BadGateway":{"description":"Bad Gateway — Upstream service error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ServiceUnavailable":{"description":"Service Unavailable — Try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ErrorResponse":{"type":"object","required":["status","message","detail"],"properties":{"status":{"type":"string","enum":["failed"]},"message":{"type":"string","description":"Human-readable error summary"},"detail":{"type":"object","description":"Additional diagnostic details","properties":{"info":{"type":"string","description":"Extra context about the error"}}}}}}}}
```

## Get document status

> Retrieve the status of a document processing request using its \`file\_id\`.

```json
{"openapi":"3.1.0","info":{"title":"Krutrim LanguageLabs — Document Intelligence Services (DIS) API","version":"1.0.0"},"tags":[{"name":"Document Status","description":"Check processing status and output for a submitted document."}],"servers":[{"url":"https://cloud.olakrutrim.com","description":"Production server"}],"paths":{"/v1/document/status":{"get":{"tags":["Document Status"],"summary":"Get document status","description":"Retrieve the status of a document processing request using its `file_id`.","operationId":"getDocumentStatus","parameters":[{"name":"file_id","in":"query","required":true,"description":"The unique ID of the uploaded document.","schema":{"type":"string"}}],"responses":{"200":{"description":"Status retrieved successfully","content":{"application/json":{}}},"422":{"description":"Failed to generate response","content":{"application/json":{}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.cloud.olakrutrim.com/api-references/dis-apis.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
