# AI Agent Quickstarts



> Follow four task-based paths for a five-minute read, campaign drafting, an exact approval-based live send, and isolated sandbox testing without giving an agent broad workspace control.



- Human page: https://mailrith.com/developers/agent-quickstarts

- Markdown page: https://mailrith.com/developers/agent-quickstarts.md

- Category: AI Agent Platform

- Reading time: 12 min read

- Last updated: 2026-07-22

- Related keywords: AI Agent Quickstarts, AI Agent Quickstarts developer docs, AI Agent Platform, AI Agent Platform developer docs, Mailrith developer docs, Mailrith public API, Choose One Task And One Client, Five-Minute Read-Only Quickstart, Campaign-Drafting Quickstart, Approval-Based Live-Send Quickstart, Sandbox Tutorial, Agents, AI Agent Architecture And Security, MCP Server



## AI Agent Notes

- Use this page as implementation guidance, then validate exact endpoint fields against the OpenAPI document.

- Keep API keys server-side and workspace-scoped unless a guide explicitly says otherwise.

- Do not invent privacy, consent, or lawful-basis evidence. Send only fields that appear in the OpenAPI schema for the endpoint you are using.



## What this guide covers

Connect a read-only agent, create a campaign draft, route a live send for approval, and test the complete workflow in a sandbox.



## Choose One Task And One Client

Start with one outcome. A reporting agent needs read access, a Subscriber sync needs narrow write access, and a campaign operator needs drafting plus Mailrith's exact approval flow. Do not give one connection every permission because you may need those permissions later.

Mailrith is provider-independent. OpenAI, Claude, Codex, n8n, Pipedream, and other clients use the same hosted MCP endpoint, public API contract, workspace permissions, previews, and activity history.

AI Agent workflows are different from AI Writing. An agent connects from another client and can perform permitted workspace tasks. AI Writing creates copy inside a Mailrith editor and does not operate the workspace.

- Reporting: workspace viewing plus the exact read tools the report needs.
- Subscriber sync: Subscriber viewing and editing, with idempotency for repeatable jobs.
- Campaign drafting: Broadcast viewing and editing, without live-send permission.
- Campaign operation: drafting plus a separate plan, owner approval, and single-use execution token for a live send.

## Five-Minute Read-Only Quickstart

This path uses OAuth, so the user connects Mailrith without copying a raw API key into an agent client. The first connection should request workspace viewing only.

If the client cannot complete OAuth, stop and use the documented server-side Bearer-token path. Never paste a workspace key into a prompt, chat message, exported workflow, or browser script.

1. Open the agent client's MCP or connector settings and add a remote server named `Mailrith`.
2. Enter `https://api.mailrith.com/mcp` as the Streamable HTTP server URL.
3. Choose OAuth or click the client's `Connect` action. Sign in to Mailrith when the browser opens.
4. Choose the workspace, review the requested workspace-viewing permission, then approve only if the connection name and return address are expected.
5. Limit the client to `discovery_get_capabilities`, `subscribers_list`, and any other read-only tool needed for the task.
6. Ask: `Read Mailrith capabilities, then list at most 10 recent Subscribers. Do not write or send anything.`
7. Open Mailrith, switch to the same workspace, click `Agent Control`, open `Activity`, and confirm the request IDs and read outcomes match the task.

> The quickstart is complete only when capability discovery succeeds, the result is bounded, no write tool is available, and the activity record identifies the same connection.

## Campaign-Drafting Quickstart

Drafting is a normal write, but it is not a live send. Give the connection Broadcast viewing and editing without Broadcast sending. Keep the tool list to capability discovery, draft creation or update, draft reading, and preflight.

1. Create or update a dedicated OAuth connection with the `Campaign Drafting` permission preset.
2. Allow `discovery_get_capabilities`, `broadcasts_create`, `broadcasts_get`, `broadcasts_update`, and `broadcasts_preflight`. Do not allow `broadcasts_send`.
3. Ask the agent to create a draft with a clear subject, preview text, HTML body, and `draft` status.
4. Ask the agent to read the saved Broadcast and summarize the exact fields Mailrith stored.
5. Open `Campaigns`, click `Broadcasts`, open the draft, and review copy, links, merge fields, sender details, and selected Subscribers.
6. Run preflight, fix blocking issues, and leave the Broadcast as a draft unless a separate approved-send workflow is required.

> Draft permission never implies send permission. If a client claims otherwise, remove the send tool and check the connection in Agent Control.

## Approval-Based Live-Send Quickstart

A live send uses the same Broadcast delivery path as the Mailrith app. The agent first creates an exact plan. Mailrith performs preflight, records the target and input digest, and returns an approval link without contacting an email provider.

The owner approves the exact action in Mailrith. The requesting OAuth connection then claims a short-lived, single-use token and immediately repeats the unchanged operation. Mailrith rejects a changed target, body, idempotency key, stale version, expired plan, different credential, or reused token.

1. Confirm the Broadcast is complete, the selected Subscribers are correct, and preflight has no blocking issues.
2. Ask the agent to call the send operation in `plan` mode with the final Broadcast ID and idempotency key.
3. Copy only the returned Mailrith approval URL to the workspace owner. Never copy an approval token into chat.
4. In Mailrith, switch to the workspace, click `Agent Control`, click `Approvals`, and open the pending action.
5. Review the connection, operation, target, affected Subscribers, warnings, blocking issues, expiration, and request ID. Click `Approve` only when every detail matches the request.
6. Let the same agent connection claim the approval token and execute the unchanged action once. Keep the token only in memory.
7. Ask for Broadcast progress, then open `Agent Control` and check that planning, approval, execution, and final outcome share the same action and request identifiers.

## Sandbox Tutorial

Use an isolated sandbox before testing any write or high-impact workflow. Sandbox data is synthetic, email delivery connections are blocked, external dispatch is disabled, and reset reseeds a bounded dataset instead of adding another permanent copy.

1. Create or choose a workspace that has no email delivery connection and no real Subscriber data.
2. In Mailrith, switch to that workspace, click `Agent Control`, then open `Sandbox`.
3. Click `Enable Sandbox`, review the isolation notice, and confirm. Mailrith seeds bounded synthetic Subscribers and campaign data.
4. Connect the agent only to this sandbox workspace and run the read-only quickstart.
5. Run the drafting quickstart, then create a high-impact plan. Confirm that the preview names only synthetic sandbox targets.
6. Approve and execute the sandbox action, then review the redacted activity record and outcome.
7. Click `Reset Sandbox` when you need a clean run. Reset replaces the bounded seed data rather than preserving every test run.

> See [Agent Control, Approvals, And Sandbox](https://mailrith.com/docs/agent-approvals-and-sandbox.md) for the full user-facing walkthrough and screenshot.



## Related Guides

- [Agents](https://mailrith.com/developers/agents.md): Mailrith exposes a compact discovery stack for AI agents: llms files on the marketing site, version metadata on the API root, the versioned OpenAPI contract, authenticated capability discovery, and official SDK and MCP entry points after a workspace key is available.

- [AI Agent Architecture And Security](https://mailrith.com/developers/agent-security.md): Mailrith uses one public resource model, least-privilege credentials, typed operations, exact action approval, existing delivery safeguards, and compact redacted activity across every supported agent client.

- [MCP Server](https://mailrith.com/developers/mcp.md): Mailrith's official MCP server is the highest-level interface for agent runtimes. This page covers the remote endpoint and includes copy-paste examples for OpenAI, Claude, n8n, and Pipedream.
