Skip to content
mxproxy

// api v1

API reference

Domains, forwarders and logs of your team, and the signed webhook of the channels.

Base URL https://app.mxproxy.dev/api/v1 · openapi.yaml

Overview

The mxproxy REST API lets a system manage the domains and forwarders of a team and read its message log. The page at https://mxproxy.dev/docs/api is generated from this file.

Authentication

  1. In the dashboard, open the user menu → API tokens and create a token with the permissions you need. The value is shown once: store it.
  2. Send it on every request: Authorization: Bearer <token> and Accept: application/json.

A token acts on the team that was selected when it was created (switching teams later does not change that). If you leave the team, the token gets 403. Writing also requires you to be the team’s owner or an admin.

Permission Grants
domains:read GET /domains, GET /domains/{id}, GET /domains/{id}/forwarders, GET /domains/{id}/patterns, GET /domains/{id}/rules, POST /domains/{id}/routing/test
domains:write create, change, delete and verify domains; create, change and delete forwarders, patterns and rules, and reorder them
logs:read GET /logs

Rate limit: 120 requests per minute per user (429 above that).

Responses and errors

Success is {"data": ...}; DELETE answers 204 with no body. Error messages are in Portuguese.

Status Body When
401 {"message": "Unauthenticated."} no token or an invalid one
403 {"message": "..."} a permission the token lacks, a role without write access, a team you left
404 {"message": "Não encontrado neste time."} an id of another team, or none at all
422 {"message": "...", "errors": {"field": ["msg"]}} validation
422 {"message": "...", "error": "plan_limit"} the plan allows no more (domains, forwarders, destinations per address, patterns or rules per domain); on the free plan, every write
502/503 {"message": "..."} the mail service refused or is unavailable: try again

Routing order

Mail to an address of a domain is decided by the first of these that applies:

  1. Rules (/domains/{id}/rules), enabled, in their order: the first that matches decides. A subject rule is only evaluable after DATA: the recipient is accepted (250) and the decision is made at the end of the message (a rejection then becomes 550 at the end of DATA when every recipient was rejected).
  2. The forwarder with that exact local_part.
  3. Plus addressing: one +tag removed at a time, from the right.
  4. Patterns (/domains/{id}/patterns), enabled, in their order: a regex over the local part.
  5. The domain’s catch-all.

Forwarders, patterns, rules and the catch-all each have an action: forward (the default), discard (accepted with 250, nothing delivered, discarded in the log, not counted in the usage) or reject (550 at RCPT; with reject_message, 550 5.7.1 <message>, without it 550 5.1.1 No such user here). Discarding or rejecting keeps a forwarder’s or the catch-all’s destinations and channels, ignored until it forwards again. Patterns and rules: Personal 5, Starter 20, Pro and up 100 per domain; the free plan has none. POST /domains/{id}/routing/test tells what would happen to an address, without sending anything.

Example

curl -s https://app.mxproxy.dev/api/v1/domains/$ID/forwarders \
  -H "Authorization: Bearer $TOKEN" -H 'Accept: application/json' -H 'Content-Type: application/json' \
  -d '{"local_part":"sales","destinations":["ana@gmail.com","bia@outlook.com"]}'

Domains

The domains of the team, the DNS records to create and their verification.

GET /domains

List the domains

Permission: domains:read.

Responses

StatusDescription
200 The domains of the team.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.

200 example

{
    "data": [
        {
            "id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
            "name": "cliente.com",
            "verified_at": "2026-10-17T12:00:00Z",
            "mx_ok": true,
            "spf_ok": true,
            "dkim_ok": false,
            "last_checked_at": "2026-10-17T12:00:00Z",
            "catch_all": [
                "owner@gmail.com"
            ],
            "catch_all_channel_ids": [
                "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f"
            ],
            "catch_all_action": "forward",
            "catch_all_reject_message": null,
            "spam_level": "normal",
            "created_at": "2026-10-17T11:00:00Z"
        }
    ]
}

POST /domains

Add a domain

Permission: domains:write. Generates the verification token and the DKIM key; read the domain to get the DNS records to create.

Body

FieldTypeDescription
name required string The domain, lowercase. Unique across mxproxy.
{
    "name": "cliente.com"
}

Responses

StatusDescription
201 The new domain.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
422 Validation (errors by field) or the plan’s limit (error = plan_limit; the free plan gets it for every write).

201 example

