Youniton Docs

Automation inbound webhooks

Start an automation flow from another system with one signed call. The flow uses the fields of the call as variables.

  1. #An Admin registers an endpoint

    In Administration › Automation › Inbound, the Admin creates an endpoint. The answer shows its secret, whsec_… (32 random bytes), one time. The Admin can also limit the sender's address ranges.

    A rotation shows a new secret one time and keeps the old one for 24 hours.

  2. #A flow uses the endpoint

    A flow editor selects the trigger Inbound webhook, names the endpoint and defines the fields. The fields come from a defined JSON structure, or an AI converter fills the same fields from the body.

  3. #Your system signs and sends the call

    Send a POST with a JSON body (at most 64 KiB, depth at most 16, at most 500 keys) and the Standard Webhooks headers. Make a new webhook-id per event and keep it for the retries of that event.

    Sign and send a call
    SECRET="whsec_…"                          # from the endpoint, shown one time
    URL="https://app.youniton.example/webhooks/automation/<endpointId>"
    ID="evt_$(uuidgen)"
    TS=$(date +%s)
    BODY='{"orderId":"A-1042","status":"paid"}'
    KEY_HEX=$(printf '%s' "${SECRET#whsec_}" | base64 -d | xxd -p -c 256)
    SIG=$(printf '%s' "$ID.$TS.$BODY" | openssl dgst -sha256 -mac HMAC -macopt hexkey:$KEY_HEX -binary | base64)
    
    curl -s -X POST "$URL" \
      -H "Content-Type: application/json" \
      -H "webhook-id: $ID" -H "webhook-timestamp: $TS" -H "webhook-signature: v1,$SIG" \
      --data "$BODY"
  4. #Read the answer

    AnswerMeaning
    202Youniton recorded the call. The body holds the call's id. Runs start after it. You get no run data.
    200a repeat of a known webhook-id with the same body: nothing starts
    401the signature is not valid
    404the endpoint is unknown, deleted or disabled, inbound webhooks are off, or your address is not in the allowed ranges
    409a known webhook-id with another body
    413 · 422the body is too large, too deep, has too many keys or is not application/json
    429too many calls: wait for Retry-After
    503the endpoint is paused: wait for Retry-After

    A timestamp more than 5 minutes from Youniton's clock is refused. Keep your server's clock in sync.

#Security of the data

  • Youniton verifies the signature over the raw bytes, in constant time, before it parses the body.
  • Each value that arrives is untrusted data. It never becomes an instruction or a prompt of the flow.
  • A run acts as the flow's owner. The caller gets no identity and no right.
  • Youniton keeps a call's body for the tenant setting automation.inbound.callRetentionDays, and remembers each webhook-id for at least 7 days.

#The Admin operations

The Youniton app manages endpoints with these operations (session only):

Was this helpful?