Skip to main content

Hostinger Mail API Python SDK

PyPI version

About

This is a Python SDK for the Hostinger API.

Requirements.

Python 3.11+

Installation & Usage

pip install

Setup new virtual environment (optional but recommended):

python3 -m venv venv
source venv/bin/activate

Install the package via pip:

pip install hostinger_mail_api

Then import the package:

import hostinger_mail_api

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import hostinger_mail_api

Getting Started

Please follow the installation procedure and then run the following:

import hostinger_mail_api
from hostinger_mail_api.rest import ApiException
from pprint import pprint


# Configure Bearer authorization: BearerAuth
configuration = hostinger_mail_api.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with hostinger_mail_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = hostinger_mail_api.AccountApi(api_client)

    try:
        # Get the authenticated account
        api_response = api_instance.get_current_account()
        print("The response of AccountApi->get_current_account:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AccountApi->get_current_account: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.mail.hostinger.com

Class Method HTTP request Description
AccountApi get_current_account GET /api/v1/me Get the authenticated account
CalendarEventsApi create_calendar_event POST /api/v1/mailboxes/{mailboxResourceId}/calendars/{calendarUuid}/events Create calendar event
CalendarEventsApi delete_calendar_event DELETE /api/v1/mailboxes/{mailboxResourceId}/calendars/{calendarUuid}/events/{eventUuid} Delete calendar event
CalendarEventsApi get_calendar_event GET /api/v1/mailboxes/{mailboxResourceId}/calendars/{calendarUuid}/events/{eventUuid} Get calendar event
CalendarEventsApi list_calendar_events GET /api/v1/mailboxes/{mailboxResourceId}/calendars/{calendarUuid}/events List calendar events
CalendarEventsApi reply_to_calendar_event POST /api/v1/mailboxes/{mailboxResourceId}/calendars/{calendarUuid}/events/{eventUuid}/reply Reply to calendar event
CalendarEventsApi reschedule_calendar_event PUT /api/v1/mailboxes/{mailboxResourceId}/calendars/{calendarUuid}/events/{eventUuid}/reschedule Reschedule calendar event
CalendarEventsApi update_calendar_event PUT /api/v1/mailboxes/{mailboxResourceId}/calendars/{calendarUuid}/events/{eventUuid} Update calendar event
CalendarsApi create_calendar POST /api/v1/mailboxes/{mailboxResourceId}/calendars Create calendar
CalendarsApi delete_calendar DELETE /api/v1/mailboxes/{mailboxResourceId}/calendars/{calendarUuid} Delete calendar
CalendarsApi get_calendar GET /api/v1/mailboxes/{mailboxResourceId}/calendars/{calendarUuid} Get calendar
CalendarsApi list_calendars GET /api/v1/mailboxes/{mailboxResourceId}/calendars List calendars
CalendarsApi update_calendar PUT /api/v1/mailboxes/{mailboxResourceId}/calendars/{calendarUuid} Update calendar
FeedbackApi submit_feedback POST /api/v1/mailboxes/{mailboxResourceId}/feedback Submit feedback
FoldersApi create_folder POST /api/v1/mailboxes/{mailboxResourceId}/folders Create folder
FoldersApi delete_folder DELETE /api/v1/mailboxes/{mailboxResourceId}/folders/{folder} Delete folder
FoldersApi list_folders GET /api/v1/mailboxes/{mailboxResourceId}/folders List folders
FoldersApi update_folder PUT /api/v1/mailboxes/{mailboxResourceId}/folders/{folder} Update folder
MessagesApi delete_all_messages DELETE /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages Delete all messages
MessagesApi delete_message DELETE /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid} Delete message
MessagesApi delete_messages POST /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/delete Delete messages
MessagesApi get_message GET /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid} Get message
MessagesApi get_message_attachment GET /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/attachments/{attachmentId} Download message attachment
MessagesApi get_message_source GET /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/source Get message source
MessagesApi get_message_text GET /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/text Get message text content
MessagesApi list_messages GET /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages List messages
MessagesApi move_message POST /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/move Move message
MessagesApi move_messages POST /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/move Move messages
MessagesApi patch_message PATCH /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid} Update message flags
MessagesApi search_messages POST /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/search Search messages
MessagesApi update_message_flags POST /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/flags Update flags on multiple messages
QuotaApi get_quota GET /api/v1/mailboxes/{mailboxResourceId}/quota Get mailbox quota
SendApi send_email POST /api/v1/mailboxes/{mailboxResourceId}/send Send email
WebhooksApi create_webhook POST /api/v1/mailboxes/{mailboxResourceId}/webhooks Create webhook
WebhooksApi delete_webhook DELETE /api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook} Delete webhook
WebhooksApi get_webhook GET /api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook} Get webhook
WebhooksApi list_webhooks GET /api/v1/mailboxes/{mailboxResourceId}/webhooks List webhooks
WebhooksApi regenerate_webhook_secret POST /api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook}/regenerate-secret Regenerate webhook secret
WebhooksApi test_webhook POST /api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook}/test Test webhook
WebhooksApi update_webhook PATCH /api/v1/mailboxes/{mailboxResourceId}/webhooks/{webhook} Update webhook

Documentation For Models

Metadata

Release files for hostinger-mail-api 1.19.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hostinger-mail-api 1.19.0
File Size Uploaded Provenance Actions
hostinger_mail_api-1.19.0.tar.gz 78.8 kB With provenance Details for hostinger_mail_api-1.19.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hostinger-mail-api 1.19.0
File Interpreter ABI Platform Actions
hostinger_mail_api-1.19.0-py3-none-any.whl Python 3 none any Details for hostinger_mail_api-1.19.0-py3-none-any.whl

Total release size: 237.9 kB

Release files / hostinger_mail_api-1.19.0.tar.gz

Download URL hostinger_mail_api-1.19.0.tar.gz
Size 78.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8af3c7bb9d207acfdb5a1776bf1d6825d648f7ae451837088a8ecec4d53145b1
BLAKE2b-256 checksum
How to use checksums
6e2dbe85edbdc946080830af3963c8bd4e623b450476c82494bffa5c5e73c180
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / hostinger_mail_api-1.19.0-py3-none-any.whl

Download URL hostinger_mail_api-1.19.0-py3-none-any.whl
Size 159.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05b83bd247533d955e7360e03785d1faf444e7de437a19f0a19fc9da176f88dc
BLAKE2b-256 checksum
How to use checksums
811a537893636412f6e85e817ff04a8ab8606dbff08efcbc9e780a60134ec413
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Security for hostinger-mail-api 1.19.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for hostinger_mail_api-1.19.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.19.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page