{
    "data": {
        "id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
        "name": "cliente.com",
        "verified_at": "2026-10-17T12:00:00Z",
        "mx_ok": true,
        "spf_ok": true,
        "dkim_ok": false,
        "last_checked_at": "2026-10-17T12:00:00Z",
        "catch_all": [
            "owner@gmail.com"
        ],
        "catch_all_channel_ids": [
            "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f"
        ],
        "catch_all_action": "forward",
        "catch_all_reject_message": null,
        "spam_level": "normal",
        "created_at": "2026-10-17T11:00:00Z"
    }
}

GET /domains/{id}

Get a domain and its DNS records

Permission: domains:read. dns_records are the records to create at your DNS provider: MX, SPF (TXT @), DKIM (TXT <selector>._domainkey) and the _mxproxy verification TXT. mta_sts (optional) is MTA-STS: point host (mta-sts.<domain>) to us with the CNAME in records; once the domain is verified and the CNAME resolves, we issue its certificate (certificate_until) and serve the policy at policy_url. Then publish the _mta-sts and _smtp._tls TXT records.

Parameters

NameInTypeDescription
id required path string (uuid) The domain’s id.

Responses

StatusDescription
200 The domain with the records to create.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
404 An id of another team, or none at all.

200 example

{
    "data": {
        "id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
        "name": "cliente.com",
        "verified_at": "2026-10-17T12:00:00Z",
        "mx_ok": true,
        "spf_ok": true,
        "dkim_ok": false,
        "last_checked_at": "2026-10-17T12:00:00Z",
        "catch_all": [
            "owner@gmail.com"
        ],
        "catch_all_channel_ids": [
            "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f"
        ],
        "catch_all_action": "forward",
        "catch_all_reject_message": null,
        "spam_level": "normal",
        "created_at": "2026-10-17T11:00:00Z",
        "dns_records": [
            {
                "type": "MX",
                "host": "@",
                "value": "mx.mxproxy.dev",
                "priority": 10,
                "rotation": "next",
                "until": "2026-10-17T12:00:00Z"
            }
        ],
        "mta_sts": {
            "host": "mta-sts.example.com",
            "policy_url": "https://mta-sts.example.com/.well-known/mta-sts.txt",
            "policy": "version: STSv1\r\nmode: testing\r\nmx: mx.mxproxy.dev\r\nmax_age: 86400\r\n",
            "records": [
                {
                    "type": "MX",
                    "host": "@",
                    "value": "mx.mxproxy.dev",
                    "priority": 10,
                    "rotation": "next",
                    "until": "2026-10-17T12:00:00Z"
                }
            ],
            "certificate_until": "2026-10-17T12:00:00Z"
        }
    }
}

PATCH /domains/{id}

Change the catch-all or the spam filter

Permission: domains:write. Send only the fields to change. An empty catch_all (and no catch-all channel) refuses mail to addresses without a forwarder.

Parameters

NameInTypeDescription
id required path string (uuid) The domain’s id.

Body

FieldTypeDescription
catch_all string[] Up to the plan’s destinations per address (Free 1, Personal 2, Starter 5, Pro and up 10): past it, 422 plan_limit.
catch_all_channel_ids string[] Channels (created in the dashboard) that get a summary of each catch-all message. Replaces the list.
catch_all_action "forward" | "discard" | "reject" forward delivers to the destinations; discard accepts (250) and delivers nothing (discarded in the log, not counted in the usage); reject answers 550 at RCPT (550 5.7.1 <reject_message>, or 550 5.1.1 No such user here without one). With discard or reject the destinations and channels are ignored.
catch_all_reject_message string | null The text of the 550 5.7.1 reply: printable ASCII (no accents, no line breaks), up to 100. Kept only with action: reject; blank is none.
spam_level "off" | "lenient" | "normal" | "strict" How strict the spam filter is. lenient refuses blatant spam and flags the very suspicious; normal refuses clear spam and flags the doubtful; strict refuses even likely spam and flags any suspicion; off passes everything. A flagged message arrives with X-Spam: Yes, X-Spam-Score and [SPAM] at the start of the subject.
{
    "catch_all": [
        "owner@gmail.com"
    ],
    "catch_all_channel_ids": [
        "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f"
    ],
    "catch_all_action": "forward",
    "catch_all_reject_message": "This address is no longer in use",
    "spam_level": "normal"
}

Responses

StatusDescription
200 The changed domain.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
404 An id of another team, or none at all.
422 Validation (errors by field) or the plan’s limit (error = plan_limit; the free plan gets it for every write).

