---
agentTools:
  projectIndex: https://mifos.readme.io/llms.txt
---

# Update a Hook

Updates the details of a hook.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Apache Fineract",
    "description": "Apache Fineract is a secure, multi-tenanted microfinance platform\n\nThe goal of the Apache Fineract API is to empower developers to build apps on top of the Apache Fineract Platform<br>The [reference app](https://cui.fineract.dev) (username: mifos, password: password) works on the same demo tenant as the interactive links in this documentation\n\n- The API is organized around [REST](https://en.wikipedia.org/wiki/Representational_state_transfer)\n- Find out more about Apache Fineract [here](/fineract-provider/api-docs/apiLive.htm#top)\n- You can [Try The API From Your Browser](/fineract-provider/api-docs/apiLive.htm#interact)\n- The Generic Options are available [here](/fineract-provider/api-docs/apiLive.htm#genopts)\n- Find out more about [Updating Dates and Numbers](/fineract-provider/api-docs/apiLive.htm#dates_and_numbers)\n- For the Authentication and the Basic of HTTP and HTTPS refer [here](/fineract-provider/api-docs/apiLive.htm#authentication_overview)\n- Check about ERROR codes [here](/fineract-provider/api-docs/apiLive.htm#errors)\n\nPlease refer to the [old documentation](/fineract-provider/api-docs/apiLive.htm) for any documentation queries",
    "contact": {
      "email": "dev@fineract.apache.org"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "1.5.0-39-gc7b9611-dirty"
  },
  "servers": [
    {
      "url": "https://localhost:8443/fineract-provider/api/v1"
    },
    {
      "url": "https://demo.fineract.dev/fineract-provider/api/v1"
    }
  ],
  "security": [
    {
      "basicAuth": [],
      "tenantid": []
    }
  ],
  "tags": [
    {
      "name": "Hooks",
      "description": "Hooks are a mechanism to trigger custom code on the occurence of events. "
    }
  ],
  "paths": {
    "/hooks/{hookId}": {
      "put": {
        "tags": [
          "Hooks"
        ],
        "summary": "Update a Hook",
        "description": "Updates the details of a hook.",
        "operationId": "updateHook",
        "parameters": [
          {
            "name": "hookId",
            "in": "path",
            "description": "hookId",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutHookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PutHookResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Event": {
        "type": "object",
        "properties": {
          "actionName": {
            "type": "string"
          },
          "entityName": {
            "type": "string"
          }
        },
        "example": 1
      },
      "Field": {
        "type": "object",
        "properties": {
          "fieldName": {
            "type": "string"
          },
          "fieldValue": {
            "type": "string"
          },
          "fieldType": {
            "type": "string"
          }
        }
      },
      "PutHookRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Web"
          },
          "isActive": {
            "type": "boolean",
            "example": true
          },
          "displayName": {
            "type": "string",
            "example": "Kremlin"
          },
          "templateId": {
            "type": "integer",
            "format": "int64",
            "example": 1
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            }
          },
          "config": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Field"
            }
          }
        },
        "description": "PutHookRequest"
      },
      "PutHookResponse": {
        "type": "object",
        "properties": {
          "resourceId": {
            "type": "integer",
            "format": "int64",
            "example": 4
          },
          "changes": {
            "$ref": "#/components/schemas/PutHookResponseChangesSwagger"
          }
        },
        "description": "PutHookResponse"
      },
      "PutHookResponseChangesSwagger": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": "string",
            "example": "Kremlin"
          },
          "events": {
            "type": "array",
            "example": 1,
            "items": {
              "$ref": "#/components/schemas/Event"
            }
          },
          "config": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Field"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      },
      "tenantid": {
        "type": "apiKey",
        "name": "fineract-platform-tenantid",
        "in": "header"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 97,
      "1": 32,
      "2": 72,
      "3": 46,
      "4": 61,
      "5": 118,
      "6": 9,
      "7": 0,
      "8": 71,
      "9": 41,
      "10": 139,
      "11": 203
    }
  }
}
```