Receive webhooks

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

  1. In your project, open Orchestration > Triggers.

  2. Open Webhooks.

  3. Click Create webhook.

  4. Enter Refund questions as the Name.

  5. Keep Type as Agent.

  6. Under Target, pick your agent.

  7. Keep Mode as No conversation.

  8. Enter the Message. Use {{payload.field}} for a value from the delivery:

    Text
    A customer asks: {{payload.question}}
  9. Click Create webhook. Studio shows the secret once, with a curl that uses it.

  10. Copy the secret.

  11. Copy the curl.

  12. Send a delivery with your own payload, with WEBHOOK_URL set to the URL in the curl you copied and WEBHOOK_SECRET to the secret:

    Shell
    export 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?"}'
  13. 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").

Next steps