Fire an event that starts every enabled flow subscribed to it
Delivers one event to the org's automation triggers and answers `{matched:n}` — how many enabled flows had a webhook trigger on this `(source, event)` key…
POST /v1/auto/hooks/{source}/{event}
| Address | https://api.hanzo.ai/v1/auto/hooks/{source}/{event} |
| Method | POST |
| Operation | post_auto_hooks_by_source_by_event |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Delivers one event to the org's automation triggers and answers {matched:n} — how many enabled flows had a webhook trigger on this (source, event) key and were started by it. A zero match is a success, not an error: nothing was subscribed.
The path is the trigger key and the JSON object body is the event payload, threaded into each started run as {{trigger.*}} with all of its keys intact — which is why this is not a typed op, since a declared input struct would silently DISCARD every payload key it had no field for. Re-delivery is a no-op: an X-Idempotency-Key header dedupes, and with none the body is content-hashed instead, so a hammer of identical posts collapses to ONE run rather than minting a fresh one per post. An in-platform producer may propagate X-Causation-Depth so a firing that a flow caused is bounded against a loop; an absent or invalid header reads as depth 0, an external origin.
Authenticated and org-scoped, unlike a provider's public webhook URL: a validated principal is required (403 without one) and the org is that principal's, never the body's, so a producer can only fire into its own tenant's flows. Both path segments are required (400) and a payload over the size limit is a 413.
Request
2 fields.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
source | path | string | yes | |
event | path | string | yes |
Response
The document declares no response body for this operation. It answers 200 on success and the platform error shape on failure — see Errors.
Examples
hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.
import { Configuration, AutoApi } from 'hanzoai';
const api = new AutoApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postAutoHooksBySourceByEvent({ source: 'source', event: 'event' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AutoApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = AutoApi(client).post_auto_hooks_by_source_by_event(source='source', event='event')cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.AutoAPI.PostAutoHooksBySourceByEvent(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, auto_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = auto_api::post_auto_hooks_by_source_by_event(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AutoApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new AutoApi(client).postAutoHooksBySourceByEvent();The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
curl -X POST https://api.hanzo.ai/v1/auto/hooks/<source>/<event> \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches auto through the auto tool, which names its 11 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "list_auto_flows"
}
}
}'How is this guide?