name: agentmail-sdk-integration description: Integrate AgentMail into Python or Node.js applications with accurate API/SDK interfaces, input-output types, and data structures. Use when implementing inbox/message/thread/draft/domain/webhook/websocket/metrics/pod workflows, generating AgentMail client code, reviewing AgentMail integration correctness, or mapping business requirements to concrete AgentMail endpoints.
AgentMail SDK Integration
Overview
Use this skill to turn AgentMail requirements into production-ready Python or Node implementations. Prefer generated references for endpoint contracts and types instead of guessing SDK signatures.
Workflow
- Identify language target (
PythonorNode) and integration mode (SDK,REST,Webhook,WebSocket). - Load
references/documentation-guide.mdfor architecture and operational guidance. - Load language file:
- Python:
references/python-sdk.md - Node:
references/node-sdk.md
- Python:
- Validate endpoint contract against
references/endpoint-matrix.md. - Resolve field-level structure from
references/data-structures.md. - Implement with idempotency (
client_id) for create operations and signature verification for webhooks.
Language Selection Rules
- Use
references/python-sdk.mdwhen generating Python code withAgentMail/AsyncAgentMail. - Use
references/node-sdk.mdwhen generating TypeScript/Node code withAgentMailClient. - Use
references/endpoint-matrix.mdfor cross-language parity checks and unsupported SDK convenience paths. - Use
references/documentation-guide.mdwhen designing flow-level behavior (send/receive loop, webhook lifecycle, deliverability, IMAP/SMTP fallback).
Implementation Rules
- Always include both
textandhtmlwhen sending messages, unless requirements explicitly constrain format. - Always use deterministic
client_idfor create operations (inbox,webhook,pod, etc.). - Always verify webhook signatures (
svix-id,svix-timestamp,svix-signature) before trusting payload. - Always model reply/forward flows with
message_idandthread_idto preserve conversation continuity. - Always handle
from_compatibility in payload parsing (from_vsfrom). - Always treat list management APIs (
/lists,/pods/{pod_id}/lists) as REST-first if SDK helper methods are not available. - Always confirm filtering/pagination inputs (
limit,page_token,before,after,labels,ascending,include_spam,include_blocked) from reference before coding.
Output Expectations
When asked to generate code, produce:
- Runnable snippet(s) for the requested language.
- Explicit method/interface used and parameter mapping.
- Input/output type annotations aligned with references.
- Notes for error handling, retries, and idempotency.
- Event handling path if real-time behavior is involved (webhook or websocket).
Refresh References
Run this script to re-sync docs and regenerate references from docs.agentmail.to:
python scripts/sync_agentmail_references.py --skill-dir .
References
references/documentation-guide.md: product-level behavior and best practices.references/python-sdk.md: Python interface map, IO types, and examples.references/node-sdk.md: Node interface map, IO types, and examples.references/endpoint-matrix.md: full endpoint contract matrix across protocols.references/data-structures.md: schema field inventory.