# AI Agent Examples



> Each example demonstrates one safe Mailrith workflow, lists its required permissions, and keeps reads, retries, writes, approvals, and stored data bounded.



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

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

- Category: AI Agent Platform

- Reading time: 5 min read

- Last updated: 2026-07-22

- Related keywords: AI Agent Examples, AI Agent Examples developer docs, AI Agent Platform, AI Agent Platform developer docs, Mailrith developer docs, Mailrith public API, Example Workflows, Run An Example Safely, AI Agent Quickstarts, SDKs, AI Agent Client Compatibility



## 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

Use small reporting, Subscriber sync, campaign drafting, and approval-based campaign operator examples with narrow permissions and bounded work.



## Example Workflows

The repository includes four small examples built on the official SDK and CLI contract. Each example has one task, lists its required permissions, limits pagination, carries request IDs, and stops before a high-impact action unless the exact approval flow is complete.

- Reporting agent: bounded capability, Subscriber, Broadcast, and progress reads.
- Subscriber-sync agent: idempotent upserts with stable source keys and no bulk status changes.
- Campaign-drafting agent: creates and reads a draft, then runs preflight without sending.
- Approval-based operator: plans an exact send, waits for owner approval, claims the token in memory, executes once, and checks progress and activity.

## Run An Example Safely

1. Use a sandbox workspace and a dedicated OAuth connection or task-specific key.
2. Read the example's required permissions and remove any permission the test does not need.
3. Set secrets in the environment. Do not edit secrets into the example source or configuration.
4. Run capability discovery before the example's first operation.
5. Keep the default page and polling limits during the first run.
6. Review activity in Agent Control and reset the sandbox when the run is complete.

**Example Directory**

```text
examples/agents/reporting
examples/agents/subscriber-sync
examples/agents/campaign-drafting
examples/agents/approved-campaign-operator
```



## Related Guides

- [AI Agent Quickstarts](https://mailrith.com/developers/agent-quickstarts.md): 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.

- [SDKs](https://mailrith.com/developers/sdks.md): Mailrith ships official TypeScript and Python SDKs generated from the same public contract that powers the OpenAPI document and capability map.

- [AI Agent Client Compatibility](https://mailrith.com/developers/agent-compatibility.md): Use the current compatibility matrix and read-only starter configurations, then record live conformance against an exact client build or review date before making a support claim.
