Entity hook

Respond to an entity hook

Changed on

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.

patch/entity_hook/{id}

Request

  • Base URL
    https://api.nullplatform.com
  • URL
    https://api.nullplatform.com/entity_hook/{id}
  • Auth
    HTTP bearer

Path parameters

idstring uuid required

The ID of the entity hook request, as received in the hook notification.

Request body

status'success' | 'failed' | 'recoverable_failure' | 'cancelled'

The outcome of your hook logic. It decides how nullplatform resumes the entity operation:

  • success: the entity operation proceeds.
  • failed: the entity enters an error state.
  • recoverable_failure: partial failure. The entity remains valid but some changes may not have been applied.
  • cancelled: the operation is halted because conditions were not met.
callback_bodyobject

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.

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

Example request

{
  "status": "success",
  "messages": [
    {
      "level": "info",
      "message": "Repository provisioned",
      "timestamp": 1740406453123
    }
  ],
  "callback_body": {
    "repository_url": "https://github.com/my-org/my-service",
    "tags": {
      "provisioned_by": "platform-hook"
    }
  }
}

Response

The hook was updated and the callback for the given status was executed.

Changes

    • breaking

      the response property became optional for the status

    • breaking

      the response property became optional for the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • info

      media type application/json was changed to a more specific media type application/problem+json for the response status

    • info

      media type application/json was changed to a more specific media type application/problem+json for the response status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      response property message deprecated

    • info

      response property message deprecated

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      endpoint added