Send your first agent email
Get from zero to a working agent action in under 5 minutes. No SDK to install — your agent talks directly to the REST API.
Prerequisites
- •An AgentBlocks account — sign up free
- •An API key from the dashboard
- •An AI agent (Claude Code, a custom agent, etc.)
Configure rules in the dashboard
Before your agent can act, set up policy rules in the AgentBlocks dashboard. Rules are evaluated server-side — your agent can't modify them. For this example, the default rules work fine: all email sends require human approval.
Tell your agent about AgentBlocks
Just tell your agent in natural language. No SDK or install step — the agent uses the REST API directly.
Agent discovers its capabilities
The agent reads the guide, then calls GET /agent/info to discover what it can do.
Agent sends an email
The agent calls POST /email/send-request with the email details. AgentBlocks evaluates it against your dashboard rules.
If your rules require approval, the response returns type: "queued" with a token. If auto-approved, the email is sent immediately.
Approve and watch it send
You'll receive a notification (via Slack, email, or WhatsApp — depending on your agent config) with the email details. Approve it, and AgentBlocks sends the email on your agent's behalf.
If the action required approval, the agent polls GET /operations/:token until the status becomes approved, rejected, or timed_out.
Action approved and executed
Email sent to [email protected] from [email protected]