PolpoMail
Use cases

Send supplier invoices straight to your accounting workflow

When an invoice arrives at invoices@, your webhook gets the details and a link to download each PDF with the REST API, ready for bookkeeping or OCR.

Why automate it

Suppliers email PDF invoices to an accounts address, and someone downloads them one by one. With a webhook, each new invoice email triggers your workflow, which downloads the attachments and passes them to your accounting software or OCR service.

How it works

Set it up in three steps

  1. 1

    Filter the invoices mailbox

    Use To or Cc matches ^(invoices|accounts)@ so only billing mail triggers the workflow.

  2. 2

    Read the attachment list

    Each attachment comes with its name, type, size and a REST API url. The file content isn't in the webhook, which keeps requests small.

  3. 3

    Download and process

    Fetch each PDF with an access token that has the read scope, then send it to OCR, your accounting tool or a shared drive.

Settings

The webhook to create

In Settings › Developer, after you sign in.

FormatJSON
From matchesempty (any sender)
To or Cc matches^(invoices|accounts)@
Request headersnone needed
Extra JSON{"workflow": "accounts-payable"}
  • Invoices go into the workflow as soon as they arrive, not at month end.
  • Attachments stay in your mailbox, so you keep the original email for audits.
  • The access token for downloads can be limited to read-only.
Example

Python: download the PDF attachments

Every request includes the webhook's token in X-Polpo-Webhook-Token; check it first. See the payload reference.

@app.post("/hooks/invoices")
def invoice():
    if not hmac.compare_digest(request.headers.get("X-Polpo-Webhook-Token", ""), TOKEN):
        abort(401)
    m = request.json["message"]
    for a in m["attachments"]:
        if a["content_type"] == "application/pdf":
            pdf = requests.get(a["url"], headers={"Authorization": f"Bearer {READ_TOKEN}"}).content
            accounting.upload(pdf, supplier=m["from"]["address"], subject=m["subject"])
    return "", 204
FAQ

Common questions

Why aren't attachments included in the webhook itself?

Attachments can be large, and most endpoints only need some of them. The payload lists every attachment with a download url; fetch the ones you need with an access token that has the read scope.

Can I filter by supplier instead?

Yes. Use From matches, for example *@supplier.example, or a regular expression covering several suppliers. If both From and To/Cc are set, a message must match both.

Is this included in the free plan?

Yes. Webhooks, the REST API and access tokens are included free, with up to 5 webhooks per mailbox and up to 10 mailboxes per domain.

More use cases

Start with one webhook.

Free business email on your own domain, with webhooks and a REST API included.

Create your free workspace