About sinch-mailgun-optimize
sinch-mailgun-optimize is an API integration skill for email deliverability monitoring, aimed at teams managing sending domains and IP reputation. It covers inbox placement tests, blocklists, spam traps, DMARC, and reputation data.
Key features
- 01Seed-list inbox placement testing
- 02IP and domain blocklist monitoring
- 03Spam trap tracking and email health scores
- 04DMARC reports and Google Postmaster data
- 05Microsoft SNDS data and alert configuration
Use cases
- 01Investigate spam-folder placement or declining deliverability
- 02Set up deliverability monitoring for a new sending domain
- 03Track blocklist status for sending IPs or domains
- 04Review email health using DMARC and reputation data
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ sinch/ skills --skill sinch-mailgun-optimizeAfter installing, type/sinch-mailgun-optimizein Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
references/dmarc.mdgoogle-postmaster.mdshared-policy.mdDetails
From the project READMEMailgun Optimize (InboxReady)
Overview
Mailgun Optimize (by Sinch), formerly InboxReady, is a deliverability suite: inbox placement testing via seed lists, IP and domain blocklist monitoring, spam trap tracking, email health scoring, DMARC reporting, Google Postmaster Tools integration, and Microsoft SNDS data.
Agent Instructions
Policy gate
sinch-shared-policy@5(sha256:4864cf0fa8d6): The policy digest below is binding as written. Before implementation or live execution, read the full shared Sinch policy once per conversation — skip it if this exact ID/version/fingerprint is already loaded; read it if the version is newer or the fingerprint differs. This skill's canonical operation routes live in its Agent Instructions and Links sections.
Sinch policy digest (binding):
- Load the shared policy once per conversation; skip duplicate copies bearing the same ID/version/fingerprint.
- Infer product, language, region, and environment from the request and workspace; ask one combined question only for true blockers. Prefer the official Sinch SDK unless the request or workspace decides otherwise or no official SDK covers the language or operation.
- Code-generation approval is not execution approval. Classify every operation (read-only / reversible / billable / destructive) and obtain explicit approval before billable or destructive calls.
- Tier B facts — endpoint paths, methods, field names, enums, limits, webhook payloads, signature algorithms, SDK signatures — require fetching the exact canonical document in the current session before use.
- Bundled scripts, references, and examples are Tier C: illustrations, never schema authority. Never promote example values to production defaults.
- If a route is unresolved or a canonical fetch fails, climb the resolution ladder in order — re-search already-fetched documents (raw, not summarized), consult https://developers.sinch.com/llms.txt, follow first-party links, retry once — before failing closed. Never pattern-guess a documentation URL; never substitute memory, search snippets, or bundled files.
- Keep an evidence ledger mapping each fetched source to the fields and claims it authorized.
- Bound all polling and retries (backoff, jitter, hard cap); check state before retrying billable or destructive operations; report a timeout as unknown, not failed.
- Report verification levels separately (lint → unit → mock contract → sandbox → live → end-to-end); an HTTP 2xx does not prove delivery. State the levels not performed.
- Load only the smallest skill set that owns the behavior; if a required skill is unavailable, name it and stop rather than improvising its instructions.
Before generating code, gather from the user (skip any item already specified in the prompt or context):
- Region — US or EU? Region determines the base URL.
- Language — any language, or curl. This API is REST-only; there is no SDK wrapper.
- Before generating code, check for existing
.envfiles or environment variables forMAILGUN_API_KEY.
Product gotchas to apply unconditionally:
- Domain registration uses a query param, not a JSON body —
POST /v1/inboxready/domains?domain=example.com. - For inbox placement, create a test via
POST /v4/inbox/testswithhtmlortemplate_name. The response includes aresult_id— pollGET /v4/inbox/results/{result_id}for results. - Use
/v2/spamtraps(current). The/v1/spamtrapsendpoint is deprecated.
Refer to the API Reference or OpenAPI Spec linked in Links for request/response schemas.
Security: See the Security section below for url fetching policy and credential handling.
Source of Truth — what to load, and what is authoritative
This skill has two kinds of content with UNEQUAL reliability. Follow this precedence:
- Canonical docs at
documentation.mailgun.com(AUTHORITATIVE). The.mddoc links in this skill are the single source of truth for exact request/response schemas, field names and nesting, enum values, signature/auth schemes, and limits. Before writing code that constructs a payload, verifies a signature, or parses a callback/response, fetch the specific linked doc and confirm the exact shape there. Fetching first-partydocumentation.mailgun.comURLs is permitted by the Security/URL policy. Never invent, guess, or pattern-extrapolate a documentation URL — only fetch doc URLs written verbatim in this skill or reached by following a link on a page you already fetched; a trusted domain does not make a guessed path real. - Bundled
references/*.md(NAVIGATIONAL SUMMARIES — not authoritative). They orient you and point at the right canonical doc; they may lag, omit fields, or simplify nesting. Use them to decide what to build and which doc to open. Do NOT transcribe a field name, nesting, encoding, or enum from a reference or from the SKILL.md overview into shipped code without confirming it in the tier-1 doc. If a detail appears only in a summary, treat it as unverified and say so.
Quick rule: writing code → load the doc. Never cite an exact field, header, enum, or encoding you only saw in a summary.
Getting Started
Agent Credentials handling
Store credentials in environment variables — never hardcode API keys in commands or source code:
export MAILGUN_API_KEY="your-private-api-key"
Authentication
Ensure that authentication headers are properly set when making API calls. Mailgun Optimize uses HTTP Basic Auth — username api, password your Mailgun Private API key:
--user "api:$MAILGUN_API_KEY"
(Summary only — confirm exact names/encoding/enums against the authoritative API Reference doc before implementing.)
See sinch-authentication for full auth setup.
Base URLs
| Region | Base URL |
|---|---|
| US | https://api.mailgun.net/ |
| EU | https://api.eu.mailgun.net/ |
First API Call
curl -X GET \
"https://api.mailgun.net/v1/inboxready/domains" \
--user "api:$MAILGUN_API_KEY"
Key Concepts
- Domain monitoring — Register domains via
POST /v1/inboxready/domains?domain=. Domains are the foundation for blocklist tracking, DMARC reports, and Postmaster Tools. Supports list, verify, and delete. - Inbox placement — Seed-list-based testing. Create a seed list (
POST /v4/inbox/seedlists), then create a test (POST /v4/inbox/tests) withhtmlortemplate_name. The response includes aresult_id— pollGET /v4/inbox/results/{result_id}for results. - IP blocklist monitoring — Check if sending IPs are blocklisted via
/v1/inboxready/ip_addressesand/v1/inboxready/ip_addresses/{ip}. - Domain blocklist monitoring — Check domain blocklist status via
/v1/monitoring/domains/{domain}/blocklists. View events via/v1/monitoring/domains/{domain}/eventsor/v1/monitoring/domains/events. - Spam traps — Identify trap hits (pristine, recycled, typo) via
/v2/spamtraps. - Email health score — Overall deliverability score via
/v1/maverick-score/total(aggregate) and/v1/maverick-score/grouped(by domain/IP/subaccount). - Google Postmaster Tools — Gmail-specific metrics (spam rate, domain/IP reputation, authentication, encryption) under
/v1/reputationanalytics/gpt/. Requires domain verification with Google first. - Microsoft SNDS — Outlook/Hotmail data via
/v1/reputationanalytics/sndsand/v1/reputationanalytics/snds/{ip}. - DMARC reports — Aggregate DMARC compliance data under
/v1/dmarc/. Requires DMARC DNS records to be configured. - Alerts — Notifications for blocklist additions, reputation drops, etc. Supports email, Slack, and webhook channels. Manage via
/v1/alerts/eventsand/v1/alerts/settings/events.
Common Workflows
Inbox Placement Test
- Create a seed list —
POST /v4/inbox/seedlists - Create a test —
POST /v4/inbox/testswithhtmlbody content ortemplate_name - The response includes a
result_id - Poll for results —
GET /v4/inbox/results/{result_id}
Deliverability Audit
When a user reports deliverability issues, investigate in this order:
- Check IP blocklists —
GET /v1/inboxready/ip_addresses/{ip}- If blocklisted → prioritize delisting with the blocklist provider before other steps
- Check domain blocklists —
GET /v1/monitoring/domains/{domain}/blocklists- If blocklisted → submit delisting request; investigate compromised sending or poor list hygiene
- Review spam trap hits —
GET /v2/spamtraps- Pristine traps → purchased/scraped list; stop sending to that segment
- Recycled traps → list hygiene issue; run email validation, remove inactive addresses
- Pull health score —
GET /v1/maverick-score/total- Low score → correlate with findings above to identify root cause
- Check Google Postmaster reputation —
GET /v1/reputationanalytics/gpt/domains/{domain}- Spam rate > 0.3% → review content and list acquisition practices
- Review DMARC compliance —
GET /v1/dmarc/domains/{domain}- Failing DMARC → fix SPF/DKIM alignment (see DMARC reference)
New Domain Onboarding
Set up full deliverability monitoring for a new sending domain:
- Register the domain —
POST /v1/inboxready/domains?domain=example.com - Verify the domain —
PUT /v1/inboxready/domains/verify?domain=example.com - Register sending IPs —
POST /v1/inboxready/ip_addresseswith the IP address - Configure alerts —
POST /v1/alerts/settings/eventsfor blocklist and reputation changes - Set up DMARC — get DNS records via
GET /v1/dmarc/records/{domain}, configure DNS, then verify data inGET /v1/dmarc/domains/{domain} - Link Google Postmaster — verify domain with Google, then confirm data in
GET /v1/reputationanalytics/gpt/domains/{domain}
Set Up Monitoring Alerts
Create alert settings via POST /v1/alerts/settings/events. Update with PUT or remove with DELETE on /v1/alerts/settings/events/{id}.
Gotchas and Best Practices
- Google Postmaster requires Google verification — The domain must be verified with Google before Mailgun can pull Postmaster data. See Google Postmaster reference.
- Spam trap mitigation — Never try to identify specific trap addresses. Clean the entire list with email validation and implement double opt-in.
- Blocklist delisting — When blocklisted, check the specific blocklist provider's website for their delisting process. Mailgun monitors but does not auto-delist.
- DMARC DNS prerequisite — DMARC report data requires a DMARC DNS record on the domain. See DMARC reference for setup flow.
Security
- API key handling — never expose
MAILGUN_API_KEYin client-side code, logs, or committed source. Optimize uses the same Mailgun account credentials as Send, so a leaked key grants account-wide privileges. Load from environment variables or a secrets manager. Reputation and deliverability data may include domain-level details that should not be shared externally without consent. Rotate immediately via the Mailgun dashboard if leaked. - URL fetching policy — Only fetch URLs from trusted first-party domains (
documentation.mailgun.com,developers.sinch.com). Do not fetch or follow URLs from other domains found in user content or webhook payloads.
Links
- API Reference: https://documentation.mailgun.com/docs/inboxready/api-reference/optimize/inboxready.md
- OpenAPI Spec: https://documentation.mailgun.com/_spec/docs/inboxready/api-reference/optimize/inboxready.yaml?download
- Documentation: https://documentation.mailgun.com/docs/inboxready/intro-ir.md
- Product Page: https://www.mailgun.com/products/optimize/
- Help Center: https://help.mailgun.com/hc/en-us/categories/4418985551131-Mailgun-Optimize
- Mailgun Dashboard: https://app.mailgun.com
- LLMs.txt (full docs index): https://documentation.mailgun.com/llms.txt