How to check email mailboxes from the SWPanel REST API

How to check email mailboxes from the SWPanel REST API

How to integrate the email mailbox query endpoint in the SWPanel API

The SWPanel REST API allows you to fully automate the management of email services, mailboxes, mail accounts and associated configurations from external applications, SaaS platforms, DevOps tools or enterprise integrations.

One of the most useful endpoints within the SWPanel email ecosystem is the mailbox detail query endpoint:

GET /v2026/services/{id_service}/mail/mailbox/{email}/

Official OpenAPI documentation:

https://api.swpanel.com/v2026/redoc?l=EN#tag/email/paths/~1v2026~1services~1{id_service}~1mail~1mailbox~1{email}~1/get

Official GitHub repository:

https://github.com/swpanel

This endpoint allows you to retrieve all information associated with a specific email account hosted within a hosting or mail service managed from SWPanel.

The combination of OpenAPI documentation and public examples on GitHub greatly facilitates the development of advanced automations related to email.


What this endpoint allows

The endpoint:

GET /v2026/services/{id_service}/mail/mailbox/{email}/

allows you to query all information associated with a specific mailbox.

The query is performed using:

  • The service identifier (id_service)
  • The full email address (email)

Depending on the type of service and configuration, the response may include:

  • Email address
  • Account status
  • Assigned quota
  • Used space
  • IMAP configuration
  • POP3 configuration
  • SMTP configuration
  • Operational status
  • Configured limits
  • Mailbox technical information
  • Security configuration

This endpoint is especially useful in integrations related to corporate email automation and centralized email account management.


Common use cases

This endpoint is usually used for:

  • Client portals
  • Hosting automation
  • ERP integrations
  • ITSM tools
  • Monitoring dashboards
  • Email audits
  • DevOps systems
  • SaaS platforms
  • Technical support automation

Endpoint

GET /v2026/services/{id_service}/mail/mailbox/{email}/

Authentication

The API uses Bearer Token authentication.

Required header:

Authorization: Bearer TU_TOKEN

The official examples published by SWPanel on GitHub use this same authentication model:

https://github.com/swpanel


Parameters

Path parameters

Parameter Type Description
id_service integer/string Unique service identifier
email string Email address

CURL example

curl --request GET \\\\\\\\\\\\\\\\
  --url https://api.swpanel.com/v2026/services/12345/mail/mailbox/[email protected]/ \\\\\\\\\\\\\\\\
  --header 'Authorization: Bearer TU_TOKEN'

Example JSON response

{
  "email": "[email protected]",
  "status": "active",
  "quota": 2048,
  "used": 512,
  "imap": true,
  "pop3": true,
  "smtp": true,
  "created_at": "2026-01-10T10:30:00Z"
}

Relationship with the mailbox listing

The real potential of this endpoint appears when it is combined with mailbox listing endpoints.

The usual flow in enterprise integrations is:

1. Obtain mailbox list
2. Iterate through each email address
3. Query individual detail
4. Process information
5. Automate operations

This pattern allows you to build fully automated email management platforms.


Email platform automation

The API allows you to build tools capable of:

  • Auditing mailboxes
  • Detecting inactive accounts
  • Controlling quotas
  • Monitoring used space
  • Automating reporting
  • Detecting incidents
  • Integrating external platforms

This is especially useful in corporate environments with multiple domains and hundreds or thousands of email accounts.


Integration with DevOps platforms

Although email APIs have traditionally been oriented exclusively towards manual administration, SWPanel allows email operations to be integrated into automated pipelines.

For example:

  • Automatic provisioning
  • Environment creation
  • Onboarding automation
  • Multi-tenant management
  • SaaS integration
  • IT automation

SWPanel maintains an API-first and DevOps-ready orientation in its latest versions:

https://swpanel.com/en/changelog


GitHub integration and public examples

One of the great values of the SWPanel ecosystem is the availability of public repositories and official examples on GitHub.

