Skip to content
Browse the docs

AgentiSend API docs

AgentiSend is a transactional email API for applications and AI agents: Resend-compatible requests, a send budget on every key, a kill switch, and refusals that name the fix. 252 operations, 122 error codes and 51 event types, generated from the API itself at build. Version 0.1.0.

Guides

Start here

  • Quickstart — Verify a domain, create a key, send the first email — in Node, Python or curl.
  • Agents — MCP and the CLI — Connect Claude Code, Cursor, Windsurf, VS Code or any remote-MCP client to the same API your code uses.
  • SDKs — Install the Node, Python, PHP or Go client, or the MCP server and the CLI, and send one email.
  • API conventions — Auth, the error envelope, idempotency, rate limits, pagination and request ids, with the numbers the API enforces.
  • Billing — What counts as an email, monthly, yearly and lifetime plans, plan changes, overage, failed payments, cancellation and closing.
  • Support — Open a request from the console, attach files, follow the thread there and by email, and reopen or rate it once resolved.

Control plane

  • Budgets and the kill switch — Per-key spend ceilings, what happens when one is reached, and the one request that stops everything.
  • Approvals — When a send waits for a person, how the queue behaves, and what an agent sees while it waits.
  • Deliverability — The published thresholds, what happens at each one, and how to read the reputation panel.
  • Trust and enforcement — The enforcement ladder, what each rung does, how to appeal, and what we will not do.

Integrating

  • Webhooks — Signing, verification, the retry schedule, replay, and what happens to a dead letter.
  • Domains and DNS — The records to publish, what verification checks, the US / EU region choice, TLS mode, and the customer return-path host.
  • Templates — Storing a template, rendering it, versioning, and why the variables are declared.
  • Migrating from Resend — What stays the same, how error names map, and what differs. Two things behave differently on purpose: the region default and enforced key budgets.
  • Audience — Contacts, segments and topics in the console, and what an unsubscribe is allowed to undo.
  • Broadcasts — One message to one segment, drafted, optionally scheduled, snapshotted at send, with a delivery state for every member.
  • Automations — A trigger and ordered steps, or a graph with delays, waits and conditions; a version saved on enable, and every run recorded step by step.
  • Receiving and replying — Read received mail and thread your replies. A reply to mail that arrived somewhere else threads too, with headers copied from it.
  • Test addresses — Every address at simulator.agentisend.com, the events each one produces, what gets suppressed, and the Resend test addresses they replace.
  • AgentiSend MCP server — send email from Claude, Cursor and any MCP client — Every tool with the scopes it needs, the rate-limit table, the JSON-RPC error codes, and what an agent cannot do.
  • Migrating from Postmark — How a Postmark payload and webhook map onto this API, and what is refused on day one.
  • Migrating from SendGrid — How a SendGrid mail-send payload maps onto this API, and what is refused on day one.
  • Migrating from Mailgun — How a Mailgun HTTP send maps onto this API, and what is refused on day one.
  • Migrating from Amazon SES — How an Amazon SES SendEmail call maps onto this API, and what is refused on day one.
  • Send email from n8n — The AgentiSend node and trigger for n8n: send and check email from a workflow or an AI Agent, and start workflows on delivery, bounce, open and click.