200 example

{
    "data": {
        "id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
        "name": "cliente.com",
        "verified_at": "2026-10-17T12:00:00Z",
        "mx_ok": true,
        "spf_ok": true,
        "dkim_ok": false,
        "last_checked_at": "2026-10-17T12:00:00Z",
        "catch_all": [
            "owner@gmail.com"
        ],
        "catch_all_channel_ids": [
            "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f"
        ],
        "catch_all_action": "forward",
        "catch_all_reject_message": null,
        "spam_level": "normal",
        "created_at": "2026-10-17T11:00:00Z"
    }
}

DELETE /domains/{id}

Delete a domain

Permission: domains:write. Takes its forwarders and SMTP credentials with it; mail to the domain is refused from then on.

Parameters

NameInTypeDescription
id required path string (uuid) The domain’s id.

Responses

StatusDescription
204 Deleted.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
404 An id of another team, or none at all.

POST /domains/{id}/verify

Check the DNS now

Permission: domains:write. Looks up MX, SPF, DKIM and the verification TXT now and returns the result. DNS changes may take a few hours to propagate.

Parameters

NameInTypeDescription
id required path string (uuid) The domain’s id.

Responses

StatusDescription
200 The domain with the DNS just checked.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
404 An id of another team, or none at all.

200 example

{
    "data": {
        "id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
        "name": "cliente.com",
        "verified_at": "2026-10-17T12:00:00Z",
        "mx_ok": true,
        "spf_ok": true,
        "dkim_ok": false,
        "last_checked_at": "2026-10-17T12:00:00Z",
        "catch_all": [
            "owner@gmail.com"
        ],
        "catch_all_channel_ids": [
            "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f"
        ],
        "catch_all_action": "forward",
        "catch_all_reject_message": null,
        "spam_level": "normal",
        "created_at": "2026-10-17T11:00:00Z"
    }
}

Forwarders

Where each address of a domain goes.

GET /domains/{id}/forwarders

List the forwarders of a domain

Permission: domains:read.

Parameters

NameInTypeDescription
id required path string (uuid) The domain’s id.

Responses

StatusDescription
200 The forwarders.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
404 An id of another team, or none at all.

200 example

{
    "data": [
        {
            "id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
            "domain_id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
            "local_part": "sales",
            "destinations": [
                "ana@gmail.com",
                "bia@outlook.com"
            ],
            "enabled": true,
            "created_at": "2026-10-17T12:00:00Z",
            "channel_ids": [
                "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f"
            ],
            "note": null,
            "action": "forward",
            "reject_message": null
        }
    ]
}

POST /domains/{id}/forwarders

Create a forwarder

Permission: domains:write. In effect at once. No destination only when the forwarder has at least one channel (it then sends only the summary), or when it discards or rejects.

Parameters

NameInTypeDescription
id required path string (uuid) The domain’s id.

Body

FieldTypeDescription
local_part required string What comes before the @, lowercase letters, digits, ., -, + and _ (no . at either end, no .., no leading +). Plus addressing - sales+anything@ reaches sales@ with nothing to create; a forwarder named sales+shop gets its exact address, and any other tag still falls back to sales.
destinations string[] Up to the plan’s destinations per address (Free 1, Personal 2, Starter 5, Pro and up 10; channels do not count): past it, 422 plan_limit.
enabled boolean
channel_ids string[] Channels of the team (created in the dashboard, under Channels).
note string Who the address was given to.
action "forward" | "discard" | "reject" forward delivers to the destinations; discard accepts (250) and delivers nothing (discarded in the log, not counted in the usage); reject answers 550 at RCPT (550 5.7.1 <reject_message>, or 550 5.1.1 No such user here without one). With discard or reject the destinations and channels are ignored.
reject_message string | null The text of the 550 5.7.1 reply: printable ASCII (no accents, no line breaks), up to 100. Kept only with action: reject; blank is none.
{
    "local_part": "sales",
    "destinations": [
        "ana@gmail.com",
        "bia@outlook.com"
    ],
    "enabled": true,
    "channel_ids": [
        "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f"
    ],
    "note": "string",
    "action": "forward",
    "reject_message": "This address is no longer in use"
}

Responses

StatusDescription
201 The new forwarder.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
404 An id of another team, or none at all.
422 Validation (errors by field) or the plan’s limit (error = plan_limit; the free plan gets it for every write).

201 example

