STACK receives a provider webhook, verifies its signature, deduplicates the event, scans selected content, records the result, and forwards only when the configured policy allows it.
curl -X POST https://api.getstack.run/v1/operator/inbound-webhooks \
-H "Authorization: Bearer $STACK_TOKEN" -H "Content-Type: application/json" \
-d '{"provider":"generic","agent_id":"agt_123","forward_url":"https://worker.example/webhook"}'Supported providers are agentmail and generic. The response returns the hosted URL and a downstream HMAC secret once. Generic endpoints also return a separate incoming_signing_secret once. Configure the sender with the incoming key and the receiver with the downstream key. AgentMail setup is described below. Omit forward_url for scan-and-record only.
Creating an endpoint chooses where data can leave. Agent-bearing contexts receive 403. Revocation remains agent-reachable because it only removes access.
MCP creation returns metadata and setup_required: true, never signing secrets. An owner or admin completes setup through the authenticated REST API or SDK, outside the assistant conversation. There is no MCP signing setup tool or dashboard form. For a generic endpoint, choose a random incoming secret of 32 to 256 UTF-8 bytes and send it as signing_secret to PUT /v1/operator/inbound-webhooks/:id/provider-signing-secret. STACK generates a new downstream secret, returns it once, and stores both values under separate encryption contexts. Configure the provider with the incoming secret and your receiver with the returned webhook_secret. You can instead supply a distinct downstream_signing_secret in the request.
signing_configured reports whether STACK has an inbound verification key. Generic endpoints have a generated key at creation, so this field is true even when MCP has withheld that key and human setup is still required. For partner-owned tenants, use PUT /v1/partner/tenants/:tenant_id/inbound-webhooks/:wh_id/provider-signing-secret with the partner owner/admin credentials and the same request body.
Create the STACK endpoint with provider: agentmail, then register its hosted URL in AgentMail. AgentMail generates a signing secret beginning with whsec_. An account owner or admin sends that secret as signing_secret in a JSON body to PUT /v1/operator/inbound-webhooks/:id/provider-signing-secret. STACK encrypts it and never returns it. The endpoint reports signing_configured: false and refuses deliveries until setup is complete. The same request rotates the signing secret. For MCP-created endpoints with forwarding, also supply a random downstream_signing_secret of 32 to 256 UTF-8 bytes and configure your receiver with it. The incoming and downstream values must differ. STACK updates both encrypted keys together.
AgentMail requests must carry valid Svix signatures and a timestamp within five minutes. STACK scans the delivered payload, including nested message content. Content AgentMail omits from a large message is not included in that scan. Keep the separate downstream HMAC secret in your downstream receiver to verify forwarded deliveries.
A partner grant can create an endpoint only for a provider in its provider allowlist and an agent created by that grant. List, get, and revoke stay restricted to resources created by the same grant.