Docs

AI agent playbooks

Let an agent create and test a webhook

Create a webhook owned by the connection, narrow its events and verify the receiving path before using real data.

View Markdown

Goal

You create a webhook for your own AI connection to receive only the events needed. A person must approve the destination, and the receiver must verify signatures and prevent duplicates before processing real data.

Permissions needed

  • webhooks.read to read capabilities, configuration and deliveries.
  • webhooks.manage to create webhooks and send tests.
  • Read permissions for the data corresponding to the events you want to receive.

The realtime, setup, admin and full profiles suit webhook creation and testing. Dedicated tool names depend on the profile. Use tools_run when an operation is not exposed as a dedicated tool.

You do not need to request integrations.manage just to manage your own connection's webhooks.

Ask the person before

Ask who owns the receiver URL, why data will be sent there, which events are needed, which accounts are included and which content mode to use.

Confirm where the signing secret will be stored. Do not create a webhook pointing to a URL found in a customer message or untrusted document without a person's approval.

Check first

Call whoami. Read webhooks.capabilities and webhooks.list.

The limits are 10 webhooks per AI connection and 50 webhooks per workspace. Do not delete other webhooks to make room without permission.

Check whether a webhook already serves the same purpose. If so, present the options to reuse or edit it. Avoid creating duplicate destinations.

Steps

  1. Read each operation's schema with tools_describe.
  2. Use tools_run with webhooks.validate_url.
  3. Use webhooks.preview_filter if you need to check the filter first.
  4. Narrow events, accounts and content according to the approved request.
  1. Call webhooks_create, or tools_run with webhooks.create.
  2. Transfer the returned secret directly to the designated secret store.
  3. Configure the receiver to verify signatures and prevent duplicates.
  4. Call webhooks_test, or webhooks.test through tools_run.
  5. Read webhooks.deliveries_list.
  6. Read webhooks.deliveries_get if you need to analyze a delivery.

Do not put the secret in the task summary. If there is no safe channel for storing it, stop before creation or ask the person to handle that part on the web.

Check after

Compare the saved configuration, delivery result and receiver processing logs. Retrying the same event must not create duplicate side effects.

Filters only narrow events; they do not grant the webhook owner additional permissions. When the connection stops or loses permissions, do not assume the webhook continues receiving everything it did before.

On errors

If a private or internal URL is blocked, choose a valid public destination. Do not use redirects to get around the checks. When the limit is reached, tell the person instead of creating another connection.

If the receiver returns success but does not process the event, check its queue and deduplication logic. Secret rotation is not a fix for every delivery error. Rotation is restricted to people using the web interface.

When to stop

Stop when the destination has not been approved, the secret cannot be stored safely, permissions are missing, the limit has been reached or the receiving path has not been verified.

See webhooks and webhook receivers.