{
    "data": {
        "id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
        "domain_id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
        "local_part": "sales",
        "destinations": [
            "ana@gmail.com",
            "bia@outlook.com"
        ],
        "enabled": true,
        "created_at": "2026-10-17T12:00:00Z",
        "channel_ids": [
            "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f"
        ],
        "note": null,
        "action": "forward",
        "reject_message": null
    }
}

PATCH /forwarders/{id}

Change a forwarder

Permission: domains:write. Send only the fields to change; channel_ids replaces the whole list.

Parameters

NameInTypeDescription
id required path string (uuid) The forwarder’s id.

Body

FieldTypeDescription
destinations string[] Up to the plan’s destinations per address; a list already past it may be sent again unchanged.
enabled boolean
channel_ids string[]
note string | null null or "" clears it.
action "forward" | "discard" | "reject" forward delivers to the destinations; discard accepts (250) and delivers nothing (discarded in the log, not counted in the usage); reject answers 550 at RCPT (550 5.7.1 <reject_message>, or 550 5.1.1 No such user here without one). With discard or reject the destinations and channels are ignored.
reject_message string | null The text of the 550 5.7.1 reply: printable ASCII (no accents, no line breaks), up to 100. Kept only with action: reject; blank is none.
{
    "destinations": [
        "ana@gmail.com"
    ],
    "enabled": true,
    "channel_ids": [
        "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f"
    ],
    "note": "string",
    "action": "forward",
    "reject_message": "This address is no longer in use"
}

Responses

StatusDescription
200 The changed forwarder.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
404 An id of another team, or none at all.
422 Validation (errors by field) or the plan’s limit (error = plan_limit; the free plan gets it for every write).

200 example

{
    "data": {
        "id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
        "domain_id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
        "local_part": "sales",
        "destinations": [
            "ana@gmail.com",
            "bia@outlook.com"
        ],
        "enabled": true,
        "created_at": "2026-10-17T12:00:00Z",
        "channel_ids": [
            "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f"
        ],
        "note": null,
        "action": "forward",
        "reject_message": null
    }
}

DELETE /forwarders/{id}

Delete a forwarder

Permission: domains:write. Mail to the address then goes to the catch-all, or is refused.

Parameters

NameInTypeDescription
id required path string (uuid) The forwarder’s id.

Responses

StatusDescription
204 Deleted.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
404 An id of another team, or none at all.

Routing

Address patterns, routing rules and the routing tester.

GET /domains/{id}/patterns

List the address patterns of a domain

Permission: domains:read. In the order they are tried.

Parameters

NameInTypeDescription
id required path string (uuid) The domain’s id.

Responses

StatusDescription
200 The patterns.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
404 An id of another team, or none at all.

200 example

{
    "data": [
        {
            "id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
            "domain_id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
            "pattern": "(vendas|sales)-.*",
            "position": 0,
            "action": "forward",
            "destinations": [
                "ana@gmail.com"
            ],
            "reject_message": "string",
            "enabled": true,
            "note": "string",
            "created_at": "2026-10-17T12:00:00Z",
            "updated_at": "2026-10-17T12:00:00Z"
        }
    ]
}

POST /domains/{id}/patterns

Create an address pattern

Permission: domains:write. Goes to the end of the list. Patterns per domain: Personal 5, Starter 20, Pro and up 100 (past it, or on the free plan, 422 plan_limit).

Parameters

NameInTypeDescription
id required path string (uuid) The domain’s id.

Body

FieldTypeDescription
pattern required string A regular expression (Rust regex syntax: no backreferences nor lookaround) over the whole local part, always anchored (^(?:...)$) and case insensitive. Tried on the whole local part and then without each +tag.
action "forward" | "discard" | "reject" forward delivers to the destinations; discard accepts (250) and delivers nothing (discarded in the log, not counted in the usage); reject answers 550 at RCPT (550 5.7.1 <reject_message>, or 550 5.1.1 No such user here without one). With discard or reject the destinations and channels are ignored.
destinations string[] With action: forward, 1 up to the plan’s destinations per address (past it, 422 plan_limit); ignored and stored empty with discard or reject.
reject_message string | null The text of the 550 5.7.1 reply: printable ASCII (no accents, no line breaks), up to 100. Kept only with action: reject; blank is none.
enabled boolean
note string
{
    "pattern": "(vendas|sales)-.*",
    "action": "forward",
    "destinations": [
        "ana@gmail.com"
    ],
    "reject_message": "This address is no longer in use",
    "enabled": true,
    "note": "string"
}

