---
id: entity-hook-request-update
title: "Respond to an entity hook"
description: "Responds to an entity hook. Send this request to the `callback_url` from the hook notification once your logic has run."
sidebar_label: "Respond to an entity hook"
hide_title: true
hide_table_of_contents: true
api: eJztWFGP2zYS/isDvrQNtF5v4k17ejhgm0uRFGgTZDdogd3FeiyOLXYpUiUpe13Db/d+f+fu7/QP3F84DCnZktfNXYv0Djj0RZal0XDmm/lmhtwISb5wqg7KGpGLd+Rra6SHYAENkAkqrKG09n4El2QkhFJ5cPRjQz6wUCgJpgVqPcPi/q5xegpzZ6v4nD8DY4OaqwJ5AbCmIFjbxoG2C1VAiR5cY0Y35sZcsSYfMDR+yjLgeT1JhZLkobQrMI3WtcYwt64CR76pyMeFWjNtTS6uM4ILKXtmzaxcT9naEo2EuSItPfCbzoOkIOf7NaAjqMgtSIIyrUBTSww0tIDt87AqyYAKnT0ZeAsIM5pbRycRAWtginWtWxDywhEGmkKBJoO5dUAPWNWastbZuKCj2noVrFvHv73vQXlIKti+CN2f4ee//uOff/8bPHnyrQ2UP3kCb4xeQ01GKrOIgfC8Hsw6V+QIvko4HPgUPKjgSc8z8E1RAg4g7gKUQcB7gtpRQZI4qnZJ7hDy0Y0RmQi48CK/Fi/3ySRuM7GL1mspcpH03/HLuza98mSpyESNDisK5FjPRijO1BpDKTJhsCKRCyVFJnxRUoUi34iwrvmpD06ZhcgE+4ZB5KJplBTbTPASypEUeXANZQcs4FR8/Rew877rMZataRnDwr6rZYzC8XQfiUy0sRW5OD8f0xeT8fiEnv5pdjI5k5MT/Pzs+clk8vz5+flkMh6Px2J7mwlPReNUWEdfZ4SO3EUTSpFf3/Lr1oQvrVyzq4U1gUzg216SnP7g2ZPNY0zs7AcqAoPqOAJBkY9yMa7HsCPTVBw+3xQFec9ootLEgDsqOOw403THDxvH0SrQFKRZ4vYYsLYJha2I0Y2VIMIWy8EIXoffRvicWXAC09bGaX5UCmpnCyLpR1E4uTGUJcNZFkufc9YBw0JJ/Iiz0xxqdEGhhvbJCK72yhxV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z5/44V7KwzqO+S0F2C7L/Gj9ft8tCmzkuWSUy5TO0E3htcotKs9RFhjn7+u1LnwkBj6KFOjTW5ZIuicY4b/ltNyH3YrQEXqAxoDOQ61kS7Qmll2u8WZdwL81ZQnPY2zKcbJbe8/40+pT3ysP1irUb9oYIb8WCveclcSSne33HuwGBF3Q471sYoJLL25qtuf/31d1dx1mMOvttvVF/uR4Ruo9nbT+73Ite7kb6b3Hdx+aUReDABDyfS2yMz5+8/oWTJ9HwjOBgpac5G49FY7EeX/lHINhO19aHCWLTa84z2HO7xMdxhPvYOAP44vPvj8O7jH94l/gd6CKe1RmU4XyNzNm0puu6f3YlM5Coe/JTWB3652czQ03unt1t+/GNDjk+2bjOxRKe4SEfaS+X5Xop8jtofbvj6Wf7pu7Z7fwYf8ZzuqJ/dwYjhY5El6ob/iUzc0zqdOW5vt5koCSW56EV68SLZenLFn+8/fDSjbLPui4u4F/yg7G2vF7y9uHrxiotvW9SqOAgIhysebnCVrLQRvFi14rON0GgWTaqmSSlXKxxW+oPKHt06isNmkySu7D2Z7XYHS+D/jMx2+y90iJvF
sidebar_class_name: "patch api-method"
info_path: docs/api/entity-hook
custom_edit_url: null
---

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import ParamsDetails from "@theme/ParamsDetails";
import RequestSchema from "@theme/RequestSchema";
import StatusCodes from "@theme/StatusCodes";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";
import Heading from "@theme/Heading";

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Respond to an entity hook"}
>
</Heading>

