Chatzuri
Pricing
Guides
Guides
Introduction
  1. 1Getting Started
  2. 2Your Agent
  3. 3Knowledge & Sources
  4. 4Agent actions & Tools
    • Tools & actions overview
    • Credentials & safety
    • Built-in tools
    • Messaging tools
    • E-commerce tools
    • Payments tools
    • Scheduling tools
    • Database tools
    • Cloud storage tools
    • Business & productivity tools
    • Developer tools
    • Build a custom action
    • Trigger webhooks
  5. 5Agent Tasks
  6. 6WorkflowsBeta
  7. 7Channels
  8. 8Customers & Conversations
  9. 9Run Your Team
  10. 10Developer Tools
Developer reference →Showcase →
Guides4. Agent actions & ToolsTrigger webhooks
Chapter 4 · Agent actions & Tools

Trigger webhooks

Fire an HTTP call into your stack the moment something happens in chat.

4 min read

A webhook is an HTTP call out to your stack when something happens in chat — a qualified lead, an escalation, a customer matching a rule. There are two ways to fire one from an agent.

Option 1 — The built-in webhook_trigger tool

Turn on the webhook_trigger built-in under Tools & Actions and supply a destination URL. The agent decides when to call it and what JSON to send.

Use this when you want the model to choose the moment — e.g. fire a webhook to your analytics endpoint when intent X is detected.

Option 2 — A custom action with fetch

Full control. Write a custom action with a webhook credential and post anything you want:

const payload = {
  event: 'lead.captured',
  source: 'chat',
  customer: params.email,
  conversation_id: params.conversation_id,
  timestamp: new Date().toISOString(),
};

const r = await fetch(credentials.webhook_url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    ...(credentials.secret ? { 'X-Webhook-Secret': credentials.secret } : {}),
  },
  body: JSON.stringify(payload),
});

if (!r.ok) throw new Error(`Webhook ${r.status}`);
return { success: true };

See Build a custom action for the full code contract.

Test endpoints to develop against

While building, point the webhook at one of these to inspect the payload:

  • webhook.site — free, instant, no signup. Gives you a random URL and shows every request that hits it.
  • requestbin.com — similar; useful when you need to share the URL with a teammate.

Securing the receiving endpoint

Your receiver should reject calls that aren't from chatzuri. Two common patterns:

  • Shared secret — add a long random string to the secret field on the webhook credential. The custom action sends it as X-Webhook-Secret; your receiver verifies it matches.
  • HMAC signature — sign the body with a secret using crypto.subtle (in your custom action) and verify the signature in your receiver.
Heads up
Don't rely on the source IP — chatzuri's outbound IPs are not currently published. Authenticate with a shared secret or HMAC.

Retries and idempotency

Webhook calls are not automatically retried by chatzuri. If your endpoint is briefly down, the action returns an error to the agent. Build retries into your receiver or accept that an occasional event may be missed.

For events you cannot afford to lose, write them to a queue (Postgres outbox table, Kafka, SQS) from your receiver and process asynchronously.

Inverse direction — receiving webhooks into chatzuri

Channel webhooks (Stripe payment events, WhatsApp inbound messages, Mailgun email replies, etc.) route into chatzuri via POST /api/v1/agents/[agentId]/chat/[channel]. See Channels overview for the list of channels with built-in inbound webhooks.

Previous · Agent actions & ToolsBuild a custom actionNext · Agent TasksWhat are Agent Tasks?
Chatzuri

AI-powered agents are transforming customer interactions by providing instant, intelligent responses around the clock. They help businesses reduce operational costs, improve response times, and scale support without compromising quality. These agents understand natural language, learn from conversations, and integrate with existing systems to offer personalized experiences that enhance customer satisfaction and loyalty.

Chatzuri

AI-powered agents are transforming customer interactions by providing instant, intelligent responses around the clock. They help businesses reduce operational costs, improve response times, and scale support without compromising quality. These agents understand natural language, learn from conversations, and integrate with existing systems to offer personalized experiences that enhance customer satisfaction and loyalty.

Product

  • Pricing
  • Security
  • Affiliates

Resources

  • API
  • Guides
  • Blog
  • Help

Company

  • About us
  • Privacy Policy
  • Terms of Service
  • Cookie Policy
  • DPA

About

  • Teams
  • Singapore, Nairobi

© 2026 Chatzuri. All rights reserved.

Chatzuri uses AI and can make mistakes.

Terms of ServicePrivacy PolicyCookie PolicyChatzuri