Responses

StatusDescription
201 The new pattern.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
404 An id of another team, or none at all.
422 Validation (errors by field) or the plan’s limit (error = plan_limit; the free plan gets it for every write).

201 example

{
    "data": {
        "id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
        "domain_id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
        "pattern": "(vendas|sales)-.*",
        "position": 0,
        "action": "forward",
        "destinations": [
            "ana@gmail.com"
        ],
        "reject_message": "string",
        "enabled": true,
        "note": "string",
        "created_at": "2026-10-17T12:00:00Z",
        "updated_at": "2026-10-17T12:00:00Z"
    }
}

PUT /domains/{id}/patterns/order

Reorder the patterns of a domain

Permission: domains:write. ids lists every pattern of the domain, once each, in the new order (one missing or extra: 422 on ids).

Parameters

NameInTypeDescription
id required path string (uuid) The domain’s id.

Body

FieldTypeDescription
ids required string[] Every id of the list, once each, in the new order.
{
    "ids": [
        "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f"
    ]
}

Responses

StatusDescription
200 The patterns in the new order.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
404 An id of another team, or none at all.
422 Validation (errors by field) or the plan’s limit (error = plan_limit; the free plan gets it for every write).

200 example

{
    "data": [
        {
            "id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
            "domain_id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
            "pattern": "(vendas|sales)-.*",
            "position": 0,
            "action": "forward",
            "destinations": [
                "ana@gmail.com"
            ],
            "reject_message": "string",
            "enabled": true,
            "note": "string",
            "created_at": "2026-10-17T12:00:00Z",
            "updated_at": "2026-10-17T12:00:00Z"
        }
    ]
}

PATCH /patterns/{id}

Change a pattern

Permission: domains:write. Send only the fields to change.

Parameters

NameInTypeDescription
id required path string (uuid) The pattern’s id.

Body

FieldTypeDescription
pattern string A regular expression (Rust regex syntax: no backreferences nor lookaround) over the whole local part, always anchored (^(?:...)$) and case insensitive. Tried on the whole local part and then without each +tag.
action "forward" | "discard" | "reject" forward delivers to the destinations; discard accepts (250) and delivers nothing (discarded in the log, not counted in the usage); reject answers 550 at RCPT (550 5.7.1 <reject_message>, or 550 5.1.1 No such user here without one). With discard or reject the destinations and channels are ignored.
destinations string[] With action: forward, 1 up to the plan’s destinations per address (past it, 422 plan_limit); ignored and stored empty with discard or reject.
reject_message string | null The text of the 550 5.7.1 reply: printable ASCII (no accents, no line breaks), up to 100. Kept only with action: reject; blank is none.
enabled boolean
note string | null
{
    "pattern": "(vendas|sales)-.*",
    "action": "forward",
    "destinations": [
        "ana@gmail.com"
    ],
    "reject_message": "This address is no longer in use",
    "enabled": true,
    "note": "string"
}

Responses

StatusDescription
200 The changed pattern.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
404 An id of another team, or none at all.
422 Validation (errors by field) or the plan’s limit (error = plan_limit; the free plan gets it for every write).

200 example

{
    "data": {
        "id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
        "domain_id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
        "pattern": "(vendas|sales)-.*",
        "position": 0,
        "action": "forward",
        "destinations": [
            "ana@gmail.com"
        ],
        "reject_message": "string",
        "enabled": true,
        "note": "string",
        "created_at": "2026-10-17T12:00:00Z",
        "updated_at": "2026-10-17T12:00:00Z"
    }
}

DELETE /patterns/{id}

Delete a pattern

Permission: domains:write.

Parameters

NameInTypeDescription
id required path string (uuid) The pattern’s id.

Responses

StatusDescription
204 Deleted.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
404 An id of another team, or none at all.

GET /domains/{id}/rules

List the routing rules of a domain

Permission: domains:read. In the order they are tried.

Parameters

NameInTypeDescription
id required path string (uuid) The domain’s id.

Responses

StatusDescription
200 The rules.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
404 An id of another team, or none at all.

200 example

{
    "data": [
        {
            "id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
            "domain_id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
            "position": 0,
            "field": "sender",
            "operator": "equals",
            "value": "promo",
            "action": "forward",
            "destinations": [],
            "reject_message": "string",
            "enabled": true,
            "note": "string",
            "created_at": "2026-10-17T12:00:00Z",
            "updated_at": "2026-10-17T12:00:00Z"
        }
    ]
}

