Skip to content
BENIBIX Learn

HTTP Hook

AI⌨️ Claude CodeConfiguration

Also known as type: http, allowedEnvVars

A hook that sends the event to a web server.

Think of it like

It is like you post a letter. Then you wait for the reply.

Example

Emma's team has one server that holds its rules. Each laptop sends its events there. So one list of rules covers the whole team.

Why it matters

It moves hook logic to one shared place instead of a script on every machine.

Definition

An HTTP hook is a hook whose type is http, so it sends the event's JSON as a POST request to a web address. The server answers in its body, with the same JSON a command hook prints. An empty 2xx reply means go ahead. A failed request or a non-2xx reply does not block, unless onFailure is set to block. Headers can use only the variables you list.

Example code

json
{
  "type": "http",
  "url": "https://hooks.example.com/check",
  "headers": { "Authorization": "Bearer $MY_TOKEN" },
  "allowedEnvVars": ["MY_TOKEN"]
}
Send each event to a team server.

Common mistake

Putting $TOKEN in a header but not in allowedEnvVars. Then it is swapped for an empty string.

Key takeaways

  1. 1
    POST to a web address. JSON body.
  2. 2
    Same answer shape. As a command.
  3. 3
    Failures do not block. Unless set to.