<MethodEndpoint
  method={"patch"}
  path={"/entity_hook/{id}"}
  context={"endpoint"}
>
  
</MethodEndpoint>



Responds to an entity hook. Send this request to the `callback_url` from the hook notification once your logic has run.

The `status` you send decides how nullplatform resumes the entity operation. Add `callback_body` to hand fields back to the entity: they are merged into the update nullplatform sends when it resumes, so a before-hook on `application:create` can, for example, decide the repository the application is created in.

> ℹ️ **Note:** Only pending hooks can be updated. Fields nullplatform sets itself, such as the entity `status`, take precedence over `callback_body`.


<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={[{"in":"path","name":"id","schema":{"type":"string","format":"uuid"},"required":true,"description":"The ID of the entity hook request, as received in the hook notification.","example":"550e8400-e29b-41d4-a716-446655440000"}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["success","failed","recoverable_failure","cancelled"],"description":"The outcome of your hook logic. It decides how nullplatform resumes the entity operation:\n\n- `success`: the entity operation proceeds.\n- `failed`: the entity enters an error state.\n- `recoverable_failure`: partial failure. The entity remains valid but some changes may not have been applied.\n- `cancelled`: the operation is halted because conditions were not met.\n","example":"success"},"messages":{"type":"array","description":"Optional messages that give developers visibility into the hook's execution results.","items":{"type":"object","required":["level","message"],"properties":{"level":{"type":"string","enum":["info","warning","error"],"description":"The severity of the message.","example":"info"},"message":{"type":"string","description":"A message shown to developers about the hook's execution.","example":"Repository provisioned"},"timestamp":{"type":"integer","description":"When the message was produced, as a Unix timestamp in milliseconds.","example":1740406453123}},"title":"entityHookMessage"}},"callback_body":{"type":"object","additionalProperties":true,"description":"Fields to hand back to the entity. They are merged into the update nullplatform sends to the entity when it resumes the operation for the given `status`.\n\nAny field the entity's update endpoint accepts is allowed. Fields nullplatform sets itself, such as the entity `status`, take precedence. Must be a JSON object, otherwise the request is rejected with a `400` and the hook stays pending.\n","example":{"repository_url":"https://github.com/my-org/my-service","tags":{"provisioned_by":"platform-hook"}}}},"title":"entityHookRequest_reply"}}}}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"204":{"description":"The hook was updated and the callback for the given status was executed."},"4XX":{"description":"Client error responses due to invalid input or missing parameters.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","error","message"],"properties":{"statusCode":{"type":"integer","description":"HTTP status code representing the specific client error (e.g., 400, 401, 403, 404).","example":400},"code":{"type":"string","description":"A machine-readable error code that categorizes the server failure.","example":"bad_request"},"error":{"type":"string","description":"A brief, human-readable description of the error type (e.g., \"Bad Request\", \"Unauthorized\").","example":"Bad Request"},"message":{"type":"string","description":"Additional details about the error.","example":"The request was malformed or contained invalid parameters."}}}}}},"5XX":{"description":"Server error responses indicating an issue on the API side.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","error","message"],"properties":{"statusCode":{"type":"integer","description":"HTTP status code representing the specific server error (e.g., 500, 502, 503).","example":500},"code":{"type":"string","description":"A machine-readable error code that categorizes the server failure.","example":"internal_server_error"},"error":{"type":"string","description":"A brief, human-readable description of the error type (e.g., \"Internal Server Error\", \"Service Unavailable\").","example":"Internal Server Error"},"message":{"type":"string","description":"Additional details about the error.","example":"An unexpected error occurred. Please try again later."}}}}}}}}
>
  
</StatusCodes>


      