POST /domains/{id}/rules

Create a routing rule

Permission: domains:write. Goes to the end of the list. Rules per domain: Personal 5, Starter 20, Pro and up 100 (past it, or on the free plan, 422 plan_limit).

Parameters

NameInTypeDescription
id required path string (uuid) The domain’s id.

Body

FieldTypeDescription
field required "sender" | "sender_domain" | "recipient" | "subject" sender: the envelope sender (empty for a bounce); sender_domain: what comes after its @; recipient: the local part (with its +tag); subject: the decoded subject, only after DATA.
operator required "equals" | "contains" | "regex" Always case insensitive. regex on recipient is anchored to the whole local part; on the other fields it matches anywhere (use ^/$).
value required string
action required "forward" | "discard" | "reject" forward delivers to the destinations; discard accepts (250) and delivers nothing (discarded in the log, not counted in the usage); reject answers 550 at RCPT (550 5.7.1 <reject_message>, or 550 5.1.1 No such user here without one). With discard or reject the destinations and channels are ignored.
destinations string[] With action: forward, 1 up to the plan’s destinations per address (past it, 422 plan_limit); ignored and stored empty with discard or reject.
reject_message string | null The text of the 550 5.7.1 reply: printable ASCII (no accents, no line breaks), up to 100. Kept only with action: reject; blank is none.
enabled boolean
note string
{
    "field": "sender",
    "operator": "equals",
    "value": "promo",
    "action": "forward",
    "destinations": [
        "ana@gmail.com"
    ],
    "reject_message": "This address is no longer in use",
    "enabled": true,
    "note": "string"
}

Responses

StatusDescription
201 The new rule.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
404 An id of another team, or none at all.
422 Validation (errors by field) or the plan’s limit (error = plan_limit; the free plan gets it for every write).

201 example

{
    "data": {
        "id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
        "domain_id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
        "position": 0,
        "field": "sender",
        "operator": "equals",
        "value": "promo",
        "action": "forward",
        "destinations": [],
        "reject_message": "string",
        "enabled": true,
        "note": "string",
        "created_at": "2026-10-17T12:00:00Z",
        "updated_at": "2026-10-17T12:00:00Z"
    }
}

PUT /domains/{id}/rules/order

Reorder the rules of a domain

Permission: domains:write. ids lists every rule of the domain, once each, in the new order (one missing or extra: 422 on ids).

Parameters

NameInTypeDescription
id required path string (uuid) The domain’s id.

Body

FieldTypeDescription
ids required string[] Every id of the list, once each, in the new order.
{
    "ids": [
        "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f"
    ]
}

Responses

StatusDescription
200 The rules in the new order.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
404 An id of another team, or none at all.
422 Validation (errors by field) or the plan’s limit (error = plan_limit; the free plan gets it for every write).

200 example

{
    "data": [
        {
            "id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
            "domain_id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
            "position": 0,
            "field": "sender",
            "operator": "equals",
            "value": "promo",
            "action": "forward",
            "destinations": [],
            "reject_message": "string",
            "enabled": true,
            "note": "string",
            "created_at": "2026-10-17T12:00:00Z",
            "updated_at": "2026-10-17T12:00:00Z"
        }
    ]
}

PATCH /rules/{id}

Change a rule

Permission: domains:write. Send only the fields to change.

Parameters

NameInTypeDescription
id required path string (uuid) The rule’s id.

Body

FieldTypeDescription
field "sender" | "sender_domain" | "recipient" | "subject" sender: the envelope sender (empty for a bounce); sender_domain: what comes after its @; recipient: the local part (with its +tag); subject: the decoded subject, only after DATA.
operator "equals" | "contains" | "regex" Always case insensitive. regex on recipient is anchored to the whole local part; on the other fields it matches anywhere (use ^/$).
value string
action "forward" | "discard" | "reject" forward delivers to the destinations; discard accepts (250) and delivers nothing (discarded in the log, not counted in the usage); reject answers 550 at RCPT (550 5.7.1 <reject_message>, or 550 5.1.1 No such user here without one). With discard or reject the destinations and channels are ignored.
destinations string[] With action: forward, 1 up to the plan’s destinations per address (past it, 422 plan_limit); ignored and stored empty with discard or reject.
reject_message string | null The text of the 550 5.7.1 reply: printable ASCII (no accents, no line breaks), up to 100. Kept only with action: reject; blank is none.
enabled boolean
note string | null
{
    "field": "sender",
    "operator": "equals",
    "value": "string",
    "action": "forward",
    "destinations": [
        "ana@gmail.com"
    ],
    "reject_message": "This address is no longer in use",
    "enabled": true,
    "note": "string"
}

