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.
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:
id_service)email)Depending on the type of service and configuration, the response may include:
This endpoint is especially useful in integrations related to corporate email automation and centralized email account management.
This endpoint is usually used for:
GET /v2026/services/{id_service}/mail/mailbox/{email}/
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
| Parameter | Type | Description |
|---|---|---|
id_service |
integer/string | Unique service identifier |
email |
string | Email address |
curl --request GET \\\\\\\\\\\\\\\\
--url https://api.swpanel.com/v2026/services/12345/mail/mailbox/[email protected]/ \\\\\\\\\\\\\\\\
--header 'Authorization: Bearer TU_TOKEN'
{
"email": "[email protected]",
"status": "active",
"quota": 2048,
"used": 512,
"imap": true,
"pop3": true,
"smtp": true,
"created_at": "2026-01-10T10:30:00Z"
}
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.
The API allows you to build tools capable of:
This is especially useful in corporate environments with multiple domains and hundreds or thousands of email accounts.
Although email APIs have traditionally been oriented exclusively towards manual administration, SWPanel allows email operations to be integrated into automated pipelines.
For example:
SWPanel maintains an API-first and DevOps-ready orientation in its latest versions:
https://swpanel.com/en/changelog
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.
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)
<?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);
It allows you to build automatic systems capable of:
ERP systems can:
Multi-tenant platforms can automatically synchronize:
Support platforms can:
When information does not change constantly, it is advisable to use cache:
This reduces latency and load on the API.
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 |
Never assume that an email account is operational simply because it exists.
For example:
{
"status": "active"
}
Common recommendations:
The API allows mailbox information to be integrated with:
This makes it easier to create advanced corporate email dashboards.
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.
The SWPanel API follows a consistent REST architecture prepared for advanced automation.
This facilitates:
The structure based on unique identifiers greatly simplifies any technical integration.
https://api.swpanel.com/v2026/redoc
https://api.swpanel.com/v2026/redoc?l=EN#tag/email/paths/~1v2026~1services~1{id_service}~1mail~1mailbox~1{email}~1/get
https://github.com/swpanel
https://swpanel.com/en/changelog