> For the complete documentation index, see [llms.txt](https://docs.emudhradigital.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emudhradigital.com/documentation/esign-v3-ca-ekyc-account/api-specification.md).

# API Specification

eSign v3 follows CCA **eSign API 3.3**. All payloads are XML over HTTPS, signed with W3C XML-DSig.

## 1. Initiate signing — `<Esign>`

```xml
<Esign ver="3.3" signerid="9876543210@Mobile.emudhra" ts="2026-10-12T10:15:30"
       txn="ASP-20261012-000456" maxWaitPeriod="1440" aspId="ASPXXXX0001"
       responseUrl="https://asp.example.com/esign/v3/callback"
       redirectUrl="https://asp.example.com/esign/v3/done"
       signingAlgorithm="ECDSA">
  <Docs>
    <InputHash id="1" hashAlgorithm="SHA256" docInfo="Board resolution"
               docUrl="https://asp.example.com/docs/123" responseSigType="PKCS7pdf">…hex…</InputHash>
    <InputHash id="2" hashAlgorithm="SHA256" docInfo="Annexure A"
               docUrl="https://asp.example.com/docs/124" responseSigType="PKCS7pdf">…hex…</InputHash>
  </Docs>
  <Signature>…</Signature>
</Esign>
```

| Attribute          | Required | Description                                                                                        |
| ------------------ | -------- | -------------------------------------------------------------------------------------------------- |
| `ver`              | Yes      | `3.3`                                                                                              |
| `signerid`         | No       | `id@id-type.esp-id`; `id-type` = `username`, `Mobile` or `PAN`. Mobile must match the eKYC record. |
| `ts`               | Yes      | ISO 8601, IST, ±30 minutes                                                                         |
| `txn`              | Yes      | Unique per ASP–ESP pair per calendar day                                                           |
| `maxWaitPeriod`    | Yes      | Minutes to wait for the signer (default 1440); expiry → error 113                                  |
| `aspId`            | Yes      | ASP ID                                                                                             |
| `responseUrl`      | Yes      | Receives final `EsignResp` via HTTP(S) POST, `application/xml`                                     |
| `redirectUrl`      | No       | Browser return URL; eMudhra POSTs `txnref` = Base64(\`txn                                          |
| `signingAlgorithm` | Yes      | `RSA` or `ECDSA`; also determines the DSC key algorithm                                            |

### `<InputHash>`

| Attribute         | Required | Description                                      |
| ----------------- | -------- | ------------------------------------------------ |
| `id`              | Yes      | Sequential from 1, max 5, no repeats             |
| `hashAlgorithm`   | Yes      | `SHA256`                                         |
| `docInfo`         | Yes      | ≤ 50 characters, shown to signer                 |
| `docUrl`          | Yes      | Link to view the document during the wait period |
| `responseSigType` | Yes      | `raw`, `PKCS7`, `PKCS7pdf`, `PKCS7complete`      |

## 2. Response — `<EsignResp>`

```xml
<EsignResp ver="3.3" status="1" ts="…" txn="ASP-20261012-000456" resCode="…" error="">
  <UserX509Certificate>…base64…</UserX509Certificate>
  <Signatures>
    <DocSignature id="1" sigHashAlgorithm="SHA256" error="">…</DocSignature>
    <DocSignature id="2" sigHashAlgorithm="SHA256" error="206"></DocSignature>
  </Signatures>
  <Signature>…</Signature>
</EsignResp>
```

| Field                | Description                                          |
| -------------------- | ---------------------------------------------------- |
| `status`             | `1` success, `0` failure, `2` pending                |
| `resCode`            | eMudhra reference, constant for the transaction      |
| `error`              | Transaction-level error code; blank on success       |
| `DocSignature@error` | Document-level error (e.g., `206` cancelled by user) |

## 3. Status check — `<EsignStatus>`

```xml
<EsignStatus ver="3.3" ts="2026-10-12T11:00:00" txn="ASP-20261012-000456" aspId="ASPXXXX0001">
  <Signature>…</Signature>
</EsignStatus>
```

Returns an `EsignResp` (status 1, 0 or 2). Available for at least 30 days after the transaction.
