Connect Any Agent
Connect any MCP or API agent to Pushary so it can ask a human and wait for the answer, including n8n, Zapier, LangChain, and custom agents
Pushary is not only for coding agents. Any agent that can speak MCP or make an HTTP request can pause, ask you a question, and wait for your answer, then continue with your decision. That covers ops and automation agents, research agents, n8n, Zapier, Make, LangChain or LangGraph agents, and your own Python or TypeScript code.
If you run Claude Code, Codex, Hermes, or Cursor, use the Quickstart instead. One command sets up the hook and gives you enforced permission gating on top of notifications.
What you get
- Notify and wait. Your agent sends a question to your phone and blocks until you approve, deny, choose an option, or type a reply.
- Async approvals. Or send the question, get a correlation id back immediately, and receive the answer on a signed webhook when the user responds. Good for no-code flows that resume on a callback.
- Notifications. Fire-and-forget alerts when a long job finishes or fails.
Enforced pre-execution gating (hard-blocking a command until you approve) needs a host hook and is available on the coding agents in the setup guides. Any other agent gets the human-in-the-loop pause and notifications, not an out-of-the-box runtime block.
Get your API key
Open the dashboard, go to Agent → Settings → API keys, and create a key. It looks like pk_xxx.sk_xxx.
Export it where your agent runs:
export PUSHARY_API_KEY="pk_xxx.sk_xxx"Two ways to connect
Method 1: MCP server (recommended for MCP clients)
Point any MCP client at the Pushary endpoint. The agent then has ask_user, wait_for_answer, and send_notification as native tools.
{
"mcpServers": {
"pushary": {
"url": "https://pushary.com/api/mcp/mcp",
"headers": {
"Authorization": "Bearer ${PUSHARY_API_KEY}"
}
}
}
}The official MCP SDKs (TypeScript and Python) connect with just the URL and the Authorization header, so a custom agent or a LangChain / LangGraph tool can use the same config.
Method 2: REST API (for no-code and custom code)
Plain HTTPS with a Bearer token. No SDK, no MCP, no JSON-RPC. Call it from curl, an n8n HTTP Request node, Zapier, Make, or any language. Base URL https://pushary.com/api/v1/server, and every request sends:
Authorization: Bearer ${PUSHARY_API_KEY}
Content-Type: application/jsonFire-and-forget notification — POST /send:
curl -X POST https://pushary.com/api/v1/server/send \
-H "Authorization: Bearer $PUSHARY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title":"Backfill finished","body":"Processed 12,400 rows with 0 errors."}'Ask a question and wait for the answer (synchronous) — POST /ask:
curl -X POST https://pushary.com/api/v1/server/ask \
-H "Authorization: Bearer $PUSHARY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": "Approve sending the campaign to all 4,000 contacts?",
"type": "confirm",
"agentName": "Marketing agent",
"wait": true,
"timeoutSeconds": 50
}'The call blocks until you respond, up to timeoutSeconds (max 55), and returns:
{ "correlationId": "…", "status": "answered", "answered": true, "value": "yes" }or { "status": "timeout", "answered": false } if no one answers in time. The question stays open for 10 minutes, so you can keep polling.
For type: "select", pass options (2 to 6 choices) and value is the chosen option. For type: "input", value is the free text the user typed.
Ask without blocking, then poll. Set "wait": false and you get a correlationId and pollUrl back immediately:
{ "correlationId": "abc-123", "status": "pending", "pollUrl": "https://pushary.com/api/v1/server/ask/abc-123" }Then poll GET /api/v1/server/ask/{correlationId}, optionally with ?wait=30 to long-poll up to 30 seconds:
curl "https://pushary.com/api/v1/server/ask/abc-123?wait=30" \
-H "Authorization: Bearer $PUSHARY_API_KEY"Cancel a question you no longer need with DELETE /api/v1/server/ask/{correlationId}.
Async answers with a webhook
Prefer a callback to polling? Add a callbackUrl to the ask. Pushary POSTs { correlationId, answer, answeredAt } to your URL when the user responds, signed with an X-Pushary-Signature header so you can verify it came from Pushary.
curl -X POST https://pushary.com/api/v1/server/ask \
-H "Authorization: Bearer $PUSHARY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": "Approve before the agent emails the customer?",
"wait": false,
"callbackUrl": "https://your-app.com/webhooks/pushary"
}'In n8n or Make, point a Wait-for-webhook node at this URL and the workflow resumes when the answer arrives.
The REST API and the MCP server share one question store, so an answer from your phone, the web decision page, or Slack resolves the question no matter how it was asked. Use whichever surface fits your stack.
Attribute your sessions
Pass agentName (and an optional sessionId) on every call so the dashboard and Fleet Board label the work correctly instead of showing a generic session. Run several agents at once and each shows up separately.
Verify it works
Send one send_notification call and confirm the push lands on your phone. If you do not have a device connected yet, finish the phone-connect step in the dashboard first.
Next
- Human-in-the-loop for the approval patterns
- Use cases for ready-made ops, automation, and app-backend examples
- Tool reference for every tool and argument