---
updatedAt: 2026-11-12T11:23:56.000Z
agentTools:
  projectIndex: https://docs.decentro.tech/llms.txt
---

# Document Classification

### API Endpoints

| Environment       | Endpoint                                                          |
| :---------------- | :---------------------------------------------------------------- |
| Staging / Sandbox | <https://in.staging.decentro.tech/v2/kyc/document_classification> |
| Production        | <https://in.decentro.tech/v2/kyc/document_classification>         |

> 🚧 Please export Postman Collection to test this API
>
> **Note:** This API cannot be tested here as file upload is not supported in this interface. Please export the Postman Collection to try the API.

> 📘 ID Classification Response Keys
>
> Here are the Response Keys and the scenarios under which Decentro will propagate the same to the platform - [Response Keys](https://docs.decentro.tech/docs/response-keys-kyc#id-classification)

This API identifies the correct document type and matches with the parameter document\_type passed in the request body.

* If the document\_type passed in the request body matches with the document uploaded, it results in a success
* If the document\_type passed in the request body does not match with the document uploaded, it results in a failure

Refer here for [ID Classification Documentation](https://docs.decentro.tech/docs/kyc-and-onboarding-farsight-document-forensics-document-classification)

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "decentro-staging",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://in.staging.decentro.tech"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/v2/kyc/document_classification": {
      "post": {
        "summary": "Document Classification",
        "description": "",
        "operationId": "kyc-and-onboarding-api-reference-farsight-document-forensics-id-classification",
        "parameters": [
          {
            "name": "client_id",
            "in": "header",
            "description": "ID/identifier that is provided by Decentro to a specific client and environment. Please note, this may change based on the environment you are on.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "client_secret",
            "in": "header",
            "description": "The confidential credential provided by Decentro that is associated with the client_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "content-type",
            "in": "header",
            "schema": {
              "type": "string",
              "default": "multipart/form-data"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reference_id",
                  "document_type",
                  "consent",
                  "consent_purpose"
                ],
                "properties": {
                  "reference_id": {
                    "type": "string",
                    "description": "Any unique ID assigned by you for this API request."
                  },
                  "document_type": {
                    "type": "string",
                    "description": "Only capital letters allowed."
                  },
                  "consent": {
                    "type": "string",
                    "description": "Y/N based on the consent given by the customer. Mandatory as per regulation."
                  },
                  "consent_purpose": {
                    "type": "string",
                    "description": "The purpose of taking this consent from your customer. Mandatory as per regulation"
                  },
                  "document": {
                    "type": "string",
                    "format": "binary"
                  },
                  "document_url": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Success": {
                    "value": "{\n    \"decentroTxnId\": \"BC5CD047DB924564AD2B378F5B876963\",\n    \"status\": \"SUCCESS\",\n    \"responseCode\": \"S00000\",\n    \"message\": \"ID classification successful. The document type matches with the document uploaded\",\n    \"data\": {\n        \"documentClassificationStatus\": \"SUCCESS\",\n        \"idTypeClassified\": \"aadhaar\"\n    },\n    \"responseKey\": \"success_id_classification\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "decentroTxnId": {
                      "type": "string",
                      "example": "BC5CD047DB924564AD2B378F5B876963"
                    },
                    "status": {
                      "type": "string",
                      "example": "SUCCESS"
                    },
                    "responseCode": {
                      "type": "string",
                      "example": "S00000"
                    },
                    "message": {
                      "type": "string",
                      "example": "ID classification successful. The document type matches with the document uploaded"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "documentClassificationStatus": {
                          "type": "string",
                          "example": "SUCCESS"
                        },
                        "idTypeClassified": {
                          "type": "string",
                          "example": "aadhaar"
                        }
                      }
                    },
                    "responseKey": {
                      "type": "string",
                      "example": "success_id_classification"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Failure": {
                    "value": "{\n    \"decentroTxnId\": \"6CC495A2A0E14C2EB9DDE08EB4FDCAE3\",\n    \"status\": \"SUCCESS\",\n    \"responseCode\": \"E00009\",\n    \"message\": \"Pass either Document or Document URL, both cannot be null.\",\n    \"responseKey\": \"error_empty_document_url\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "decentroTxnId": {
                      "type": "string",
                      "example": "6CC495A2A0E14C2EB9DDE08EB4FDCAE3"
                    },
                    "status": {
                      "type": "string",
                      "example": "SUCCESS"
                    },
                    "responseCode": {
                      "type": "string",
                      "example": "E00009"
                    },
                    "message": {
                      "type": "string",
                      "example": "Pass either Document or Document URL, both cannot be null."
                    },
                    "responseKey": {
                      "type": "string",
                      "example": "error_empty_document_url"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```