postAutoHooksBySourceByEventWithHttpInfo method

Future<Response> postAutoHooksBySourceByEventWithHttpInfo(
  1. String source_,
  2. String event
)

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

Note: This method returns the HTTP Response.

Parameters:

Implementation

Future<Response> postAutoHooksBySourceByEventWithHttpInfo(String source_, String event,) async {
  // ignore: prefer_const_declarations
  final path = r'/v1/auto/hooks/{source}/{event}'
    .replaceAll('{source}', source_)
    .replaceAll('{event}', event);

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>[];


  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}