Skip to content

Webhooks

Use a webhook source to receive leads from an external tool such as Zapier, Clay or n8n. Add the webhook source to your workflow, then open its Setup tab. Copy the Webhook URL and HMAC Secret shown there. Keep both private: together they let a sender submit leads.

The URL has this shape:

https://<your-deployment>.convex.site/api/webhooks/workflow-leads/<token>

Use the URL from Setup rather than building one from this example.

Send a GET request to the webhook URL. A valid token returns a JSON Schema, a signed curl example and this documentation’s URL. Schema discovery does not need an HMAC signature. It is limited to 10 requests per minute per token.

Send a POST request with Content-Type: application/json and a leads array. Each lead requires a nonempty linkedinUrl. The optional fields are fullName, email, title and companyName. Send at most 100 leads per request.

{
"leads": [
{
"linkedinUrl": "https://www.linkedin.com/in/example-person",
"fullName": "Example Person",
"email": "person@example.com",
"title": "Sales Director",
"companyName": "Example Company"
}
]
}

Compute the HMAC-SHA256 of the exact body bytes using your HMAC secret. Send the lowercase hex digest in X-Webhook-Signature, without a prefix. Changing whitespace after signing changes the signature.

Terminal window
WEBHOOK_URL='paste-your-webhook-url'
HMAC_SECRET='paste-your-hmac-secret'
PAYLOAD='{"leads":[{"linkedinUrl":"https://www.linkedin.com/in/example-person"}]}'
SIGNATURE=$(printf '%s' "$PAYLOAD" | openssl dgst -sha256 -hmac "$HMAC_SECRET" | awk '{print $NF}')
curl "$WEBHOOK_URL" \
-H 'Content-Type: application/json' \
-H "X-Webhook-Signature: $SIGNATURE" \
-H 'Idempotency-Key: example-batch-001' \
--data-binary "$PAYLOAD"

Use a stable Idempotency-Key when retrying the same batch. A key is scoped to its webhook token. Use a new key for a different batch. Without a key, repeating a request creates another import; duplicate URLs are counted within each batch.

A successful request returns HTTP 200 with these fields:

{"accepted": 1, "duplicates": 0, "errors": []}

accepted counts stored import rows. It does not confirm a message was sent or a workflow finished. duplicates counts repeated LinkedIn URLs within the batch. Check errors even on HTTP 200: valid rows can be accepted while invalid rows are rejected. Each error includes the zero-based index from the submitted array and a message. Fix rejected rows and send them as a new batch with a new idempotency key.

StatusWhat to do
400Check the JSON, the leads array and required URLs. The request may exceed 100 leads, or every row may be invalid.
401Include X-Webhook-Signature and sign the exact body with the current HMAC secret.
404Copy the current URL from Setup. A removed workflow or workspace also invalidates its token.
429Wait for the rate window to reset before retrying. Lead ingestion is limited to 1,000 leads per hour per token; schema discovery has its own minute window.

Regenerating credentials in Setup replaces both the URL and the secret. Update your external sender before sending another batch.