Creating a Webhook
1
Go to Settings > Webhooks
Open your organization Settings and select the Webhooks tab. You see a list of all configured webhooks and their current status.
2
Click New Webhook
Click New Webhook in the top-right corner to open the webhook creation form.
3
Enter the endpoint URL
Paste the destination URL into the Endpoint URL field. The URL must use HTTPS — mFoundry rejects plain HTTP endpoints to ensure all payloads are transmitted securely.
4
Choose which events to subscribe to
Select one or more events that should trigger this webhook. Available events include:
Subscribe only to the events your endpoint needs — fewer subscriptions means less processing overhead on your end.
5
Click Save — a secret key is generated
Click Save. mFoundry generates a unique secret key for this webhook and displays it once. Copy and store it securely — you’ll use it to verify incoming payloads. If you lose the key, revoke the webhook and create a new one.
Webhook Payload
Every webhook request is an HTTP POST with aContent-Type: application/json header. The payload follows a consistent envelope structure across all event types, with event-specific data in the data object.
Below is a sample payload for a workflow.completed event:
event— The name of the event that fired, matching the subscription you configured.timestamp— ISO 8601 UTC timestamp of when the event occurred on mFoundry’s servers.data— An object containing resource identifiers and state relevant to the event type.
Verifying Signatures
Every request mFoundry sends includes anX-mFoundry-Signature header containing an HMAC-SHA256 signature. Verify this signature on every incoming request to confirm the payload originated from mFoundry and was not tampered with in transit.
The signature is computed as:
crypto.timingSafeEqual or an equivalent constant-time comparison function. String equality operators (like ===) are vulnerable to timing attacks.
Retry Policy
If your endpoint returns a non-2xx response or fails to respond within 10 seconds, mFoundry marks the delivery as failed and retries automatically. Retries follow an exponential backoff schedule:
After 5 failed attempts mFoundry stops retrying and marks the webhook delivery as permanently failed. Design your endpoint to be idempotent — because network hiccups can occasionally cause a successful delivery to be retried, your system should handle receiving the same event payload more than once without side effects.
Review the full history of webhook delivery attempts — including request headers, response codes, and response bodies — in Settings > Webhooks > Delivery History. Use this log to diagnose failures and manually replay specific deliveries during debugging.
Webhooks API Reference
You can also manage webhooks programmatically using the mFoundry REST API. All webhook endpoints are available underhttps://api.mfoundry.io/v1. Authenticate every request by passing your API key in the Authorization header as a Bearer token.
List Webhooks
Retrieve all webhooks configured for your organization.Create a Webhook
Register a new webhook endpoint for your organization.201 Created):
Delete a Webhook
Permanently remove a webhook by its ID. Deleted webhooks stop receiving events immediately.204 No Content with an empty response body.