A webhook is a URL. When another service calls it, Veryfront starts a run of the agent, task or workflow you pick.
Before you start
You need an agent. See Create an agent.
Create a webhook
-
In your project, open Orchestration > Triggers.
-
Open Webhooks.
-
Click Create webhook.
-
Enter
Refund questionsas the Name. -
Keep Type as Agent.
-
Under Target, pick your agent.
-
Keep Mode as No conversation.
-
Enter the Message. Use
{{payload.field}}for a value from the delivery:TextA customer asks: {{payload.question}} -
Click Create webhook. Studio shows the secret once, with a curl that uses it.
-
Copy the secret.
-
Copy the curl.
-
Send a delivery with your own payload, with
WEBHOOK_URLset to the URL in the curl you copied andWEBHOOK_SECRETto the secret:Shellexport WEBHOOK_URL=<the URL in the curl>export WEBHOOK_SECRET=<the secret>curl -X POST "$WEBHOOK_URL" \ -H "X-Veryfront-Webhook-Secret: $WEBHOOK_SECRET" \ -H "Idempotency-Key: refund-question-1" \ -H "Content-Type: application/json" \ -d '{"question": "How long does a refund take?"}' -
Open the webhook's Events tab. You should now see the delivery Completed, with a run.
Troubleshooting
If a delivery fails with "Service-account owner must have project write access to own a new conversation", the webhook starts a new conversation, which fails on every delivery. Set Mode to No conversation ("conversation_mode": "none").