HTTP hooks enable you to make HTTP requests to external services as part of your replication workflow. This is particularly useful for integrating with external APIs, sending notifications, or triggering other systems.
Configuration
- type: http
url: "https://api.example.com/webhook" # Required
method: GET # Optional: GET/POST/PUT/DELETE (default: GET)
payload: '{"status": "{run.status}"}' # Optional: Request body
headers: # Optional: Request headers
Authorization: "Bearer token"
on_failure: abort # Optional: abort/warn/quiet/skip
id: my_id # Optional. Will be generated. Use `log` hook with {runtime_state} to view state.
Properties
Property
Required
Description
url
Yes
The URL to send the request to
method
No
HTTP method (GET/POST/PUT/DELETE). Defaults to GET
payload
No
The request body (for POST/PUT requests)
headers
No
Map of HTTP headers to include in the request
on_failure
No
What to do if the request fails (abort/warn/quiet/skip)
Output
When the HTTP hook executes successfully, it returns the following output that can be accessed in subsequent hooks:
status: success # Status of the hook execution
request: # Details of the request made
method: "GET" # HTTP method used
url: "https://api.example.com/webhook" # The URL called
headers: # Headers sent with the request
Authorization: "Bearer token"
payload: '{"status": "success"}' # The request body sent
response: # Details of the response received
headers: # Response headers
Content-Type: "application/json"
# ... other response headers
status: "200 OK" # HTTP status message
status_code: 200 # HTTP status code
text: "Response body as text" # Raw response body
json: # Parsed JSON response (if response is JSON)
key: "value"
# ... rest of JSON structure
You can access these values in subsequent hooks using the following syntax (jmespath):
{state.hook_id.status} - Status of the hook execution
{state.hook_id.request.method} - HTTP method used
{state.hook_id.request.url} - The URL called
{state.hook_id.request.headers} - Request headers
{state.hook_id.request.payload} - Request body
{state.hook_id.response.status} - HTTP status message
{state.hook_id.response.status_code} - HTTP status code