Official repository:

https://github.com/swpanel

Among the available projects are:

Repository Description
Example-Login-Swpanel Automatic login integration
Example-Domain-Lookup Domain lookup
Example-Domain-Register Automatic domain registration
Example-Cloud-Purchase Cloud automation
SW-WHMCS8 WHMCS integration

These repositories greatly accelerate enterprise integrations and complex automations.


Practical Python example

import requests

TOKEN = "TU_TOKEN"

SERVICE_ID = 12345

EMAIL = "[email protected]"

url = f"https://api.swpanel.com/v2026/services/{SERVICE_ID}/mail/mailbox/{EMAIL}/"

headers = {
    "Authorization": f"Bearer {TOKEN}"
}

response = requests.get(url, headers=headers)

if response.status_code == 200:

    data = response.json()

    print("Account:", data["email"])
    print("Status:", data["status"])
    print("Quota:", data["quota"])

else:

    print("Error:", response.status_code)

Practical PHP example

<?php

$token = "TU_TOKEN";

$id_service = 12345;

$email = "[email protected]";

$url = "https://api.swpanel.com/v2026/services/$id_service/mail/mailbox/$email/";

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer $token"
    ],
]);

$response = curl_exec($curl);

curl_close($curl);

$data = json_decode($response, true);

print_r($data);

Business use cases

Automatic mailbox auditing

It allows you to build automatic systems capable of:

  • Detecting unused mailboxes
  • Reviewing quotas
  • Detecting saturated accounts
  • Monitoring storage

ERP integration

ERP systems can:

  • Relate mailboxes to users
  • Automate registrations and cancellations
  • Monitor resources
  • Manage incidents

SaaS platforms

Multi-tenant platforms can automatically synchronize:

  • Users
  • Domains
  • Mailboxes
  • Email configuration

ITSM tools

Support platforms can:

  • Query mailboxes
  • Verify statuses
  • Automate incidents
  • Validate configurations

Recommended best practices

Cache responses

When information does not change constantly, it is advisable to use cache:

  • Redis
  • Memcached
  • Local cache

This reduces latency and load on the API.


Handle HTTP errors

Responses such as the following should always be considered:

Code Meaning
401 Invalid token
403 Access denied
404 Mailbox does not exist
429 Rate limit
500 Internal error

Validate statuses

Never assume that an email account is operational simply because it exists.

For example:

{
  "status": "active"
}

Security

Common recommendations:

  • Rotate tokens periodically
  • Restrict permissions
  • Record audits
  • Use HTTPS exclusively

Integration with monitoring systems

The API allows mailbox information to be integrated with:

  • Zabbix
  • Grafana
  • Prometheus
  • Datadog
  • Internal systems

This makes it easier to create advanced corporate email dashboards.


Complete corporate email automation

A common scenario may consist of:

1. Obtain mailbox list
2. Query individual detail
3. Detect saturated quotas
4. Generate alerts
5. Synchronize ERP
6. Automate reporting
7. Update dashboards
8. Detect incidents

All without manual intervention.


Modern REST architecture

The SWPanel API follows a consistent REST architecture prepared for advanced automation.

This facilitates:

  • Fast integrations
  • Multi-language compatibility
  • Scalability
  • Enterprise automation
  • SaaS integrations
  • DevOps platforms

The structure based on unique identifiers greatly simplifies any technical integration.


Technical resources and documentation

OpenAPI

https://api.swpanel.com/v2026/redoc

Documented endpoint

https://api.swpanel.com/v2026/redoc?l=EN#tag/email/paths/~1v2026~1services~1{id_service}~1mail~1mailbox~1{email}~1/get

Official GitHub

https://github.com/swpanel

SWPanel Changelog

https://swpanel.com/en/changelog

Background

2026 DeepThink Software SLU. All rights reserved. The prices shown on the website do not include any applicable taxes.