Frameworks and agents

  • Send email from Next.js — A route handler and a Server Action that send through AgentiSend, with the key on the server and an idempotency key on every send.
  • Send email from Supabase — Supabase's Send Email Hook, so sign-up, sign-in-link and password-recovery mail leaves through your own verified domain.
  • Send email from Better Auth — The sendVerificationEmail and sendResetPassword callbacks, sending through AgentiSend with an idempotency key built from the token.
  • Send email from Auth.js — A custom sendVerificationRequest so the sign-in link goes out over HTTPS instead of an SMTP connection your host may not allow.
  • Send email from Hono — One POST route that sends a transactional email, the same file on Cloudflare Workers, Deno, Bun and Node.
  • Send email from Express — A POST route on an app you can mount anywhere, returning the message id or the code and fix of a refusal.
  • Send email from SvelteKit — A contact form whose action runs on the server, so the key stays there and the form works without JavaScript.
  • An AI agent with a budget and a loop guard — A key scoped to sending, a ceiling, and the loop guard refusing the fourth identical send and holding it for a person.
  • Send email from Python — The same three calls from Python with nothing installed: a key scoped to sending, a ceiling, and the loop guard refusing a repeat.
  • Send email from a Vercel AI SDK agent — A sendEmail tool for the AI SDK that sends through the agent's own budgeted key and hands a refusal back to the model as code and fix.
  • Send email from a LangChain.js agent — A send_email tool built with tool() from @langchain/core/tools that sends through the agent's own budgeted key and hands a refusal back to the model as code and fix.
  • Send email from Fastify — A Fastify POST route whose JSON schema refuses a bad address before the handler runs, sending one invoice notice per invoice with an idempotency key.
  • Send email from Astro — An Astro API route that confirms a waitlist sign-up from a plain form post, refusing a malformed address before the API is called.
  • Send email from Nuxt — A Nitro server route under server/api that sends one booking confirmation per booking, refusing a malformed address before the API is called.
  • Send email from React Router — A React Router action, formerly Remix, that emails a download link to the person who asked for it and refuses a malformed address before the API is called.
  • Send email from NestJS — A NestJS controller and service sending one order confirmation per order, refusing a malformed address first and answering a refusal with its code and fix.
  • Send email from FastAPI — A FastAPI POST route that checks the address, sends with an idempotency key, and returns the message id or the code and fix of a refusal.
  • Send email from Flask — A Flask POST route that checks the address, sends one receipt per order with an idempotency key, and returns the message id or the code and fix of a refusal.
  • Send email from Django — A Django view that checks the address, sends one shipping notice per order with an idempotency key, and returns the message id or the code and fix of a refusal.
  • Send email from Node.js — A node:http POST route that checks the address, sends one receipt with an idempotency key, and returns the id or the code and fix.
  • Send email from Go — A Go program that posts one invoice with net/http, an idempotency key, and the code and fix of a refusal.
  • Send email from PHP — A PHP function that posts one receipt with streams, an idempotency key, and the code and fix of a refusal.
  • Send email from Laravel — A Laravel controller method that posts one shipping notice with PHP streams, an idempotency key, and the refusal's code and fix.
  • Send email from Rails — A Rails controller method that posts one receipt with Net::HTTP, an idempotency key, and the refusal's code and fix.
  • Send email from Remix — A Remix action that emails one receipt from a form post, with an idempotency key, and returns the id or the code and fix.
  • Send email from Bun — A Bun request handler that posts one receipt with fetch, an idempotency key, and the code and fix of a refusal.
  • Send email from Deno — A Deno request handler that posts one deploy notice with fetch, an idempotency key, and the code and fix of a refusal.
  • Send email from the Claude Agent SDK — AgentiSend mail from the Claude Agent SDK goes through one send_email tool on toolRunner, and a refusal comes back as code and fix.
  • Send email from the OpenAI Agents SDK — AgentiSend mail from the OpenAI Agents SDK goes through one function_tool invoked with on_invoke_tool, and a refusal comes back as code and fix.
  • Send email from CrewAI — AgentiSend mail from CrewAI goes through one tool called with run, and a refusal comes back as code and fix for the crew to stop on.
  • Send email from Mastra — AgentiSend mail from Mastra goes through one createTool on an Agent, and execute returns a refusal as code and fix instead of throwing.
  • Send email from LangChain for Python — AgentiSend mail from LangChain for Python goes through one @tool invoked twice, and the second call returns a refusal as code and fix.
  • Send email with Vercel Functions — A Vercel POST function that sends with the Node SDK and replays a retried call for the same recipient.
  • Send email with Cloudflare Workers — A Cloudflare Workers fetch handler that sends with the Node SDK, reading the key from the binding.
  • Send email with AWS Lambda — An AWS Lambda handler that sends with the Node SDK and returns the message id from an API Gateway event.
  • Send email with Ruby — A Ruby script that posts one statement with Net::HTTP, an idempotency key, and the refusal code and fix.
  • Send email with Rust — A Rust binary that posts one shipment notice with ureq, an idempotency key, and the refusal code and fix.
  • Send email with Java — A Java program that posts one ticket with java.net.http, an idempotency key, and the refusal code and fix.
  • Send email with .NET — A .NET program that posts one booking with HttpClient, an idempotency key, and the refusal code and fix.
  • Send email with Elixir — An Elixir script that posts one signup with :httpc, an idempotency key, and the refusal code and fix.
  • Send email with TanStack Start — A TanStack Start server function that sends one form receipt with the Node SDK and replays a retried submit.
  • Send email with RedwoodJS — A RedwoodJS service function that sends one note with the Node SDK and returns the message id or the refusal.
  • Send email with Railway — A Node server you deploy on Railway, with the key in a service variable and one POST /send route.
  • Send email with Encore (TypeScript) — An Encore.ts endpoint that sends one workspace notice with the Node SDK and an idempotency key.
  • Send email with Encore (Go) — An Encore Go API function that posts one welcome note to POST /emails with net/http.
  • Send email with Supabase Edge Functions — A Supabase Edge Function that posts one invite with fetch. This is not the Send Email Hook.
  • Send email with Deno Deploy — A Deno Deploy app whose Deno.serve handler posts one preview notice. Separate from the Deno runtime guide.
  • Send email with Symfony — A Symfony controller action that posts one invoice notice to POST /emails with PHP streams.
  • Send email with Sinatra — A Sinatra POST block that sends one booking by calling a method which posts with Net::HTTP.
  • Send email with Axum — An Axum POST handler that posts one release note to POST /emails. The binary uses ureq for HTTP and TLS.
  • Send email with Phoenix — A Phoenix controller action that posts one booking notice through :httpc, which ships with Erlang.
  • Send email with Auth0 — An Auth0 custom email provider Action that posts the notification to POST /emails and returns code and fix.

