Mailgun mock API
Stateful Mailgun replica: domains with verify, message send with accepted/delivered webhooks, mailing lists and members, bounces/unsubscribes/complaints, templates and webhook registration.
At a glance
- Operations
- 206
- Stateful operations
- 52
- Stateful resources
- 6
- Webhook events
- 3
- Vendor API version
- v3/v4 (spec 3.0.0)
- Verification
- Spec-verified
How it works
Use Mailgun without calling Sinch Mailgun
- Install the mock from the library into a workspace. It runs as a virtual service.
- Point your client's base URL at the virtual service instead of the vendor.
- Authenticate the way you already do. The mock accepts the same credential shape:
Authorization: Basic YXBpOmtleS0wMTIzNDU2Nzg5YWJjZGVm State
Resources that remember
Writes persist per caller, so a create followed by a read returns what you created.
| Resource | Operations |
|---|---|
| Domains | 6 |
| Messages | 1 |
| Suppressions | 15 |
| Lists | 11 |
| Templates | 12 |
| Webhooks | 7 |
Webhooks
Events your handlers can receive
- accepted
- delivered
- unsubscribed
Deliveries are unsigned: Mailgun puts timestamp/token/signature inside the JSON body, signed with HMAC-SHA256(signing key, timestamp + token); not reproducible by a header signer.
Coverage
206 operations
52 of them are stateful. The largest groups:
| Group | Operations |
|---|---|
| Other operations | 154 |
| Suppressions | 15 |
| Templates | 12 |
| Lists | 11 |
| Webhooks | 7 |
| Domains | 6 |
Verification
Spec-verified
Generated operations are checked against the vendor OpenAPI description, which proves shape and routing. Stateful operations and scenario suites prove behaviour. Responses are not yet compared with a live vendor sandbox.
10 operations cannot be checked against the specification.
Source and limits
License, source and limits
- Generated from the Sinch Mailgun API description, licensed under Apache-2.0.
- Sinch Mailgun API documentation
- Source specification
Each collection holds up to 1 MiB of objects per API key; writes beyond that are dropped (x-maxoperf-vs-state: capacity). Message send stores nothing and never delivers: it emits accepted (immediately) and delivered (after 1.5 s) event webhooks to the URLs registered through the webhooks API (o:testmode=yes emits none) and a POST to the unsubscribes table emits unsubscribed. Deliveries are unsigned because Mailgun puts timestamp/token/signature inside the JSON body, so the signature object is omitted. Webhook registrations of any domain receive the events of every domain of the same API key, and each event type holds one URL (registering again replaces it); the v4 DELETE and the events API (GET /v3/{domain}/events) stay generated samples. Domains verify without DNS checks (verify flips unverified to active); sandbox recipient limits are not enforced and unverified domains can send. Timestamps created by the mock are ISO 8601 (seed data uses RFC 1123 like the vendor). Suppression and template lists page with limit (at most 100), page=first|last|next|previous and an address (or p) cursor; term filters, imports and allowlists are not modelled. The EU host api.eu.mailgun.net is the same API and is not modelled separately. 401 is the plain-text Forbidden; 429 and 5xx are never produced.
MaxoPerf is not affiliated with, endorsed by, or sponsored by Sinch Mailgun. Mailgun is a trademark of its owner.