CreateWebhook
The CreateWebhook action creates a new webhook. Webhooks allow external services to send data to your agent (incoming) or your agent to send data to external URLs (outgoing).
CreateWebhook(
idn: str,
connectorIdn: str,
webhookType: str,
description: str = "",
url: str = "",
commandIdns: list[str] = []
)
Where:
- idn: The unique identifier for the webhook being created.
- connectorIdn: The connector identifier to associate with the webhook.
- webhookType: The type of webhook. Either
"incoming"(receives data from external sources) or"outgoing"(sends data to external URLs). - description: (Optional) A description of the webhook's purpose.
- url: (Optional) The URL for outgoing webhooks where data will be sent.
- commandIdns: (Optional) A list of command identifiers associated with the webhook.
Example 1 (Outgoing Webhook)
{{CreateWebhook(
idn="result_webhook",
connectorIdn="my_connector",
webhookType="outgoing",
description="Sends results to external service",
url="https://example.com/webhook/receive"
)}}The above code snippet creates an outgoing webhook that sends data to the specified URL.
Example 2 (Incoming Webhook)
{% set webhook = CreateWebhook(
idn="data_receiver",
connectorIdn="my_connector",
webhookType="incoming",
description="Receives data from external service"
) %}
{{SendMessage(message=webhook.url)}}The above code snippet creates an incoming webhook and sends its auto-generated URL to the chat for use by external services.
Updated 4 days ago
