> ## 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.

# Toggle Hook

> Enable or disable a hook without deleting it

Sets the `active` flag. Inactive hooks are skipped by the scheduler and by liquidation processing, and are not reachable as chained triggers. Execution history is preserved.

## Path Parameters

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

## Body Parameters

<ParamField body="active" type="boolean" required>
  `true` to enable, `false` to disable. Any non-boolean value returns `INVALID_ACTIVE`.
</ParamField>

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

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "id": "hook_003",
      "active": false
    }
  }
  ```

  ```json Error - Invalid Body theme={null}
  {
    "success": false,
    "error": {
      "code": "INVALID_ACTIVE",
      "message": "active must be boolean"
    }
  }
  ```
</ResponseExample>