Responses

StatusDescription
200 The changed rule.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
404 An id of another team, or none at all.
422 Validation (errors by field) or the plan’s limit (error = plan_limit; the free plan gets it for every write).

200 example

{
    "data": {
        "id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
        "domain_id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
        "position": 0,
        "field": "sender",
        "operator": "equals",
        "value": "promo",
        "action": "forward",
        "destinations": [],
        "reject_message": "string",
        "enabled": true,
        "note": "string",
        "created_at": "2026-10-17T12:00:00Z",
        "updated_at": "2026-10-17T12:00:00Z"
    }
}

DELETE /rules/{id}

Delete a rule

Permission: domains:write.

Parameters

NameInTypeDescription
id required path string (uuid) The rule’s id.

Responses

StatusDescription
204 Deleted.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
404 An id of another team, or none at all.

POST /domains/{id}/routing/test

Test the routing of an address

Permission: domains:read (a read: open to the free plan). Tells what would happen to mail to <local_part>@<domain>; nothing is sent, and it works before the domain is verified.

Parameters

NameInTypeDescription
id required path string (uuid) The domain’s id.

Body

FieldTypeDescription
local_part required string
sender string The envelope sender (MAIL FROM); empty when left out.
subject string The subject; empty when left out.
{
    "local_part": "sales-ny",
    "sender": "joao@loja.com",
    "subject": "Order 42"
}

Responses

StatusDescription
200 What the router would do.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
404 An id of another team, or none at all.
422 Validation (errors by field) or the plan’s limit (error = plan_limit; the free plan gets it for every write).

200 example

{
    "data": {
        "address": "sales-ny@cliente.com",
        "stage": "rule",
        "rule_id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
        "pattern_id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
        "forwarder": null,
        "action": "forward",
        "destinations": [
            "ana@gmail.com"
        ],
        "channel_ids": [
            "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f"
        ],
        "reply": "250 2.1.5 OK",
        "description": "regra (assunto contém \"promo\")"
    }
}

Logs

What happened to each message, kept for 30 days.

GET /logs

Read the message log

Permission: logs:read. Newest first. For the next page, pass the next_before you got as before. Kept for 30 days.

Parameters

NameInTypeDescription
domain_id query string (uuid)
status query "accepted" | "rejected" | "spam" | "delivered" | "deferred" | "failed" | "skipped" | "discarded"
before query string (uuid) The next_before of the previous page.
limit query integer

Responses

StatusDescription
200 A page of the log.
401 No token, or an invalid one.
403 A permission the token lacks, a role without write access, or a team you left.
422 Validation (errors by field) or the plan’s limit (error = plan_limit; the free plan gets it for every write).

200 example

{
    "data": [
        {
            "id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
            "domain_id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
            "direction": "inbound",
            "mail_from": "joao@loja.com.br",
            "rcpt": "contato@cliente.com",
            "destination": "ana@gmail.com",
            "subject": "Pedido 42",
            "size": 48213,
            "status": "accepted",
            "detail": "rspamd score 8.20",
            "created_at": "2026-10-17T12:00:00Z",
            "channel_id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f"
        }
    ],
    "next_before": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f"
}

Webhooks

POST your URL

The summary of a received email (webhook channel)

A webhook channel (created in the dashboard, under Channels) gets a POST with the summary of each email of the forwarders and the catch-all you picked it on. The full email never goes to the webhook: only sender, recipients, subject, the first lines of the text (up to 3,500 characters, from text/plain or the HTML without tags) and the names of the attachments.

  • Only https:// and a public address: a URL that resolves to an internal network (loopback, private, link-local, CGNAT, cloud metadata) is refused.
  • Redirects are not followed (the delivery fails): use the final URL.
  • Timeout of 10 s. Answer 2xx quickly and process later.
  • 5xx, 408, 429 (with Retry-After in seconds, if you like) and connection failures are retried after 1 min, 5 min, 15 min, 30 min, 1 h, 2 h and every 4 h, for up to 5 days. Any other 4xx (and a redirect) gives up at once. Everything shows up in Logs.
  • Up to 60 summaries per hour per channel; the rest are not sent (skipped in the log). A message flagged as spam does not go to channels.
  • A retry repeats the same id: use it to ignore duplicates.

