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

# Generate OTP

> 🙌 Important Note
>
> Please use only **Staging Credentials** on each API Reference page to test the APIs directly from our Documentation.

### API Endpoints

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

> 📘 Aadhaar XML 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#aadhaar-xml)

# 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/aadhaar/otp": {
      "post": {
        "summary": "Generate OTP",
        "description": "",
        "operationId": "kyc_api-upgraded-aadhaar-generate-otp",
        "parameters": [
          {
            "name": "client_id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "client_secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reference_id",
                  "consent",
                  "purpose",
                  "aadhaar_number"
                ],
                "properties": {
                  "reference_id": {
                    "type": "string"
                  },
                  "consent": {
                    "type": "boolean",
                    "default": false
                  },
                  "purpose": {
                    "type": "string"
                  },
                  "aadhaar_number": {
                    "type": "string"
                  }
                }
              },
              "examples": {
                "Success": {
                  "value": {
                    "reference_id": "ABCDEF12345",
                    "consent": true,
                    "purpose": "For Aadhaar Verification",
                    "aadhaar_number": "XXXXXXXX9999"
                  }
                },
                "Failure: Empty Consent": {
                  "value": {
                    "reference_id": "ABCDEF12345",
                    "consent": "sagjknagn",
                    "purpose": "For Aadhaar Verification",
                    "aadhaar_number": "XXXXXXXX9999"
                  }
                },
                "Failure: Empty Purpose": {
                  "value": {
                    "reference_id": "ABCDEF12345",
                    "consent": true,
                    "purpose": "",
                    "aadhaar_number": "XXXXXXXX9999"
                  }
                },
                "Failure: Empty Aadhaar Number": {
                  "value": {
                    "reference_id": "ABCDEF12345",
                    "consent": true,
                    "purpose": "For Aadhaar Verification",
                    "aadhaar_number": ""
                  }
                },
                "Failure: Empty Reference ID": {
                  "value": {
                    "reference_id": "",
                    "consent": true,
                    "purpose": "I am testing this API",
                    "aadhaar_number": "XXXXXXXX9999"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Success": {
                    "value": "{\n    \"decentroTxnId\": \"63745729D13A4640A8818EF2810FC5DB\",\n    \"status\": \"SUCCESS\",\n    \"responseCode\": \"S00000\",\n    \"message\": \"OTP generated and sent successfully on the registered mobile number. Kindly trigger the Validate OTP API within the next 10 minutes.\",\n    \"data\": {\n        \"last3DigitsOfLinkedMobileNumber\": \"*******077\"\n    },\n    \"responseKey\": \"success_otp_generated\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "decentroTxnId": {
                      "type": "string",
                      "example": "63745729D13A4640A8818EF2810FC5DB"
                    },
                    "status": {
                      "type": "string",
                      "example": "SUCCESS"
                    },
                    "responseCode": {
                      "type": "string",
                      "example": "S00000"
                    },
                    "message": {
                      "type": "string",
                      "example": "OTP generated and sent successfully on the registered mobile number. Kindly trigger the Validate OTP API within the next 10 minutes."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "last3DigitsOfLinkedMobileNumber": {
                          "type": "string",
                          "example": "*******077"
                        }
                      }
                    },
                    "responseKey": {
                      "type": "string",
                      "example": "success_otp_generated"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Failure: Empty Consent": {
                    "value": "{\n    \"decentroTxnId\": \"DECXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n    \"status\": \"FAILURE\",\n    \"responseCode\": \"E00009\",\n    \"message\": \"Consent cannot be null or empty. Hint: consent (boolean)\",\n    \"responseKey\": \"error_empty_consent\"\n}"
                  },
                  "Failure: Invalid Consent": {
                    "value": "{\n    \"decentroTxnId\": \"DECXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n    \"status\": \"FAILURE\",\n    \"responseCode\": \"E00009\",\n    \"message\": \"Consent is not of type boolean. Hint: consent (boolean)\",\n    \"responseKey\": \"error_invalid_consent_type\"\n}"
                  },
                  "Failure: Empty Purpose": {
                    "value": "{\n    \"decentroTxnId\": \"DECXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n    \"status\": \"FAILURE\",\n    \"responseCode\": \"E00009\",\n    \"message\": \"Purpose cannot be null or empty. Hint: purpose (string)\",\n    \"responseKey\": \"error_empty_purpose\"\n}"
                  },
                  "Failure: Empty Aadhaar Number": {
                    "value": "{\n    \"decentroTxnId\": \"DECXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n    \"status\": \"FAILURE\",\n    \"responseCode\": \"E00009\",\n    \"message\": \"Aadhaar number cannot be null or empty. Hint: aadhaar_number (string)\",\n    \"responseKey\": \"error_empty_aadhaar_number\"\n}\n"
                  },
                  "Failure: Empty Reference ID": {
                    "value": "{\n    \"decentroTxnId\": \"DECXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n    \"status\": \"FAILURE\",\n    \"responseCode\": \"E00009\",\n    \"message\": \"Request reference ID cannot be null or empty. Hint: reference_id (string)\",\n    \"responseKey\": \"error_empty_reference_id\"\n}"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "Failure: Empty Consent",
                      "type": "object",
                      "properties": {
                        "decentroTxnId": {
                          "type": "string",
                          "example": "DECXXXXXXXXXXXXXXXXXXXXXXXXXXX"
                        },
                        "status": {
                          "type": "string",
                          "example": "FAILURE"
                        },
                        "responseCode": {
                          "type": "string",
                          "example": "E00009"
                        },
                        "message": {
                          "type": "string",
                          "example": "Consent cannot be null or empty. Hint: consent (boolean)"
                        },
                        "responseKey": {
                          "type": "string",
                          "example": "error_empty_consent"
                        }
                      }
                    },
                    {
                      "title": "Failure: Invalid Consent",
                      "type": "object",
                      "properties": {
                        "decentroTxnId": {
                          "type": "string",
                          "example": "DECXXXXXXXXXXXXXXXXXXXXXXXXXXX"
                        },
                        "status": {
                          "type": "string",
                          "example": "FAILURE"
                        },
                        "responseCode": {
                          "type": "string",
                          "example": "E00009"
                        },
                        "message": {
                          "type": "string",
                          "example": "Consent is not of type boolean. Hint: consent (boolean)"
                        },
                        "responseKey": {
                          "type": "string",
                          "example": "error_invalid_consent_type"
                        }
                      }
                    },
                    {
                      "title": "Failure: Empty Purpose",
                      "type": "object",
                      "properties": {
                        "decentroTxnId": {
                          "type": "string",
                          "example": "DECXXXXXXXXXXXXXXXXXXXXXXXXXXX"
                        },
                        "status": {
                          "type": "string",
                          "example": "FAILURE"
                        },
                        "responseCode": {
                          "type": "string",
                          "example": "E00009"
                        },
                        "message": {
                          "type": "string",
                          "example": "Purpose cannot be null or empty. Hint: purpose (string)"
                        },
                        "responseKey": {
                          "type": "string",
                          "example": "error_empty_purpose"
                        }
                      }
                    },
                    {
                      "title": "Failure: Empty Aadhaar Number",
                      "type": "object",
                      "properties": {
                        "decentroTxnId": {
                          "type": "string",
                          "example": "DECXXXXXXXXXXXXXXXXXXXXXXXXXXX"
                        },
                        "status": {
                          "type": "string",
                          "example": "FAILURE"
                        },
                        "responseCode": {
                          "type": "string",
                          "example": "E00009"
                        },
                        "message": {
                          "type": "string",
                          "example": "Aadhaar number cannot be null or empty. Hint: aadhaar_number (string)"
                        },
                        "responseKey": {
                          "type": "string",
                          "example": "error_empty_aadhaar_number"
                        }
                      }
                    },
                    {
                      "title": "Failure: Empty Reference ID",
                      "type": "object",
                      "properties": {
                        "decentroTxnId": {
                          "type": "string",
                          "example": "DECXXXXXXXXXXXXXXXXXXXXXXXXXXX"
                        },
                        "status": {
                          "type": "string",
                          "example": "FAILURE"
                        },
                        "responseCode": {
                          "type": "string",
                          "example": "E00009"
                        },
                        "message": {
                          "type": "string",
                          "example": "Request reference ID cannot be null or empty. Hint: reference_id (string)"
                        },
                        "responseKey": {
                          "type": "string",
                          "example": "error_empty_reference_id"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```