Channels

Zapier

The Zapier channel is a REST Hooks bridge that connects Open Astra to Zapier's automation platform. Zapier can send trigger events to your agents and subscribe to agent completion events. This enables workflows like "when a form is submitted in Typeform, route it to an agent and post the response to Slack."

How it works

The Zapier bridge implements the REST Hooks pattern with three endpoints:

RouteMethodDescription
/zapier/triggerPOSTZapier sends an event; the adapter routes it to an agent
/zapier/subscribePOSTZapier registers a hook URL to receive agent events
/zapier/unsubscribeDELETEZapier removes a previously registered hook URL
/zapier/pollingGETZapier polls for recent events (fallback for REST Hooks)

Setup

Zapier subscriptions are managed through the database via the zapier_subscriptions table. No environment variables are required — subscriptions are created dynamically when Zapier's Zap connects.

The Zapier channel requires JWT authentication on all endpoints. Zapier should include a valid bearer token in the Authorization header.

Sending events to agents

Use the trigger endpoint to route Zapier events to an agent:

bash
# Trigger — Zapier sends an event to route to an agent
POST /zapier/trigger
{
  "workspaceId": "ws-123",
  "eventType": "form_submission",
  "payload": {
    "name": "Jane Doe",
    "email": "jane@example.com",
    "message": "I need help with my account"
  }
}

The eventType and payload fields are passed to the agent as structured context. The agent processes the event and its response is forwarded to all subscribed hook URLs matching the workspace and event filter.

Subscribing to agent events

Zapier registers hook URLs to receive agent.completed events:

bash
# Subscribe — Zapier registers a hook URL
POST /zapier/subscribe
{
  "hookUrl": "https://hooks.zapier.com/hooks/catch/123/abc",
  "eventFilter": "*",
  "workspaceId": "ws-123"
}

# Unsubscribe — Zapier removes a hook URL
DELETE /zapier/unsubscribe
{
  "hookUrl": "https://hooks.zapier.com/hooks/catch/123/abc",
  "workspaceId": "ws-123"
}
FieldDescription
hookUrlThe URL Zapier provides for receiving events
eventFilterGlob pattern to filter events (* matches all)
workspaceIdScope the subscription to a specific workspace

Polling endpoint

Zapier uses the polling endpoint as a fallback when REST Hooks are not yet configured, and to populate sample data in the Zap editor:

bash
# Polling — Zapier fetches recent events (last 10)
GET /zapier/polling?workspaceId=ws-123

# Returns an array of recent agent.completed events
# sorted newest-first for Zapier's dedup logic

Returns the 10 most recent agent.completed events for the workspace, sorted newest-first. An in-memory ring buffer (last 100 events) keeps this endpoint fast.

Security

  • All outbound calls to hook URLs are SSRF-guarded — internal and blocked URLs are rejected
  • Subscriptions are scoped per-workspace — hooks only receive events from their workspace
  • Event filter matching uses safe glob comparison, not regex
  • JWT authentication is required on all endpoints

Event bus integration

The Zapier bridge listens to the internal event bus for agent.completed events. When an agent finishes a turn, the bridge checks for matching subscriptions and POSTs the event payload to each hook URL. Failed deliveries are logged but do not retry — Zapier handles retries on their end.

💡Use the polling endpoint to verify your integration during development before setting up REST Hooks.

See also: Channels Overview for shared slash commands and how the channel adapter system works.