Console

  • API keys — Create, rotate and delete keys on the API keys screen. A viewer can read the list. Creating one needs an admin or an owner.
  • Team — Invite people, change a role and remove a member from Settings, Team. An API key cannot make those changes. A signed-in person does.
  • Security — Turn on a second factor, copy the recovery codes once, and sign out other sessions. These calls are not in the published API reference.
  • Billing and overage — See the plan, start checkout, open the billing portal, and set an overage ceiling. Changing any of those needs the owner, signed in.
  • Notifications — Choose which conditions ring the bell and which send mail. The bell lists open conditions. Marking one read does not end it.
  • Agents — Pause every key, resume a fleet pause, decide a held send, and edit a budget. Resume and approvals need a signed-in person.
  • Logs — Read this account's API requests: method, route, status, duration and the refusal code. Request and response bodies are not stored.
  • Metrics — Counts and rates for 24 hours, 7 days, 30 days or 90 days, by domain and by key. Rate tiles stay hidden when the window is small.

Questions

Every endpoint

Each row carries the anchor the product links to. An error whose fix names an endpoint sends the reader to that anchor here.

contacts

domains

emails

Bounce classes

The four classes every bounce lands in, and the one action that changes each number. The Deliverability screen links a bounce row straight to these ids.

hard
The receiving server says the address does not exist. It never will. These addresses are already suppressed. Remove them at the source so the same list stops producing them — GET /suppressions lists every address we are holding back.
soft
A temporary refusal — mailbox full, greylisting, or the receiver was briefly unavailable. Nothing to clean. We retry these; a soft bounce only becomes your problem if the same address keeps soft-bouncing for days, at which point it is treated as hard.
block
The receiver refused the message on reputation or content, not on the address. This is the class that ends in a blocklist. Check the blocklists panel below, then cut volume on this domain until the rate falls. Recipients who never asked for the mail are the usual cause.
policy
The address is real and the receiver would take mail from you, but not this message — size, attachment type, or our own suppression list. Shrink the message or drop the attachment and send again. If the reason is suppression, the address is on a list you can inspect with GET /suppressions.

Catalogues