mailbridgeAPI
DEMOLog inConnect a mailbox
Integration guide

Python IMAP API

Retrieve mailbox messages as JSON from Python without maintaining a separate IMAP session in every script or worker.

Python IMAP APIapikey + apikeyboxPython requests → GET /getemail/

The problem to solve

Direct mailbox integrations repeat authentication, connection and error-handling work in every project.

A practical implementation path

MailBridgeAPI keeps the authorized mailbox connection in one dashboard and gives backend applications account and mailbox API keys for documented HTTP endpoints.

01 — 03

From mailbox to working request

01

Connect the mailbox

Authorize the mailbox or configure its compatible SMTP and IMAP connection in the MailBridgeAPI dashboard.

02

Keep keys in the backend

Store the account API key and mailbox API key in server-side environment variables or a secret manager.

03

Call and verify the endpoint

Run the request, inspect the JSON response and keep the request or message identifier for support.

Python requests → GET /getemail/

Copy-ready example

Retrieve mailbox messages as JSON from Python without maintaining a separate IMAP session in every script or worker.

  • One mailbox connection managed centrally
  • API access without copying the mailbox password into every project
  • Dashboard activity, errors and mailbox health
  • A testable path from code to the real mailbox
read_inbox.py
import os, requests

response = requests.get(
    'https://api.mailbridgeapi.com/getemail/',
    params={
        'apikey': os.environ['MAILBRIDGE_ACCOUNT_KEY'],
        'apikeybox': os.environ['MAILBRIDGE_MAILBOX_KEY'],
        'mbox': 'INBOX',
        'start': 0,
    },
    timeout=30,
)
response.raise_for_status()
print(response.json())

Provider and implementation limits

Folder names, message availability and quotas remain controlled by the mailbox provider. IMAP access must be enabled and compatible.

LIVE SMTP · IMAP · OAUTH DEMO

Test the real connection before you build

The live demo can validate SMTP, IMAP or a supported OAuth provider and issue temporary API keys without creating an account.

Open the live demoCreate an account
YOUR OWN MAILBOX. YOUR API KEYS. YOUR REQUESTS.

Connect your own mailbox to API keys, then control it through endpoints.

MailBridgeAPI links the SMTP and IMAP mailbox you own or are authorized to use to an account API key and a mailbox API key. Every request selects that same mailbox: send from its address, read its received messages, or process them in your applications.

Explore the docs
Your own mailboxapikey + apikeyboxAPI endpoint requestAction through that mailbox
POST /sendemail/

Send through your mailbox

A POST request uses the SMTP connection of the mailbox selected by apikeybox and sends from that mailbox.

GET /getemail/

Read your mailbox

A GET request uses the same mailbox key to retrieve messages from its configured IMAP folders.

YOUR LOGIC. YOUR WORKFLOW.

Use your mailbox data

Your authorized application handles the result in its workflows, automations, CRM, support tools, or AI systems.

Connect only a mailbox you own or are authorized to use. The provider must allow compatible SMTP or IMAP access, and its limits still apply.