Verifying the signature

The secret (whsec_...) is shown once, when the channel is created: store it. X-Mxproxy-Signature is sha256= followed by the hex HMAC-SHA256, with the secret, of <X-Mxproxy-Timestamp>.<body> (the timestamp, a dot and the raw body, byte for byte, before any JSON parsing). Compare in constant time and refuse a timestamp more than 5 minutes away (it stops the replay of an old POST).

PHP:

<?php
$secret = getenv('MXPROXY_WEBHOOK_SECRET');
$body = file_get_contents('php://input');
$timestamp = $_SERVER['HTTP_X_MXPROXY_TIMESTAMP'] ?? '';
$signature = $_SERVER['HTTP_X_MXPROXY_SIGNATURE'] ?? '';

$expected = 'sha256='.hash_hmac('sha256', $timestamp.'.'.$body, $secret);

if (! hash_equals($expected, $signature) || abs(time() - (int) $timestamp) > 300) {
    http_response_code(401);
    exit;
}

$summary = json_decode($body, true);
http_response_code(204);

Node (Express; the body must arrive raw):

import crypto from 'node:crypto';
import express from 'express';

const app = express();

app.post('/mxproxy', express.raw({ type: 'application/json' }), (req, res) => {
  const timestamp = req.get('X-Mxproxy-Timestamp') ?? '';
  const signature = Buffer.from(req.get('X-Mxproxy-Signature') ?? '');
  const expected = Buffer.from(
    'sha256=' + crypto.createHmac('sha256', process.env.MXPROXY_WEBHOOK_SECRET).update(`${timestamp}.`).update(req.body).digest('hex'),
  );

  const valid = signature.length === expected.length && crypto.timingSafeEqual(signature, expected);
  if (!valid || Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) {
    return res.sendStatus(401);
  }

  const summary = JSON.parse(req.body);
  res.sendStatus(204);
});

Python (Flask):

import hashlib, hmac, os, time
from flask import Flask, abort, request

app = Flask(__name__)

@app.post('/mxproxy')
def mxproxy():
    timestamp = request.headers.get('X-Mxproxy-Timestamp', '')
    signature = request.headers.get('X-Mxproxy-Signature', '')
    body = request.get_data()  # raw bytes
    expected = 'sha256=' + hmac.new(os.environ['MXPROXY_WEBHOOK_SECRET'].encode(), timestamp.encode() + b'.' + body, hashlib.sha256).hexdigest()

    if not hmac.compare_digest(expected, signature) or abs(time.time() - int(timestamp or 0)) > 300:
        abort(401)

    summary = request.get_json()
    return '', 204

Telegram needs nothing on your side: the summary arrives as a message from the platform’s bot.

Parameters

NameInTypeDescription
X-Mxproxy-Timestamp required header string Unix time of this attempt, in seconds.
X-Mxproxy-Signature required header string sha256= + hex HMAC-SHA256(secret, <timestamp>.<raw body>).
User-Agent header string

Body

FieldTypeDescription
id required string (uuid) The delivery’s id, the same on every attempt.
received_at required string (date-time) When mxproxy received the email (UTC).
domain required string
alias required string The address that received it (with its +tag, if any).
from required string The From header (name and address).
to required string The addresses of the To header
subject required string | null
date required string | null (date-time) The email’s Date (RFC 3339).
text required string The beginning of the text.
truncated required boolean true when the text was cut.
attachments required object[] Name, type and size of each attachment; never the content.
attachments[].name required string
attachments[].content_type required string
attachments[].size required integer Bytes.
spam_score required number | null The spam filter’s score, or null if the domain does not filter.
{
    "id": "0192f0a0-7d1c-7b3e-9f00-5a1b2c3d4e5f",
    "received_at": "2026-10-17T14:06:40.123456Z",
    "domain": "cliente.com",
    "alias": "contato@cliente.com",
    "from": "João Silva <joao@loja.com.br>",
    "to": "string",
    "subject": "Pedido 42",
    "date": "2026-10-17T11:06:38-03:00",
    "text": "Olá,\n\nchegou o pedido 42.",
    "truncated": false,
    "attachments": [
        {
            "name": "nota.pdf",
            "content_type": "application/pdf",
            "size": 48213
        }
    ],
    "spam_score": 1.2
}

Responses

StatusDescription
2XX Delivered.
408 Retried later.
429 Retried later, not before the Retry-After you send.
5XX Retried later.
4XX Any other 4xx gives up at once (failed in the log).