> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trusset.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Execute Hook

> Manually trigger a hook execution

Runs a hook immediately outside its scheduled cycle. For `monitorRisk` hooks, fetches and evaluates the risk URI. For `beforeLiquidation` and `afterLiquidation` hooks, you must provide the relevant data in the request body.

## Path Parameters

<ParamField path="marketId" type="string" required>Market ID.</ParamField>
<ParamField path="hookId" type="string" required>Hook ID.</ParamField>

## Body Parameters

<ParamField body="loanData" type="object">
  Required for `beforeLiquidation` hooks. Object with loan parameters (`healthFactor`, `collateralValue`, etc.).
</ParamField>

<ParamField body="liquidationData" type="object">
  Required for `afterLiquidation` hooks. Object with `loanId`, `auctionId`, `collateralAmount`, `debtOwed`, `borrower`.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.trusset.org/lending-stocks/api/hooks/{marketId}/{hookId}/execute" \
    -H "X-API-Key: trusset_your_key_here" \
    -H "Content-Type: application/json"
  ```
</RequestExample>

<ResponseExample>
  ```json Response (monitorRisk) theme={null}
  {
    "success": true,
    "data": {
      "success": true,
      "result": true,
      "data": { "score": 72 }
    }
  }
  ```

  ```json Response (beforeLiquidation) theme={null}
  {
    "success": true,
    "data": {
      "success": true,
      "result": false,
      "checkResults": [
        { "parameter": "healthFactor", "value": "0.92", "pass": false }
      ]
    }
  }
  ```
</ResponseExample>
