├── setup.py ├── tests ├── __init__.py ├── integration │ └── __init__.py ├── test_helpers.py └── fixtures │ └── cassettes │ ├── invites_get_single.yaml │ ├── tokens_get_not_found.yaml │ ├── identities_get_single.yaml │ ├── inbound_get_not_found.yaml │ ├── messages_get_not_found.yaml │ ├── templates_get_single.yaml │ ├── tokens_builder_get_not_found.yaml │ ├── webhooks_get_not_found.yaml │ ├── domains_get_not_found.yaml │ ├── inbound_builder_get_not_found.yaml │ ├── recipients_get_single.yaml │ ├── messages_builder_get_not_found.yaml │ ├── sms_messages_get_single.yaml │ ├── sms_numbers_get_not_found.yaml │ ├── sms_webhooks_get_not_found.yaml │ ├── webhooks_builder_get_not_found.yaml │ ├── sms_messages_get_not_found.yaml │ ├── activity_get_single_not_found.yaml │ ├── domains_verification_not_found.yaml │ ├── sms_activity_builder_get_not_found.yaml │ ├── sms_activity_get_message_not_found.yaml │ ├── sms_recipients_get_not_found.yaml │ ├── domains_dns_records_not_found.yaml │ ├── email_verification_get_not_found.yaml │ ├── email_verification_get_single.yaml │ ├── sms_recipients_builder_get_not_found.yaml │ ├── smtp_users_get_not_found.yaml │ ├── smtp_users_list_invalid_domain.yaml │ ├── email_verification_verify_list.yaml │ ├── invites_cancel.yaml │ ├── invites_resend.yaml │ ├── smtp_users_builder_get_not_found.yaml │ ├── templates_delete.yaml │ ├── tokens_delete_not_found.yaml │ ├── email_verification_get_results.yaml │ ├── identities_delete_by_id.yaml │ ├── inbound_delete_not_found.yaml │ ├── tokens_builder_delete_not_found.yaml │ ├── webhooks_delete_not_found.yaml │ ├── domains_delete_not_found.yaml │ ├── recipients_delete_success.yaml │ ├── sms_numbers_delete_not_found.yaml │ ├── sms_webhooks_delete_not_found.yaml │ ├── webhooks_builder_delete_not_found.yaml │ ├── sms_numbers_update_pause.yaml │ ├── tokens_update_not_found.yaml │ ├── sms_numbers_update_not_found.yaml │ ├── sms_numbers_update_unpause.yaml │ ├── sms_webhooks_update_disable.yaml │ ├── tokens_builder_update_name_not_found.yaml │ ├── tokens_builder_update_not_found.yaml │ ├── tokens_update_name_not_found.yaml │ ├── identities_update_by_id.yaml │ ├── smtp_users_delete_not_found.yaml │ ├── sms_recipients_update_not_found.yaml │ ├── smtp_users_builder_delete_not_found.yaml │ ├── sms_recipients_builder_update_not_found.yaml │ ├── webhooks_builder_update_not_found.yaml │ ├── webhooks_update_not_found.yaml │ ├── sms_webhooks_update_not_found.yaml │ ├── users_get_single.yaml │ ├── smtp_users_builder_create_invalid_domain.yaml │ ├── smtp_users_create_invalid_domain.yaml │ ├── identities_get_by_email.yaml │ ├── schedules_get_single.yaml │ ├── smtp_users_builder_update_not_found.yaml │ ├── smtp_users_update_not_found.yaml │ ├── users_delete.yaml │ ├── identities_delete_by_email.yaml │ ├── analytics_error_no_events.yaml │ ├── analytics_country_with_tags.yaml │ ├── webhooks_list_invalid_domain.yaml │ ├── domains_verification_status.yaml │ ├── identities_update_by_email.yaml │ ├── sms_webhooks_list_basic.yaml │ ├── analytics_country_basic.yaml │ ├── sms_recipients_builder_list_with_sms_number.yaml │ ├── sms_recipients_list_with_sms_number_filter.yaml │ ├── analytics_reading_env_basic.yaml │ ├── sms_activity_builder_list_with_sms_number.yaml │ ├── sms_activity_list_with_sms_number_filter.yaml │ ├── sms_webhooks_list_with_invalid_sms_number.yaml │ ├── analytics_user_agent_basic.yaml │ ├── schedules_delete.yaml │ ├── analytics_user_agent_with_domain.yaml │ ├── recipients_add_to_blocklist.yaml │ ├── recipients_comprehensive_workflow.yaml │ ├── recipients_add_hard_bounces.yaml │ ├── recipients_add_unsubscribes.yaml │ ├── analytics_reading_env_with_recipients.yaml │ ├── recipients_add_spam_complaints.yaml │ ├── inbound_update_not_found.yaml │ ├── sms_activity_list_basic.yaml │ ├── sms_activity_empty_result.yaml │ ├── sms_recipients_empty_result.yaml │ ├── sms_recipients_list_basic.yaml │ ├── sms_recipients_list_with_pagination.yaml │ ├── sms_activity_builder_list_basic.yaml │ ├── sms_activity_list_with_pagination.yaml │ ├── sms_activity_api_response_structure.yaml │ ├── sms_recipients_api_response_structure.yaml │ ├── sms_recipients_builder_list_basic.yaml │ ├── recipients_delete_from_blocklist.yaml │ ├── sms_recipients_builder_list_with_status.yaml │ ├── email_verification_list_basic.yaml │ ├── sms_recipients_list_with_status_filter.yaml │ ├── templates_list_with_domain_filter.yaml │ ├── recipients_blocklist_basic.yaml │ ├── recipients_unsubscribes_basic.yaml │ ├── sms_activity_list_with_date_range.yaml │ ├── email_send_text_only.yaml │ ├── sms_activity_list_with_status_filter.yaml │ ├── recipients_spam_complaints_basic.yaml │ ├── smtp_users_list_with_limit.yaml │ ├── smtp_users_list_basic.yaml │ ├── email_send_with_base_params.yaml │ ├── smtp_users_empty_result.yaml │ ├── smtp_users_builder_list_basic.yaml │ ├── activity_builder_basic.yaml │ ├── activity_builder_datetime_conversion.yaml │ ├── activity_get_basic.yaml │ ├── activity_get_min_limit.yaml │ ├── smtp_users_api_response_structure.yaml │ ├── activity_get_max_limit.yaml │ ├── activity_get_with_datetime.yaml │ ├── smtp_users_builder_list_with_custom_limit.yaml │ ├── sms_activity_builder_list_with_filters.yaml │ ├── activity_get_single_event.yaml │ ├── activity_get_empty_result.yaml │ ├── email_send_with_tags.yaml │ ├── sms_webhooks_create_invalid_sms_number.yaml │ ├── users_update.yaml │ ├── sms_send_basic.yaml │ ├── sms_webhooks_create_with_all_events.yaml │ ├── activity_builder_with_events.yaml │ ├── identities_create_not_available.yaml │ ├── sms_send_multiple_recipients.yaml │ ├── activity_get_with_events.yaml │ └── email_send_with_headers.yaml ├── .flake8 ├── .github ├── CODEOWNERS ├── workflows │ └── publish.yaml └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── renovate.json ├── MANIFEST.in ├── lefthook.yml ├── mailersend ├── utils │ ├── __init__.py │ └── validators.py ├── constants.py ├── resources │ ├── other.py │ ├── sms_sending.py │ └── __init__.py ├── models │ └── messages.py └── exceptions.py ├── flake.nix ├── .envrc ├── pyproject.toml ├── LICENSE └── .gitignore /setup.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 200 3 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @mailersend/python-skd-maintainers 2 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json" 3 | } -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.rst 2 | include LICENSE 3 | include VERSION 4 | include requirements.txt 5 | include tasks.py -------------------------------------------------------------------------------- /tests/test_helpers.py: -------------------------------------------------------------------------------- 1 | from .conftest import vcr, email_client 2 | 3 | # Export the VCR instance 4 | __all__ = ["vcr", "email_client"] 5 | -------------------------------------------------------------------------------- /lefthook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | remotes: 3 | - git_url: git@github.com:mailerlite/git-hooks.git 4 | ref: main 5 | configs: 6 | - branch-validation-config.yml 7 | 8 | pre-commit: 9 | parallel: true 10 | commands: 11 | black: 12 | glob: "*.py" 13 | run: black . 14 | -------------------------------------------------------------------------------- /mailersend/utils/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Utility functions and helpers for the MailerSend SDK. 3 | """ 4 | 5 | from .files import process_file_attachments 6 | from .validators import validate_email_requirements 7 | 8 | __all__ = [ 9 | "process_file_attachments", 10 | "validate_email_requirements", 11 | ] -------------------------------------------------------------------------------- /.github/workflows/publish.yaml: -------------------------------------------------------------------------------- 1 | name: Publish to PyPI 2 | 3 | on: 4 | push: 5 | tags: 6 | - "v[0-9]+.[0-9]+.[0-9]+*" 7 | 8 | jobs: 9 | build-n-publish: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 13 | 14 | - name: Build and publish to pypi 15 | uses: JRubics/poetry-publish@v2.0 16 | with: 17 | pypi_token: ${{ secrets.PYPI_API_TOKEN }} 18 | -------------------------------------------------------------------------------- /mailersend/constants.py: -------------------------------------------------------------------------------- 1 | import platform 2 | import sys 3 | 4 | # Base API information 5 | API_VERSION = "v1" 6 | DEFAULT_BASE_URL = f"https://api.mailersend.com/{API_VERSION}/" 7 | DEFAULT_TIMEOUT = 30 # seconds 8 | 9 | # Package info for user agent 10 | PACKAGE_NAME = "mailersend-python" 11 | __version__ = "2.0.0" 12 | 13 | USER_AGENT = ( 14 | f"{PACKAGE_NAME}/{__version__} " 15 | f"(Python/{platform.python_version()}; " 16 | f"OS/{platform.system()} {platform.release()}; " 17 | f"Impl/{platform.python_implementation()})" 18 | ) -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Terraform Infrastructure Flake"; 3 | 4 | inputs = { 5 | flake-utils.url = "github:numtide/flake-utils"; 6 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 7 | }; 8 | 9 | outputs = { self, nixpkgs, flake-utils }: 10 | flake-utils.lib.eachDefaultSystem (system: 11 | let 12 | pkgs = import nixpkgs { system = system; config.allowUnfree = true; }; 13 | in 14 | { 15 | devShells.default = pkgs.mkShell { 16 | buildInputs = [ 17 | pkgs.go-task 18 | ]; 19 | 20 | packages = [ pkgs.lefthook pkgs.terraform ]; 21 | }; 22 | }); 23 | } 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.envrc: -------------------------------------------------------------------------------- 1 | layout_poetry() { 2 | PYPROJECT_TOML="${PYPROJECT_TOML:-pyproject.toml}" 3 | if [[ ! -f "$PYPROJECT_TOML" ]]; then 4 | log_status "No pyproject.toml found. Executing \`poetry init\` to create a \`$PYPROJECT_TOML\` first." 5 | poetry init 6 | fi 7 | 8 | VIRTUAL_ENV=$(poetry env info --path 2>/dev/null ; true) 9 | 10 | if [[ -z $VIRTUAL_ENV || ! -d $VIRTUAL_ENV ]]; then 11 | log_status "No virtual environment exists. Executing \`poetry install\` to create one." 12 | poetry install 13 | VIRTUAL_ENV=$(poetry env info --path) 14 | fi 15 | 16 | PATH_add "$VIRTUAL_ENV/bin" 17 | export POETRY_ACTIVE=1 18 | export VIRTUAL_ENV 19 | } 20 | 21 | layout_poetry 22 | 23 | use flake 24 | lefthook install -------------------------------------------------------------------------------- /mailersend/resources/other.py: -------------------------------------------------------------------------------- 1 | """Other endpoints resource""" 2 | 3 | from .base import BaseResource 4 | from ..models.base import APIResponse 5 | 6 | 7 | class Other(BaseResource): 8 | """ 9 | Client for interacting with other MailerSend API endpoints. 10 | 11 | Provides methods for accessing miscellaneous endpoints like API quota. 12 | """ 13 | 14 | def get_quota(self) -> APIResponse: 15 | """ 16 | Get API quota information. 17 | 18 | Returns: 19 | APIResponse with quota information including remaining requests 20 | """ 21 | self.logger.debug("Retrieving API quota information") 22 | 23 | response = self.client.request(method="GET", path="api-quota") 24 | 25 | return self._create_response(response) -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Environment (please complete the following information):** 27 | - OS: [e.g. macOS] 28 | - Python version [e.g. 3.9] 29 | - SDK version [e.g. 1.12] 30 | 31 | **Additional context** 32 | Add any other context about the problem here. 33 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | authors = ["MailerLite "] 3 | description = "The official MailerLite Python SDK" 4 | name = "mailersend" 5 | version = "2.0.0" 6 | 7 | [tool.poetry.dependencies] 8 | python = "^3.9" 9 | requests = "^2.28.1" 10 | pydantic = {extras = ["email"], version = "^2.11.0"} 11 | 12 | [tool.poetry.dev-dependencies] 13 | black = "^25.0.0" 14 | coverage = "^7.0.0" 15 | pytest = "^7.2.0" 16 | pytest-mock = "^3.10.0" 17 | python-dotenv = "^0.21.0" 18 | python-semantic-release = "^7.32.2" 19 | vcrpy = "^7.0.0" 20 | pre-commit = "^2.12.1" 21 | 22 | [build-system] 23 | build-backend = "poetry.core.masonry.api" 24 | requires = ["poetry-core>=1.0.0"] 25 | 26 | [tool.semantic_release] 27 | branch = "main" 28 | build_command = "pip install poetry && poetry build" 29 | upload_to_pypi = false 30 | upload_to_release = true 31 | version_variable = "setup.py:__version__" -------------------------------------------------------------------------------- /mailersend/resources/sms_sending.py: -------------------------------------------------------------------------------- 1 | """SMS Sending resource""" 2 | 3 | from .base import BaseResource 4 | from ..models.sms_sending import SmsSendRequest 5 | from ..models.base import APIResponse 6 | 7 | 8 | class SmsSending(BaseResource): 9 | """ 10 | Client for interacting with the MailerSend SMS Sending API. 11 | """ 12 | 13 | def send(self, request: SmsSendRequest) -> APIResponse: 14 | """ 15 | Send an SMS message. 16 | 17 | Args: 18 | request: SmsSendRequest with SMS details 19 | 20 | Returns: 21 | APIResponse with SMS sending response and metadata 22 | """ 23 | self.logger.debug("Preparing to send SMS message") 24 | 25 | # Convert to JSON payload 26 | payload = request.to_json() 27 | 28 | self.logger.debug("SMS payload: %s", payload) 29 | 30 | response = self.client.request(method="POST", path="sms", body=payload) 31 | 32 | return self._create_response(response) 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 MailerSend 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /mailersend/utils/validators.py: -------------------------------------------------------------------------------- 1 | from ..exceptions import ValidationError 2 | from ..models.email import EmailRequest 3 | 4 | def validate_email_requirements(email: EmailRequest) -> None: 5 | """ 6 | Validate email request based on conditional requirements. 7 | 8 | Args: 9 | email: EmailRequest object to validate 10 | 11 | Raises: 12 | ValidationError: If validation fails 13 | """ 14 | # Template validation 15 | has_template = email.template_id is not None 16 | has_content = email.text is not None or email.html is not None 17 | 18 | # Check if we have content or template 19 | if not has_template and not has_content: 20 | raise ValidationError("Either template_id or text/html content is required") 21 | 22 | # Check subject is provided if no template with default subject 23 | if not email.subject and not has_template: 24 | raise ValidationError("Subject is required when not using a template") 25 | 26 | # Check from email is provided if no template with default sender 27 | if not email.from_email and not has_template: 28 | raise ValidationError("From email is required when not using a template") -------------------------------------------------------------------------------- /tests/fixtures/cassettes/invites_get_single.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/invites/test-invite-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966d3dcd8e9b8e88-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:17:43 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/tokens_get_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/token/test-token-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 9684c1cf1c92076b-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Fri, 01 Aug 2025 10:47:22 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/identities_get_single.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/identities/test-identity-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 9684c6c70b1ce296-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Fri, 01 Aug 2025 10:50:46 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/inbound_get_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/inbound/test-inbound-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966cbd2879dce295-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:49:54 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/messages_get_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/messages/test-message-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966d28159a8adfc0-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:02:53 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/templates_get_single.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/templates/test-template-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966d3581e8d4e294-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:12:03 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/tokens_builder_get_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/token/test-token-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 9684c1d958be8e88-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Fri, 01 Aug 2025 10:47:24 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/webhooks_get_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/webhooks/test-webhook-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966d41ec0cb38e88-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:20:32 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/domains_get_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/domains/non-existent-domain-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966c87d39ef0b01b-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:13:29 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/inbound_builder_get_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/inbound/test-inbound-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966cbd319c948e88-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:49:55 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/recipients_get_single.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/recipients/test-recipient-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966ca5c578ed3267-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:33:56 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/messages_builder_get_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/messages/test-message-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966d281c5e83126d-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:02:54 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_messages_get_single.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-messages/test-sms-message-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966caa47ddaee28f-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:37:00 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_numbers_get_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-numbers/test-sms-number-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966d57cb3beafa43-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:35:27 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_webhooks_get_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-webhooks/test-sms-webhook-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966d689a2a27d814-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:46:56 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/webhooks_builder_get_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/webhooks/test-webhook-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966d41fa8b17e295-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:20:34 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_messages_get_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-messages/non-existent-message-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966caa491ebfa8bc-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:37:01 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/activity_get_single_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/activities/5ee0b166b251345e407c9207 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966d76fc3b3ed814-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:56:45 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/domains_verification_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/domains/non-existent-domain-id/verify 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966c8862e9dcc239-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:13:52 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_activity_builder_get_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-messages/test-sms-message-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966d5e000bddbbed-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:39:42 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_activity_get_message_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-messages/test-sms-message-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966d5df98e27b311-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:39:41 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_recipients_get_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-recipients/test-sms-recipient-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966d528f28afc747-VIE 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:31:53 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/domains_dns_records_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/domains/non-existent-domain-id/dns-records 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966c885c3be6f339-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:13:51 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/email_verification_get_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/email-verification/non-existent-list-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966c95400fade28f-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:22:39 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/email_verification_get_single.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/email-verification/test-verification-list-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966c953eebfde290-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:22:39 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_recipients_builder_get_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-recipients/test-sms-recipient-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966d52981e38870d-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:31:55 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/smtp_users_get_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/domains/65qngkdovk8lwr12/smtp-users/test-smtp-user-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966d2f879f255db9-VIE 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:07:58 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/smtp_users_list_invalid_domain.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/domains/invalid-domain-id/smtp-users?limit=10 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966d2f867de68eb1-VIE 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:07:58 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/email_verification_verify_list.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/email-verification/test-verification-list-id/verify 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966c9540c9d5e295-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:22:39 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/invites_cancel.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '0' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: DELETE 18 | uri: https://api.mailersend.com/v1/invites/test-invite-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d3dcfff125165-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:17:43 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/invites_resend.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '0' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: POST 18 | uri: https://api.mailersend.com/v1/invites/test-invite-id/resend 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d3dced892f339-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:17:43 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/smtp_users_builder_get_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/domains/65qngkdovk8lwr12/smtp-users/test-smtp-user-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966d2f908cd99857-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:08:00 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/templates_delete.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '0' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: DELETE 18 | uri: https://api.mailersend.com/v1/templates/test-template-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d3582eb4b126d-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:12:03 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/tokens_delete_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '0' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: DELETE 18 | uri: https://api.mailersend.com/v1/token/test-token-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 9684c1d3fea65165-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Fri, 01 Aug 2025 10:47:23 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/email_verification_get_results.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/email-verification/test-verification-list-id/results?page=1&limit=10 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966c97f00914babc-VIE 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:24:29 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | status: 42 | code: 404 43 | message: Not Found 44 | version: 1 45 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/identities_delete_by_id.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '0' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: DELETE 18 | uri: https://api.mailersend.com/v1/identities/test-identity-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 9684c6cc0ca3076b-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Fri, 01 Aug 2025 10:50:47 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/inbound_delete_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '0' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: DELETE 18 | uri: https://api.mailersend.com/v1/inbound/test-inbound-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966cbd2c5abf55ad-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 12:49:54 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/tokens_builder_delete_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '0' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: DELETE 18 | uri: https://api.mailersend.com/v1/token/test-token-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 9684c1dd69b70380-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Fri, 01 Aug 2025 10:47:25 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/webhooks_delete_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '0' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: DELETE 18 | uri: https://api.mailersend.com/v1/webhooks/test-webhook-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d41f64f86c687-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:20:33 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/domains_delete_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '0' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: DELETE 18 | uri: https://api.mailersend.com/v1/domains/non-existent-domain-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966c886b6dd0c687-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 12:13:53 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/recipients_delete_success.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '0' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: DELETE 18 | uri: https://api.mailersend.com/v1/recipients/test-recipient-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966ca5c6db5de290-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 12:33:56 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_numbers_delete_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '0' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: DELETE 18 | uri: https://api.mailersend.com/v1/sms-numbers/test-sms-number-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d57cf2e01f339-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:35:28 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_webhooks_delete_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '0' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: DELETE 18 | uri: https://api.mailersend.com/v1/sms-webhooks/test-sms-webhook-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d68a09990e295-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:46:57 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/webhooks_builder_delete_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '0' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: DELETE 18 | uri: https://api.mailersend.com/v1/webhooks/test-webhook-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d41fd1c07f339-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:20:34 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_numbers_update_pause.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"paused": true}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '16' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: PUT 18 | uri: https://api.mailersend.com/v1/sms-numbers/test-sms-number-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d57cd78d78e88-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:35:28 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/tokens_update_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"status": "pause"}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '19' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: PUT 18 | uri: https://api.mailersend.com/v1/token/test-token-id/settings 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 9684c1d1cffde296-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Fri, 01 Aug 2025 10:47:23 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_numbers_update_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"paused": true}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '16' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: PUT 18 | uri: https://api.mailersend.com/v1/sms-numbers/test-sms-number-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d57cbfe4896e0-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:35:28 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_numbers_update_unpause.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"paused": false}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '17' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: PUT 18 | uri: https://api.mailersend.com/v1/sms-numbers/test-sms-number-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d57ce49ace291-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:35:28 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_webhooks_update_disable.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"enabled": false}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '18' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: PUT 18 | uri: https://api.mailersend.com/v1/sms-webhooks/test-sms-webhook-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d689f5b4de291-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:46:57 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/tokens_builder_update_name_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"name": "Updated Name"}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '24' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: PUT 18 | uri: https://api.mailersend.com/v1/token/test-token-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 9684c1dcad4b076b-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Fri, 01 Aug 2025 10:47:25 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/tokens_builder_update_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"status": "pause"}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '19' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: PUT 18 | uri: https://api.mailersend.com/v1/token/test-token-id/settings 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 9684c1dbcfc4c687-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Fri, 01 Aug 2025 10:47:24 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/tokens_update_name_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"name": "Updated Token Name"}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '30' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: PUT 18 | uri: https://api.mailersend.com/v1/token/test-token-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 9684c1d329668e88-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Fri, 01 Aug 2025 10:47:23 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/identities_update_by_id.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"name": "Updated Test Identity"}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '33' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: PUT 18 | uri: https://api.mailersend.com/v1/identities/test-identity-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 9684c6c9b884f969-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Fri, 01 Aug 2025 10:50:46 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/smtp_users_delete_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '0' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: DELETE 18 | uri: https://api.mailersend.com/v1/domains/65qngkdovk8lwr12/smtp-users/test-smtp-user-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d2f8b1806e295-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:07:59 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_recipients_update_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"status": "opt_out"}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '21' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: PUT 18 | uri: https://api.mailersend.com/v1/sms-recipients/test-sms-recipient-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d528ffb32d814-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:31:53 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/smtp_users_builder_delete_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '0' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: DELETE 18 | uri: https://api.mailersend.com/v1/domains/65qngkdovk8lwr12/smtp-users/test-smtp-user-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d2f92e81ac239-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:08:00 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_recipients_builder_update_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"status": "opt_out"}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '21' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: PUT 18 | uri: https://api.mailersend.com/v1/sms-recipients/test-sms-recipient-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d529919e2b01d-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:31:55 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/webhooks_builder_update_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"name": "Updated Name", "enabled": false}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '42' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: PUT 18 | uri: https://api.mailersend.com/v1/webhooks/test-webhook-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d41fc3acf0db0-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:20:34 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/webhooks_update_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"name": "Updated Webhook Name", "enabled": false}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '50' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: PUT 18 | uri: https://api.mailersend.com/v1/webhooks/test-webhook-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d41f52b339857-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:20:33 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_webhooks_update_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"name": "Updated SMS Webhook", "enabled": false}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '49' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: PUT 18 | uri: https://api.mailersend.com/v1/sms-webhooks/test-sms-webhook-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d689e6c28b01b-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:46:57 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/users_get_single.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/users/test-user-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966d3dc78d3e71a6-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:17:42 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 404 47 | message: Not Found 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/smtp_users_builder_create_invalid_domain.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"name": "Test User", "enabled": true}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '38' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: POST 18 | uri: https://api.mailersend.com/v1/domains/invalid-domain-id/smtp-users 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d2f915ae8c239-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:08:00 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/smtp_users_create_invalid_domain.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"name": "Test SMTP User", "enabled": true}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '43' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: POST 18 | uri: https://api.mailersend.com/v1/domains/invalid-domain-id/smtp-users 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d2f88ce72af0a-VIE 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:07:58 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/identities_get_by_email.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/identities/email/test@example.com 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 9684c6c85d461f09-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Fri, 01 Aug 2025 10:50:46 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-08-02T00:00:00Z' 45 | status: 46 | code: 404 47 | message: Not Found 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/schedules_get_single.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/message-schedules/test-message-id 17 | response: 18 | body: 19 | string: "{\n \"message\": \"Resource not found.\"\n}" 20 | headers: 21 | CF-RAY: 22 | - 966d2ecb1c39aeaa-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:07:28 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 404 47 | message: Not Found 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/smtp_users_builder_update_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"name": "Updated User", "enabled": false}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '42' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: PUT 18 | uri: https://api.mailersend.com/v1/domains/65qngkdovk8lwr12/smtp-users/test-smtp-user-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d2f922de60380-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:08:00 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/smtp_users_update_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"name": "Updated SMTP User", "enabled": false}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '47' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: PUT 18 | uri: https://api.mailersend.com/v1/domains/65qngkdovk8lwr12/smtp-users/test-smtp-user-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d2f8a0d08afe9-VIE 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:07:59 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | status: 44 | code: 404 45 | message: Not Found 46 | version: 1 47 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/users_delete.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '0' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: DELETE 18 | uri: https://api.mailersend.com/v1/users/test-user-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 966d3dcb99ade298-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Tue, 29 Jul 2025 14:17:43 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | x-apiquota-remaining: 44 | - '-1' 45 | x-apiquota-reset: 46 | - '2025-07-30T00:00:00Z' 47 | status: 48 | code: 404 49 | message: Not Found 50 | version: 1 51 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/identities_delete_by_email.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '0' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: DELETE 18 | uri: https://api.mailersend.com/v1/identities/email/test@example.com 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 9684c6ccfcd5bbed-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Fri, 01 Aug 2025 10:50:47 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | x-apiquota-remaining: 44 | - '-1' 45 | x-apiquota-reset: 46 | - '2025-08-02T00:00:00Z' 47 | status: 48 | code: 404 49 | message: Not Found 50 | version: 1 51 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/analytics_error_no_events.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/analytics/date?date_from=1746144000&date_to=1748736000&group_by=days 17 | response: 18 | body: 19 | string: '{"message":"The event must be an array.","errors":{"event":["The event 20 | must be an array."]}}' 21 | headers: 22 | CF-RAY: 23 | - 966c83ee79895165-BEG 24 | Cache-Control: 25 | - no-cache, private 26 | Connection: 27 | - keep-alive 28 | Content-Type: 29 | - application/json 30 | Date: 31 | - Tue, 29 Jul 2025 12:10:50 GMT 32 | Server: 33 | - cloudflare 34 | Transfer-Encoding: 35 | - chunked 36 | cf-cache-status: 37 | - DYNAMIC 38 | strict-transport-security: 39 | - max-age=31536000; includeSubDomains 40 | x-apiquota-remaining: 41 | - '-1' 42 | x-apiquota-reset: 43 | - '2025-07-30T00:00:00Z' 44 | status: 45 | code: 422 46 | message: Unprocessable Entity 47 | version: 1 48 | -------------------------------------------------------------------------------- /mailersend/models/messages.py: -------------------------------------------------------------------------------- 1 | """Messages models.""" 2 | 3 | from typing import Optional 4 | from pydantic import field_validator, Field 5 | 6 | from .base import BaseModel 7 | 8 | 9 | class MessagesListQueryParams(BaseModel): 10 | """Model for messages list query parameters with validation.""" 11 | 12 | page: Optional[int] = Field(default=1, ge=1) 13 | limit: Optional[int] = Field(default=25, ge=10, le=100) 14 | 15 | def to_query_params(self) -> dict: 16 | """Convert to query parameters for API request.""" 17 | params = {"page": self.page, "limit": self.limit} 18 | 19 | return {k: v for k, v in params.items() if v is not None} 20 | 21 | 22 | class MessagesListRequest(BaseModel): 23 | """Request model for listing messages.""" 24 | 25 | query_params: MessagesListQueryParams 26 | 27 | def to_query_params(self) -> dict: 28 | """Convert query parameters for API request.""" 29 | return self.query_params.to_query_params() 30 | 31 | 32 | class MessageGetRequest(BaseModel): 33 | """Request model for getting a single message.""" 34 | 35 | message_id: str 36 | 37 | @field_validator("message_id") 38 | @classmethod 39 | def validate_message_id(cls, v): 40 | """Validate message ID is provided and not empty.""" 41 | if not v or not v.strip(): 42 | raise ValueError("Message ID is required") 43 | return v.strip() 44 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/analytics_country_with_tags.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/analytics/country?date_from=1746144000&date_to=1748736000&tags%5B%5D=newsletter 17 | response: 18 | body: 19 | string: '{"data":{"date_from":1746144000,"date_to":1748822399,"stats":[]}}' 20 | headers: 21 | CF-RAY: 22 | - 966c83e5bd2871a6-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:10:48 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/webhooks_list_invalid_domain.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/webhooks?domain_id=invalid-domain-id 17 | response: 18 | body: 19 | string: '{"message":"The domain id field is required. #MS42209","errors":{"domain_id":["The 20 | domain id field is required. #MS42209"]}}' 21 | headers: 22 | CF-RAY: 23 | - 966d4b3e0b65a638-VIE 24 | Cache-Control: 25 | - no-cache, private 26 | Connection: 27 | - keep-alive 28 | Content-Type: 29 | - application/json 30 | Date: 31 | - Tue, 29 Jul 2025 14:26:53 GMT 32 | Server: 33 | - cloudflare 34 | Transfer-Encoding: 35 | - chunked 36 | cf-cache-status: 37 | - DYNAMIC 38 | strict-transport-security: 39 | - max-age=31536000; includeSubDomains 40 | x-apiquota-remaining: 41 | - '-1' 42 | x-apiquota-reset: 43 | - '2025-07-30T00:00:00Z' 44 | status: 45 | code: 422 46 | message: Unprocessable Entity 47 | version: 1 48 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/domains_verification_status.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/domains/65qngkdovk8lwr12/verify 17 | response: 18 | body: 19 | string: '{"message":"The domain is verified.","data":{"dkim":true,"spf":true,"mx":true,"tracking":false,"cname":false,"rp_cname":true}}' 20 | headers: 21 | CF-RAY: 22 | - 966c885d1a2ee291-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:13:52 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/identities_update_by_email.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"name": "Updated Test Identity"}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '33' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: PUT 18 | uri: https://api.mailersend.com/v1/identities/email/test@example.com 19 | response: 20 | body: 21 | string: "{\n \"message\": \"Resource not found.\"\n}" 22 | headers: 23 | CF-RAY: 24 | - 9684c6cb0b621b8b-BEG 25 | Cache-Control: 26 | - no-cache, private 27 | Connection: 28 | - keep-alive 29 | Content-Encoding: 30 | - gzip 31 | Content-Type: 32 | - application/json 33 | Date: 34 | - Fri, 01 Aug 2025 10:50:47 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | x-apiquota-remaining: 44 | - '-1' 45 | x-apiquota-reset: 46 | - '2025-08-02T00:00:00Z' 47 | status: 48 | code: 404 49 | message: Not Found 50 | version: 1 51 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_webhooks_list_basic.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-webhooks?sms_number_id=test-sms-number-id 17 | response: 18 | body: 19 | string: '{"message":"The sms number id field is required. #MS42209","errors":{"sms_number_id":["The 20 | sms number id field is required. #MS42209"]}}' 21 | headers: 22 | CF-RAY: 23 | - 966d65a14e711b8b-BEG 24 | Cache-Control: 25 | - no-cache, private 26 | Connection: 27 | - keep-alive 28 | Content-Type: 29 | - application/json 30 | Date: 31 | - Tue, 29 Jul 2025 14:44:54 GMT 32 | Server: 33 | - cloudflare 34 | Transfer-Encoding: 35 | - chunked 36 | cf-cache-status: 37 | - DYNAMIC 38 | strict-transport-security: 39 | - max-age=31536000; includeSubDomains 40 | x-apiquota-remaining: 41 | - '-1' 42 | x-apiquota-reset: 43 | - '2025-07-30T00:00:00Z' 44 | status: 45 | code: 422 46 | message: Unprocessable Entity 47 | version: 1 48 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/analytics_country_basic.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/analytics/country?date_from=1746144000&date_to=1748736000 17 | response: 18 | body: 19 | string: '{"data":{"date_from":1746144000,"date_to":1748822399,"stats":[{"name":"RS","count":1},{"name":"US","count":1}]}}' 20 | headers: 21 | CF-RAY: 22 | - 966c83e4bade870d-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:10:48 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_recipients_builder_list_with_sms_number.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-recipients?sms_number_id=test-sms-number-id&limit=10 17 | response: 18 | body: 19 | string: '{"message":"The selected sms number id is invalid.","errors":{"sms_number_id":["The 20 | selected sms number id is invalid."]}}' 21 | headers: 22 | CF-RAY: 23 | - 966d54ecac96b018-BEG 24 | Cache-Control: 25 | - no-cache, private 26 | Connection: 27 | - keep-alive 28 | Content-Type: 29 | - application/json 30 | Date: 31 | - Tue, 29 Jul 2025 14:33:30 GMT 32 | Server: 33 | - cloudflare 34 | Transfer-Encoding: 35 | - chunked 36 | cf-cache-status: 37 | - DYNAMIC 38 | strict-transport-security: 39 | - max-age=31536000; includeSubDomains 40 | x-apiquota-remaining: 41 | - '-1' 42 | x-apiquota-reset: 43 | - '2025-07-30T00:00:00Z' 44 | status: 45 | code: 422 46 | message: Unprocessable Entity 47 | version: 1 48 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_recipients_list_with_sms_number_filter.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-recipients?sms_number_id=test-sms-number-id&limit=10 17 | response: 18 | body: 19 | string: '{"message":"The selected sms number id is invalid.","errors":{"sms_number_id":["The 20 | selected sms number id is invalid."]}}' 21 | headers: 22 | CF-RAY: 23 | - 966d54eb3a0a8e88-BEG 24 | Cache-Control: 25 | - no-cache, private 26 | Connection: 27 | - keep-alive 28 | Content-Type: 29 | - application/json 30 | Date: 31 | - Tue, 29 Jul 2025 14:33:30 GMT 32 | Server: 33 | - cloudflare 34 | Transfer-Encoding: 35 | - chunked 36 | cf-cache-status: 37 | - DYNAMIC 38 | strict-transport-security: 39 | - max-age=31536000; includeSubDomains 40 | x-apiquota-remaining: 41 | - '-1' 42 | x-apiquota-reset: 43 | - '2025-07-30T00:00:00Z' 44 | status: 45 | code: 422 46 | message: Unprocessable Entity 47 | version: 1 48 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/analytics_reading_env_basic.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/analytics/ua-type?date_from=1746144000&date_to=1748736000 17 | response: 18 | body: 19 | string: '{"data":{"date_from":1746144000,"date_to":1748822399,"stats":[{"name":"desktop","count":1},{"name":"webmail","count":1}]}}' 20 | headers: 21 | CF-RAY: 22 | - 966c83e9f8dedfc0-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:10:49 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_activity_builder_list_with_sms_number.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-activity?sms_number_id=test-sms-number-id&page=1&limit=10 17 | response: 18 | body: 19 | string: '{"message":"The selected sms number id is invalid.","errors":{"sms_number_id":["The 20 | selected sms number id is invalid."]}}' 21 | headers: 22 | CF-RAY: 23 | - 966d5dff2a3f55ad-BEG 24 | Cache-Control: 25 | - no-cache, private 26 | Connection: 27 | - keep-alive 28 | Content-Type: 29 | - application/json 30 | Date: 31 | - Tue, 29 Jul 2025 14:39:42 GMT 32 | Server: 33 | - cloudflare 34 | Transfer-Encoding: 35 | - chunked 36 | cf-cache-status: 37 | - DYNAMIC 38 | strict-transport-security: 39 | - max-age=31536000; includeSubDomains 40 | x-apiquota-remaining: 41 | - '-1' 42 | x-apiquota-reset: 43 | - '2025-07-30T00:00:00Z' 44 | status: 45 | code: 422 46 | message: Unprocessable Entity 47 | version: 1 48 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_activity_list_with_sms_number_filter.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-activity?sms_number_id=test-sms-number-id&page=1&limit=10 17 | response: 18 | body: 19 | string: '{"message":"The selected sms number id is invalid.","errors":{"sms_number_id":["The 20 | selected sms number id is invalid."]}}' 21 | headers: 22 | CF-RAY: 23 | - 966d5df59edee295-BEG 24 | Cache-Control: 25 | - no-cache, private 26 | Connection: 27 | - keep-alive 28 | Content-Type: 29 | - application/json 30 | Date: 31 | - Tue, 29 Jul 2025 14:39:40 GMT 32 | Server: 33 | - cloudflare 34 | Transfer-Encoding: 35 | - chunked 36 | cf-cache-status: 37 | - DYNAMIC 38 | strict-transport-security: 39 | - max-age=31536000; includeSubDomains 40 | x-apiquota-remaining: 41 | - '-1' 42 | x-apiquota-reset: 43 | - '2025-07-30T00:00:00Z' 44 | status: 45 | code: 422 46 | message: Unprocessable Entity 47 | version: 1 48 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_webhooks_list_with_invalid_sms_number.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-webhooks?sms_number_id=invalid-sms-number-id 17 | response: 18 | body: 19 | string: '{"message":"The sms number id field is required. #MS42209","errors":{"sms_number_id":["The 20 | sms number id field is required. #MS42209"]}}' 21 | headers: 22 | CF-RAY: 23 | - 966d6898da8a076b-BEG 24 | Cache-Control: 25 | - no-cache, private 26 | Connection: 27 | - keep-alive 28 | Content-Type: 29 | - application/json 30 | Date: 31 | - Tue, 29 Jul 2025 14:46:56 GMT 32 | Server: 33 | - cloudflare 34 | Transfer-Encoding: 35 | - chunked 36 | cf-cache-status: 37 | - DYNAMIC 38 | strict-transport-security: 39 | - max-age=31536000; includeSubDomains 40 | x-apiquota-remaining: 41 | - '-1' 42 | x-apiquota-reset: 43 | - '2025-07-30T00:00:00Z' 44 | status: 45 | code: 422 46 | message: Unprocessable Entity 47 | version: 1 48 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/analytics_user_agent_basic.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/analytics/ua-name?date_from=1746144000&date_to=1748736000 17 | response: 18 | body: 19 | string: '{"data":{"date_from":1746144000,"date_to":1748822399,"stats":[{"name":"UNK","count":1},{"name":"Microsoft 20 | Edge","count":1}]}}' 21 | headers: 22 | CF-RAY: 23 | - 966c83e77d87e290-BEG 24 | Cache-Control: 25 | - no-cache, private 26 | Connection: 27 | - keep-alive 28 | Content-Encoding: 29 | - gzip 30 | Content-Type: 31 | - application/json 32 | Date: 33 | - Tue, 29 Jul 2025 12:10:49 GMT 34 | Server: 35 | - cloudflare 36 | Transfer-Encoding: 37 | - chunked 38 | cf-cache-status: 39 | - DYNAMIC 40 | strict-transport-security: 41 | - max-age=31536000; includeSubDomains 42 | x-apiquota-remaining: 43 | - '-1' 44 | x-apiquota-reset: 45 | - '2025-07-30T00:00:00Z' 46 | status: 47 | code: 200 48 | message: OK 49 | version: 1 50 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/schedules_delete.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '0' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: DELETE 18 | uri: https://api.mailersend.com/v1/message-schedules/test-message-id 19 | response: 20 | body: 21 | string: "{\n \"message\": \"This message is scheduled to be sent shortly 22 | or has already been sent, it's not possible to delete it.\"\n}" 23 | headers: 24 | CF-RAY: 25 | - 966d2ecbffe3e296-BEG 26 | Cache-Control: 27 | - no-cache, private 28 | Connection: 29 | - keep-alive 30 | Content-Encoding: 31 | - gzip 32 | Content-Type: 33 | - application/json 34 | Date: 35 | - Tue, 29 Jul 2025 14:07:28 GMT 36 | Server: 37 | - cloudflare 38 | Transfer-Encoding: 39 | - chunked 40 | cf-cache-status: 41 | - DYNAMIC 42 | strict-transport-security: 43 | - max-age=31536000; includeSubDomains 44 | x-apiquota-remaining: 45 | - '-1' 46 | x-apiquota-reset: 47 | - '2025-07-30T00:00:00Z' 48 | status: 49 | code: 404 50 | message: Not Found 51 | version: 1 52 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/analytics_user_agent_with_domain.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/analytics/ua-name?domain_id=your-domain-id&date_from=1746144000&date_to=1748736000 17 | response: 18 | body: 19 | string: '{"data":{"date_from":1746144000,"date_to":1748822399,"stats":[{"name":"UNK","count":1},{"name":"Microsoft 20 | Edge","count":1}]}}' 21 | headers: 22 | CF-RAY: 23 | - 966c83e88fd0c687-BEG 24 | Cache-Control: 25 | - no-cache, private 26 | Connection: 27 | - keep-alive 28 | Content-Encoding: 29 | - gzip 30 | Content-Type: 31 | - application/json 32 | Date: 33 | - Tue, 29 Jul 2025 12:10:49 GMT 34 | Server: 35 | - cloudflare 36 | Transfer-Encoding: 37 | - chunked 38 | cf-cache-status: 39 | - DYNAMIC 40 | strict-transport-security: 41 | - max-age=31536000; includeSubDomains 42 | x-apiquota-remaining: 43 | - '-1' 44 | x-apiquota-reset: 45 | - '2025-07-30T00:00:00Z' 46 | status: 47 | code: 200 48 | message: OK 49 | version: 1 50 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/recipients_add_to_blocklist.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"domain_id": "test-domain-id", "recipients": ["test@example.com"]}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '67' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: POST 18 | uri: https://api.mailersend.com/v1/suppressions/blocklist 19 | response: 20 | body: 21 | string: '{"message":"The selected domain id is invalid.","errors":{"domain_id":["The 22 | selected domain id is invalid."]}}' 23 | headers: 24 | CF-RAY: 25 | - 966ca7eedfdc23b5-VIE 26 | Cache-Control: 27 | - no-cache, private 28 | Connection: 29 | - keep-alive 30 | Content-Type: 31 | - application/json 32 | Date: 33 | - Tue, 29 Jul 2025 12:35:24 GMT 34 | Server: 35 | - cloudflare 36 | Transfer-Encoding: 37 | - chunked 38 | cf-cache-status: 39 | - DYNAMIC 40 | strict-transport-security: 41 | - max-age=31536000; includeSubDomains 42 | x-apiquota-remaining: 43 | - '-1' 44 | x-apiquota-reset: 45 | - '2025-07-30T00:00:00Z' 46 | status: 47 | code: 422 48 | message: Unprocessable Entity 49 | version: 1 50 | -------------------------------------------------------------------------------- /mailersend/exceptions.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | import requests 3 | 4 | 5 | class MailerSendError(Exception): 6 | """Base exception for all MailerSend API errors.""" 7 | 8 | def __init__(self, message: str, response: Optional[requests.Response] = None): 9 | self.message = message 10 | self.response = response 11 | super().__init__(self.message) 12 | 13 | 14 | class AuthenticationError(MailerSendError): 15 | """Raised when authentication fails.""" 16 | pass 17 | 18 | 19 | class ResourceNotFoundError(MailerSendError): 20 | """Raised when a requested resource is not found.""" 21 | pass 22 | 23 | 24 | class RateLimitExceeded(MailerSendError): 25 | """Raised when API rate limits are exceeded.""" 26 | 27 | @property 28 | def retry_after(self) -> Optional[int]: 29 | """Get the recommended retry time in seconds.""" 30 | if self.response and "Retry-After" in self.response.headers: 31 | try: 32 | return int(self.response.headers["Retry-After"]) 33 | except (ValueError, TypeError): 34 | pass 35 | return None 36 | 37 | 38 | class BadRequestError(MailerSendError): 39 | """Raised when the request was malformed.""" 40 | pass 41 | 42 | 43 | class ServerError(MailerSendError): 44 | """Raised when a server-side error occurs.""" 45 | pass 46 | 47 | 48 | class ValidationError(MailerSendError): 49 | """Raised when request validation fails.""" 50 | pass -------------------------------------------------------------------------------- /tests/fixtures/cassettes/recipients_comprehensive_workflow.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"domain_id": "test-domain-id", "recipients": ["workflow-test@example.com"]}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '76' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: POST 18 | uri: https://api.mailersend.com/v1/suppressions/blocklist 19 | response: 20 | body: 21 | string: '{"message":"The selected domain id is invalid.","errors":{"domain_id":["The 22 | selected domain id is invalid."]}}' 23 | headers: 24 | CF-RAY: 25 | - 966ca7f5db07562e-BEG 26 | Cache-Control: 27 | - no-cache, private 28 | Connection: 29 | - keep-alive 30 | Content-Type: 31 | - application/json 32 | Date: 33 | - Tue, 29 Jul 2025 12:35:25 GMT 34 | Server: 35 | - cloudflare 36 | Transfer-Encoding: 37 | - chunked 38 | cf-cache-status: 39 | - DYNAMIC 40 | strict-transport-security: 41 | - max-age=31536000; includeSubDomains 42 | x-apiquota-remaining: 43 | - '-1' 44 | x-apiquota-reset: 45 | - '2025-07-30T00:00:00Z' 46 | status: 47 | code: 422 48 | message: Unprocessable Entity 49 | version: 1 50 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/recipients_add_hard_bounces.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"domain_id": "test-domain-id", "recipients": ["test@example.com"]}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '67' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: POST 18 | uri: https://api.mailersend.com/v1/suppressions/hard-bounces 19 | response: 20 | body: 21 | string: '{"message":"The domain id field is required. #MS42209","errors":{"domain_id":["The 22 | domain id field is required. #MS42209"]}}' 23 | headers: 24 | CF-RAY: 25 | - 966ca7f02ace4341-VIE 26 | Cache-Control: 27 | - no-cache, private 28 | Connection: 29 | - keep-alive 30 | Content-Type: 31 | - application/json 32 | Date: 33 | - Tue, 29 Jul 2025 12:35:24 GMT 34 | Server: 35 | - cloudflare 36 | Transfer-Encoding: 37 | - chunked 38 | cf-cache-status: 39 | - DYNAMIC 40 | strict-transport-security: 41 | - max-age=31536000; includeSubDomains 42 | x-apiquota-remaining: 43 | - '-1' 44 | x-apiquota-reset: 45 | - '2025-07-30T00:00:00Z' 46 | status: 47 | code: 422 48 | message: Unprocessable Entity 49 | version: 1 50 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/recipients_add_unsubscribes.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"domain_id": "test-domain-id", "recipients": ["test@example.com"]}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '67' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: POST 18 | uri: https://api.mailersend.com/v1/suppressions/unsubscribes 19 | response: 20 | body: 21 | string: '{"message":"The domain id field is required. #MS42209","errors":{"domain_id":["The 22 | domain id field is required. #MS42209"]}}' 23 | headers: 24 | CF-RAY: 25 | - 966ca7f2fd05cb7b-VIE 26 | Cache-Control: 27 | - no-cache, private 28 | Connection: 29 | - keep-alive 30 | Content-Type: 31 | - application/json 32 | Date: 33 | - Tue, 29 Jul 2025 12:35:25 GMT 34 | Server: 35 | - cloudflare 36 | Transfer-Encoding: 37 | - chunked 38 | cf-cache-status: 39 | - DYNAMIC 40 | strict-transport-security: 41 | - max-age=31536000; includeSubDomains 42 | x-apiquota-remaining: 43 | - '-1' 44 | x-apiquota-reset: 45 | - '2025-07-30T00:00:00Z' 46 | status: 47 | code: 422 48 | message: Unprocessable Entity 49 | version: 1 50 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/analytics_reading_env_with_recipients.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/analytics/ua-type?recipient_id%5B%5D=recipient-1&recipient_id%5B%5D=recipient-2&date_from=1746144000&date_to=1748736000 17 | response: 18 | body: 19 | string: '{"data":{"date_from":1746144000,"date_to":1748822399,"stats":[{"name":"desktop","count":1},{"name":"webmail","count":1}]}}' 20 | headers: 21 | CF-RAY: 22 | - 966c83eb293ee296-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:10:49 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/recipients_add_spam_complaints.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"domain_id": "test-domain-id", "recipients": ["test@example.com"]}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '67' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: POST 18 | uri: https://api.mailersend.com/v1/suppressions/spam-complaints 19 | response: 20 | body: 21 | string: '{"message":"The domain id field is required. #MS42209","errors":{"domain_id":["The 22 | domain id field is required. #MS42209"]}}' 23 | headers: 24 | CF-RAY: 25 | - 966ca7f1986b1ef8-VIE 26 | Cache-Control: 27 | - no-cache, private 28 | Connection: 29 | - keep-alive 30 | Content-Type: 31 | - application/json 32 | Date: 33 | - Tue, 29 Jul 2025 12:35:25 GMT 34 | Server: 35 | - cloudflare 36 | Transfer-Encoding: 37 | - chunked 38 | cf-cache-status: 39 | - DYNAMIC 40 | strict-transport-security: 41 | - max-age=31536000; includeSubDomains 42 | x-apiquota-remaining: 43 | - '-1' 44 | x-apiquota-reset: 45 | - '2025-07-30T00:00:00Z' 46 | status: 47 | code: 422 48 | message: Unprocessable Entity 49 | version: 1 50 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/inbound_update_not_found.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"name": "Test Inbound Route", "domain_enabled": false, "catch_filter": 4 | {"type": "catch_all"}, "catch_type": "all", "match_filter": {"type": "match_all"}, 5 | "match_type": "all", "forwards": [{"type": "email", "value": "ms-sdk@igor.fail"}]}' 6 | headers: 7 | Accept: 8 | - application/json 9 | Accept-Encoding: 10 | - gzip, deflate 11 | Connection: 12 | - keep-alive 13 | Content-Length: 14 | - '237' 15 | Content-Type: 16 | - application/json 17 | User-Agent: 18 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 19 | method: PUT 20 | uri: https://api.mailersend.com/v1/inbound/test-inbound-id 21 | response: 22 | body: 23 | string: "{\n \"message\": \"Resource not found.\"\n}" 24 | headers: 25 | CF-RAY: 26 | - 9684ca4eea11f969-BEG 27 | Cache-Control: 28 | - no-cache, private 29 | Connection: 30 | - keep-alive 31 | Content-Encoding: 32 | - gzip 33 | Content-Type: 34 | - application/json 35 | Date: 36 | - Fri, 01 Aug 2025 10:53:11 GMT 37 | Server: 38 | - cloudflare 39 | Transfer-Encoding: 40 | - chunked 41 | cf-cache-status: 42 | - DYNAMIC 43 | strict-transport-security: 44 | - max-age=31536000; includeSubDomains 45 | status: 46 | code: 404 47 | message: Not Found 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_activity_list_basic.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-activity?page=1&limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/sms-activity?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/sms-activity","per_page":10,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d5df24b8faeaa-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:39:40 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_activity_empty_result.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-activity?page=1&limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/sms-activity?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/sms-activity","per_page":10,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d5dfb8912b30c-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:39:41 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_recipients_empty_result.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-recipients?limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/sms-recipients?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/sms-recipients","per_page":"10","to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d5292ea9be297-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:31:54 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_recipients_list_basic.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-recipients?limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/sms-recipients?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/sms-recipients","per_page":"10","to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d52896efd8eb1-VIE 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:31:52 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_recipients_list_with_pagination.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-recipients 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/sms-recipients?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/sms-recipients","per_page":25,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d528ac84011d5-VIE 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:31:52 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /mailersend/resources/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | API resource classes for interacting with specific MailerSend API endpoints. 3 | """ 4 | 5 | from .base import BaseResource 6 | from .email import Email 7 | from .activity import Activity 8 | from .analytics import Analytics 9 | from .domains import Domains 10 | from .identities import IdentitiesResource 11 | from .inbound import InboundResource 12 | from .messages import Messages 13 | from .schedules import Schedules 14 | from .recipients import Recipients 15 | from .templates import Templates 16 | from .tokens import Tokens 17 | from .webhooks import Webhooks 18 | from .email_verification import EmailVerification 19 | from .users import Users 20 | from .sms_messages import SmsMessages 21 | from .sms_numbers import SmsNumbers 22 | from .sms_activity import SmsActivity 23 | from .sms_sending import SmsSending 24 | from .sms_recipients import SmsRecipients 25 | from .sms_webhooks import SmsWebhooks 26 | from .sms_inbounds import SmsInbounds 27 | from .other import Other 28 | 29 | __all__ = [ 30 | "BaseResource", 31 | "Email", 32 | "Activity", 33 | "Analytics", 34 | "Domains", 35 | "IdentitiesResource", 36 | "InboundResource", 37 | "Messages", 38 | "Schedules", 39 | "Recipients", 40 | "Templates", 41 | "Tokens", 42 | "Webhooks", 43 | "EmailVerification", 44 | "Users", 45 | "SmsMessages", 46 | "SmsNumbers", 47 | "SmsActivity", 48 | "SmsSending", 49 | "SmsRecipients", 50 | "SmsWebhooks", 51 | "SmsInbounds", 52 | "Other", 53 | ] 54 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_activity_builder_list_basic.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-activity?page=1&limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/sms-activity?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/sms-activity","per_page":10,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d5dfcac06c687-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:39:41 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_activity_list_with_pagination.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-activity?page=1&limit=25 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/sms-activity?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/sms-activity","per_page":25,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d5df42e5f1f09-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:39:40 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_activity_api_response_structure.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-activity?page=1&limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/sms-activity?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/sms-activity","per_page":10,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d5dfa9bf3e296-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:39:41 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_recipients_api_response_structure.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-recipients?limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/sms-recipients?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/sms-recipients","per_page":"10","to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d52917c9c076b-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:31:54 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_recipients_builder_list_basic.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-recipients?limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/sms-recipients?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/sms-recipients","per_page":"10","to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d52940e9fbbed-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:31:54 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/recipients_delete_from_blocklist.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"domain_id": "test-domain-id", "ids": ["test-id"]}' 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Length: 12 | - '51' 13 | Content-Type: 14 | - application/json 15 | User-Agent: 16 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 17 | method: DELETE 18 | uri: https://api.mailersend.com/v1/suppressions/blocklist 19 | response: 20 | body: 21 | string: '{"message":"The selected domain id is invalid. (and 1 more error)","errors":{"domain_id":["The 22 | selected domain id is invalid."],"ids.0":["The selected ids.0 is invalid."]}}' 23 | headers: 24 | CF-RAY: 25 | - 966ca7f45aeac0d0-VIE 26 | Cache-Control: 27 | - no-cache, private 28 | Connection: 29 | - keep-alive 30 | Content-Type: 31 | - application/json 32 | Date: 33 | - Tue, 29 Jul 2025 12:35:25 GMT 34 | Server: 35 | - cloudflare 36 | Transfer-Encoding: 37 | - chunked 38 | cf-cache-status: 39 | - DYNAMIC 40 | strict-transport-security: 41 | - max-age=31536000; includeSubDomains 42 | x-apiquota-remaining: 43 | - '-1' 44 | x-apiquota-reset: 45 | - '2025-07-30T00:00:00Z' 46 | status: 47 | code: 422 48 | message: Unprocessable Entity 49 | version: 1 50 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_recipients_builder_list_with_status.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-recipients?status=active 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/sms-recipients?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/sms-recipients","per_page":25,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d52950c425165-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:31:54 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/email_verification_list_basic.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/email-verification?page=1&limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/email-verification?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/email-verification","per_page":"10","to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966c94ec299fc1f9-VIE 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:22:26 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_recipients_list_with_status_filter.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-recipients?status=active&limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/sms-recipients?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/sms-recipients","per_page":"10","to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d528c7ec30b0f-VIE 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:31:53 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/templates_list_with_domain_filter.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/templates?domain_id=65qngkdovk8lwr12&page=1&limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/templates?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/templates","per_page":10,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d35810b7396e0-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:12:03 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/recipients_blocklist_basic.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/suppressions/blocklist?page=1&limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/suppressions\/blocklist?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/suppressions\/blocklist","per_page":10,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966ca5c7bc02126d-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:33:56 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/recipients_unsubscribes_basic.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/suppressions/unsubscribes?page=1&limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/suppressions\/unsubscribes?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/suppressions\/unsubscribes","per_page":10,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966ca5cbae405165-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:33:57 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_activity_list_with_date_range.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-activity?date_from=1753195200&date_to=1753800000&page=1&limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/sms-activity?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/sms-activity","per_page":10,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d608eb816c239-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:41:27 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/email_send_text_only.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"from": {"email": "ms-sdk@igor.fail", "name": "Sender"}, "to": [{"email": 4 | "igor@mailerlite.com", "name": "Recipient"}], "subject": "Test Email", "text": 5 | "This is a test email"}' 6 | headers: 7 | Accept: 8 | - application/json 9 | Accept-Encoding: 10 | - gzip, deflate 11 | Connection: 12 | - keep-alive 13 | Content-Length: 14 | - '177' 15 | Content-Type: 16 | - application/json 17 | User-Agent: 18 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 19 | method: POST 20 | uri: https://api.mailersend.com/v1/email 21 | response: 22 | body: 23 | string: '' 24 | headers: 25 | CF-RAY: 26 | - 966d6deabfd9dcf8-VIE 27 | Cache-Control: 28 | - no-cache, private 29 | Connection: 30 | - keep-alive 31 | Content-Type: 32 | - text/html; charset=UTF-8 33 | Date: 34 | - Tue, 29 Jul 2025 14:50:34 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | x-apiquota-remaining: 44 | - '-1' 45 | x-apiquota-reset: 46 | - '2025-07-30T00:00:00Z' 47 | x-message-id: 48 | - 6888dfbaf3cba3da787e6017 49 | x-send-paused: 50 | - 'true' 51 | status: 52 | code: 202 53 | message: Accepted 54 | version: 1 55 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_activity_list_with_status_filter.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-activity?status%5B%5D=queued&status%5B%5D=sent&page=1&limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/sms-activity?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/sms-activity","per_page":10,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d5df808defa43-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:39:41 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/recipients_spam_complaints_basic.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/suppressions/spam-complaints?page=1&limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/suppressions\/spam-complaints?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/suppressions\/spam-complaints","per_page":10,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966ca5ca3c6ae295-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 12:33:57 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/smtp_users_list_with_limit.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/domains/65qngkdovk8lwr12/smtp-users 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/domains\/65qngkdovk8lwr12\/smtp-users?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/domains\/65qngkdovk8lwr12\/smtp-users","per_page":25,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d2f850e51b654-VIE 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:07:58 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/smtp_users_list_basic.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/domains/65qngkdovk8lwr12/smtp-users?limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/domains\/65qngkdovk8lwr12\/smtp-users?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/domains\/65qngkdovk8lwr12\/smtp-users","per_page":10,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d2f83cf2e3ec1-VIE 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:07:58 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/email_send_with_base_params.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"from": {"email": "ms-sdk@igor.fail", "name": "Sender"}, "to": [{"email": 4 | "igor@mailerlite.com", "name": "Recipient"}], "subject": "Test Email", "html": 5 | "

This is a test email

"}' 6 | headers: 7 | Accept: 8 | - application/json 9 | Accept-Encoding: 10 | - gzip, deflate 11 | Connection: 12 | - keep-alive 13 | Content-Length: 14 | - '184' 15 | Content-Type: 16 | - application/json 17 | User-Agent: 18 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 19 | method: POST 20 | uri: https://api.mailersend.com/v1/email 21 | response: 22 | body: 23 | string: '' 24 | headers: 25 | CF-RAY: 26 | - 966d6de8cca4b654-VIE 27 | Cache-Control: 28 | - no-cache, private 29 | Connection: 30 | - keep-alive 31 | Content-Type: 32 | - text/html; charset=UTF-8 33 | Date: 34 | - Tue, 29 Jul 2025 14:50:33 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | x-apiquota-remaining: 44 | - '-1' 45 | x-apiquota-reset: 46 | - '2025-07-30T00:00:00Z' 47 | x-message-id: 48 | - 6888dfb97e2b7a6ce588f6de 49 | x-send-paused: 50 | - 'true' 51 | status: 52 | code: 202 53 | message: Accepted 54 | version: 1 55 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/smtp_users_empty_result.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/domains/65qngkdovk8lwr12/smtp-users?limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/domains\/65qngkdovk8lwr12\/smtp-users?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/domains\/65qngkdovk8lwr12\/smtp-users","per_page":10,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d2f8cba1d8e88-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:07:59 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/smtp_users_builder_list_basic.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/domains/65qngkdovk8lwr12/smtp-users?limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/domains\/65qngkdovk8lwr12\/smtp-users?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/domains\/65qngkdovk8lwr12\/smtp-users","per_page":10,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d2f8e382d076b-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:07:59 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/python 2 | 3 | ### Python ### 4 | # Byte-compiled / optimized / DLL files 5 | __pycache__/ 6 | *.py[cod] 7 | *$py.class 8 | 9 | # C extensions 10 | *.so 11 | 12 | # Distribution / packaging 13 | .Python 14 | env/ 15 | build/ 16 | develop-eggs/ 17 | dist/ 18 | downloads/ 19 | eggs/ 20 | .eggs/ 21 | lib/ 22 | lib64/ 23 | parts/ 24 | sdist/ 25 | var/ 26 | *.egg-info/ 27 | .installed.cfg 28 | *.egg 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *,cover 49 | .hypothesis/ 50 | 51 | # Translations 52 | *.mo 53 | *.pot 54 | 55 | # Django stuff: 56 | *.log 57 | local_settings.py 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # IPython Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # dotenv 82 | .env 83 | 84 | # virtualenv 85 | .venv/ 86 | venv/ 87 | ENV/ 88 | 89 | # Spyder project settings 90 | .spyderproject 91 | .cursorrules 92 | 93 | # Rope project settings 94 | .ropeproject 95 | .vscode 96 | toolset.py 97 | doctester.py 98 | .direnv/ -------------------------------------------------------------------------------- /tests/fixtures/cassettes/activity_builder_basic.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/activity/65qngkdovk8lwr12?page=1&limit=25&date_from=1750945671&date_to=1750949271 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12","per_page":25,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d76f8df02562e-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:56:45 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/activity_builder_datetime_conversion.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/activity/65qngkdovk8lwr12?date_from=1750938493&date_to=1750949293 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12","per_page":25,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d76fb2ef696e0-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:56:45 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/activity_get_basic.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/activity/65qngkdovk8lwr12?page=1&limit=25&date_from=1754040747&date_to=1754044347 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12","per_page":25,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 9684abf1ba41076b-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Fri, 01 Aug 2025 10:32:27 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-08-02T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/activity_get_min_limit.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/activity/65qngkdovk8lwr12?page=1&limit=10&date_from=1750862892&date_to=1750949292 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12","per_page":10,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d76f6baa70a8e-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:56:44 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/smtp_users_api_response_structure.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/domains/65qngkdovk8lwr12/smtp-users?limit=10 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/domains\/65qngkdovk8lwr12\/smtp-users?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/domains\/65qngkdovk8lwr12\/smtp-users","per_page":10,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d2f8bee235165-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:07:59 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/activity_get_max_limit.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/activity/65qngkdovk8lwr12?page=1&limit=100&date_from=1750862870&date_to=1750949270 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12","per_page":100,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d76f538b13267-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:56:44 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/activity_get_with_datetime.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/activity/65qngkdovk8lwr12?page=1&limit=25&date_from=1750927692&date_to=1750949292 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12","per_page":25,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d76f39c8dcf86-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:56:44 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/smtp_users_builder_list_with_custom_limit.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/domains/65qngkdovk8lwr12/smtp-users?limit=50 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/domains\/65qngkdovk8lwr12\/smtp-users?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/domains\/65qngkdovk8lwr12\/smtp-users","per_page":50,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d2f8f6a5d71a3-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:08:00 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_activity_builder_list_with_filters.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/sms-activity?date_from=1753195200&date_to=1753800000&status%5B%5D=sent&status%5B%5D=delivered&page=1&limit=25 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/sms-activity?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/sms-activity","per_page":25,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d60908826b01b-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:41:27 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/activity_get_single_event.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/activity/65qngkdovk8lwr12?page=1&limit=25&date_from=1750862870&date_to=1750949270&event%5B0%5D=sent 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12","per_page":25,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d76eeef2be1a5-VIE 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:56:43 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/activity_get_empty_result.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/activity/65qngkdovk8lwr12?page=1&limit=25&date_from=1750949232&date_to=1750949292&event%5B0%5D=survey_opened 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12","per_page":25,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d76f7bbeae291-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:56:44 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/email_send_with_tags.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"from": {"email": "ms-sdk@igor.fail", "name": "Sender"}, "to": [{"email": 4 | "igor@mailerlite.com", "name": "Recipient"}], "subject": "Test Email", "html": 5 | "

This is a test email

", "tags": ["test", "automation", "api-test"]}' 6 | headers: 7 | Accept: 8 | - application/json 9 | Accept-Encoding: 10 | - gzip, deflate 11 | Connection: 12 | - keep-alive 13 | Content-Length: 14 | - '228' 15 | Content-Type: 16 | - application/json 17 | User-Agent: 18 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 19 | method: POST 20 | uri: https://api.mailersend.com/v1/email 21 | response: 22 | body: 23 | string: '' 24 | headers: 25 | CF-RAY: 26 | - 966d6df208bfe290-BEG 27 | Cache-Control: 28 | - no-cache, private 29 | Connection: 30 | - keep-alive 31 | Content-Type: 32 | - text/html; charset=UTF-8 33 | Date: 34 | - Tue, 29 Jul 2025 14:50:35 GMT 35 | Server: 36 | - cloudflare 37 | Transfer-Encoding: 38 | - chunked 39 | cf-cache-status: 40 | - DYNAMIC 41 | strict-transport-security: 42 | - max-age=31536000; includeSubDomains 43 | x-apiquota-remaining: 44 | - '-1' 45 | x-apiquota-reset: 46 | - '2025-07-30T00:00:00Z' 47 | x-message-id: 48 | - 6888dfbb37648449d59f51ac 49 | x-send-paused: 50 | - 'true' 51 | status: 52 | code: 202 53 | message: Accepted 54 | version: 1 55 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_webhooks_create_invalid_sms_number.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"url": "https://example.com/webhook", "name": "Test SMS Webhook", "events": 4 | ["sms.sent", "sms.delivered"], "sms_number_id": "test-sms-number-id", "enabled": 5 | true}' 6 | headers: 7 | Accept: 8 | - application/json 9 | Accept-Encoding: 10 | - gzip, deflate 11 | Connection: 12 | - keep-alive 13 | Content-Length: 14 | - '163' 15 | Content-Type: 16 | - application/json 17 | User-Agent: 18 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 19 | method: POST 20 | uri: https://api.mailersend.com/v1/sms-webhooks 21 | response: 22 | body: 23 | string: '{"message":"The sms number id field is required. #MS42209","errors":{"sms_number_id":["The 24 | sms number id field is required. #MS42209"]}}' 25 | headers: 26 | CF-RAY: 27 | - 966d689b9b428e88-BEG 28 | Cache-Control: 29 | - no-cache, private 30 | Connection: 31 | - keep-alive 32 | Content-Type: 33 | - application/json 34 | Date: 35 | - Tue, 29 Jul 2025 14:46:56 GMT 36 | Server: 37 | - cloudflare 38 | Transfer-Encoding: 39 | - chunked 40 | cf-cache-status: 41 | - DYNAMIC 42 | strict-transport-security: 43 | - max-age=31536000; includeSubDomains 44 | x-apiquota-remaining: 45 | - '-1' 46 | x-apiquota-reset: 47 | - '2025-07-30T00:00:00Z' 48 | status: 49 | code: 422 50 | message: Unprocessable Entity 51 | version: 1 52 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/users_update.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"role": "member", "permissions": ["email_send"], "templates": [], "domains": 4 | []}' 5 | headers: 6 | Accept: 7 | - application/json 8 | Accept-Encoding: 9 | - gzip, deflate 10 | Connection: 11 | - keep-alive 12 | Content-Length: 13 | - '81' 14 | Content-Type: 15 | - application/json 16 | User-Agent: 17 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 18 | method: PUT 19 | uri: https://api.mailersend.com/v1/users/test-user-id 20 | response: 21 | body: 22 | string: '{"message":"The selected role is invalid. (and 2 more errors)","errors":{"role":["The 23 | selected role is invalid."],"templates":["Templates require a read own templates 24 | permission. #MS42224"],"permissions.0":["The selected permissions.0 is invalid."]}}' 25 | headers: 26 | CF-RAY: 27 | - 966d3dca8c73bbed-BEG 28 | Cache-Control: 29 | - no-cache, private 30 | Connection: 31 | - keep-alive 32 | Content-Type: 33 | - application/json 34 | Date: 35 | - Tue, 29 Jul 2025 14:17:42 GMT 36 | Server: 37 | - cloudflare 38 | Transfer-Encoding: 39 | - chunked 40 | cf-cache-status: 41 | - DYNAMIC 42 | strict-transport-security: 43 | - max-age=31536000; includeSubDomains 44 | x-apiquota-remaining: 45 | - '-1' 46 | x-apiquota-reset: 47 | - '2025-07-30T00:00:00Z' 48 | status: 49 | code: 422 50 | message: Unprocessable Entity 51 | version: 1 52 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_send_basic.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"from": "+1234567890", "to": ["+1234567890"], "text": "Hello, this 4 | is a test SMS message!"}' 5 | headers: 6 | Accept: 7 | - application/json 8 | Accept-Encoding: 9 | - gzip, deflate 10 | Connection: 11 | - keep-alive 12 | Content-Length: 13 | - '96' 14 | Content-Type: 15 | - application/json 16 | User-Agent: 17 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 18 | method: POST 19 | uri: https://api.mailersend.com/v1/sms 20 | response: 21 | body: 22 | string: '{"message":"The from field contains an invalid number. (and 2 more 23 | errors)","errors":{"from":["The from field contains an invalid number."],"to":["Daily 24 | quota for this number exceeded."],"to.0":["The to.0 field contains an invalid 25 | number."]}}' 26 | headers: 27 | CF-RAY: 28 | - 966d52c86efaaeaa-BEG 29 | Cache-Control: 30 | - no-cache, private 31 | Connection: 32 | - keep-alive 33 | Content-Type: 34 | - application/json 35 | Date: 36 | - Tue, 29 Jul 2025 14:32:02 GMT 37 | Server: 38 | - cloudflare 39 | Transfer-Encoding: 40 | - chunked 41 | cf-cache-status: 42 | - DYNAMIC 43 | strict-transport-security: 44 | - max-age=31536000; includeSubDomains 45 | x-apiquota-remaining: 46 | - '-1' 47 | x-apiquota-reset: 48 | - '2025-07-30T00:00:00Z' 49 | status: 50 | code: 422 51 | message: Unprocessable Entity 52 | version: 1 53 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_webhooks_create_with_all_events.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"url": "https://example.com/all-events", "name": "All Events Webhook", 4 | "events": ["sms.sent", "sms.delivered", "sms.failed"], "sms_number_id": "test-sms-number-id", 5 | "enabled": true}' 6 | headers: 7 | Accept: 8 | - application/json 9 | Accept-Encoding: 10 | - gzip, deflate 11 | Connection: 12 | - keep-alive 13 | Content-Length: 14 | - '182' 15 | Content-Type: 16 | - application/json 17 | User-Agent: 18 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 19 | method: POST 20 | uri: https://api.mailersend.com/v1/sms-webhooks 21 | response: 22 | body: 23 | string: '{"message":"The sms number id field is required. #MS42209","errors":{"sms_number_id":["The 24 | sms number id field is required. #MS42209"]}}' 25 | headers: 26 | CF-RAY: 27 | - 966d689d1ffa96e0-BEG 28 | Cache-Control: 29 | - no-cache, private 30 | Connection: 31 | - keep-alive 32 | Content-Type: 33 | - application/json 34 | Date: 35 | - Tue, 29 Jul 2025 14:46:57 GMT 36 | Server: 37 | - cloudflare 38 | Transfer-Encoding: 39 | - chunked 40 | cf-cache-status: 41 | - DYNAMIC 42 | strict-transport-security: 43 | - max-age=31536000; includeSubDomains 44 | x-apiquota-remaining: 45 | - '-1' 46 | x-apiquota-reset: 47 | - '2025-07-30T00:00:00Z' 48 | status: 49 | code: 422 50 | message: Unprocessable Entity 51 | version: 1 52 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/activity_builder_with_events.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/activity/65qngkdovk8lwr12?limit=50&date_from=1750942092&date_to=1750949292&event%5B0%5D=sent&event%5B1%5D=delivered&event%5B2%5D=opened 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12","per_page":50,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d76f9fa0ae291-BEG 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:56:45 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/identities_create_not_available.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"domain_id": "65qngkdovk8lwr12", "name": "Test Identity", "email": "ms-sdk@igor.fail", 4 | "reply_to_email": "ms-sdk@igor.fail", "reply_to_name": "Reply Test", "add_note": 5 | true, "personal_note": "Test identity for integration testing"}' 6 | headers: 7 | Accept: 8 | - application/json 9 | Accept-Encoding: 10 | - gzip, deflate 11 | Connection: 12 | - keep-alive 13 | Content-Length: 14 | - '232' 15 | Content-Type: 16 | - application/json 17 | User-Agent: 18 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 19 | method: POST 20 | uri: https://api.mailersend.com/v1/identities 21 | response: 22 | body: 23 | string: '{"message":"The email has already been taken.","errors":{"email":["The 24 | email has already been taken."]}}' 25 | headers: 26 | CF-RAY: 27 | - 9684c6c4badff339-BEG 28 | Cache-Control: 29 | - no-cache, private 30 | Connection: 31 | - keep-alive 32 | Content-Type: 33 | - application/json 34 | Date: 35 | - Fri, 01 Aug 2025 10:50:46 GMT 36 | Server: 37 | - cloudflare 38 | Transfer-Encoding: 39 | - chunked 40 | cf-cache-status: 41 | - DYNAMIC 42 | strict-transport-security: 43 | - max-age=31536000; includeSubDomains 44 | x-apiquota-remaining: 45 | - '-1' 46 | x-apiquota-reset: 47 | - '2025-08-02T00:00:00Z' 48 | status: 49 | code: 422 50 | message: Unprocessable Entity 51 | version: 1 52 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/sms_send_multiple_recipients.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"from": "+1234567890", "to": ["+1234567890"], "text": "Message for 4 | multiple recipients"}' 5 | headers: 6 | Accept: 7 | - application/json 8 | Accept-Encoding: 9 | - gzip, deflate 10 | Connection: 11 | - keep-alive 12 | Content-Length: 13 | - '93' 14 | Content-Type: 15 | - application/json 16 | User-Agent: 17 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 18 | method: POST 19 | uri: https://api.mailersend.com/v1/sms 20 | response: 21 | body: 22 | string: '{"message":"The from field contains an invalid number. (and 2 more 23 | errors)","errors":{"from":["The from field contains an invalid number."],"to":["Daily 24 | quota for this number exceeded."],"to.0":["The to.0 field contains an invalid 25 | number."]}}' 26 | headers: 27 | CF-RAY: 28 | - 966d533e5c36e294-BEG 29 | Cache-Control: 30 | - no-cache, private 31 | Connection: 32 | - keep-alive 33 | Content-Type: 34 | - application/json 35 | Date: 36 | - Tue, 29 Jul 2025 14:32:21 GMT 37 | Server: 38 | - cloudflare 39 | Transfer-Encoding: 40 | - chunked 41 | cf-cache-status: 42 | - DYNAMIC 43 | strict-transport-security: 44 | - max-age=31536000; includeSubDomains 45 | x-apiquota-remaining: 46 | - '-1' 47 | x-apiquota-reset: 48 | - '2025-07-30T00:00:00Z' 49 | status: 50 | code: 422 51 | message: Unprocessable Entity 52 | version: 1 53 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/activity_get_with_events.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: null 4 | headers: 5 | Accept: 6 | - application/json 7 | Accept-Encoding: 8 | - gzip, deflate 9 | Connection: 10 | - keep-alive 11 | Content-Type: 12 | - application/json 13 | User-Agent: 14 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 15 | method: GET 16 | uri: https://api.mailersend.com/v1/activity/65qngkdovk8lwr12?page=1&limit=25&date_from=1750862861&date_to=1750949261&event%5B0%5D=sent&event%5B1%5D=delivered&event%5B2%5D=opened 17 | response: 18 | body: 19 | string: '{"data":[],"links":{"first":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12?page=1","last":null,"prev":null,"next":null},"meta":{"current_page":1,"from":null,"path":"https:\/\/api.mailersend.com\/v1\/activity\/65qngkdovk8lwr12","per_page":25,"to":null}}' 20 | headers: 21 | CF-RAY: 22 | - 966d76ed5da025c0-VIE 23 | Cache-Control: 24 | - no-cache, private 25 | Connection: 26 | - keep-alive 27 | Content-Encoding: 28 | - gzip 29 | Content-Type: 30 | - application/json 31 | Date: 32 | - Tue, 29 Jul 2025 14:56:43 GMT 33 | Server: 34 | - cloudflare 35 | Transfer-Encoding: 36 | - chunked 37 | cf-cache-status: 38 | - DYNAMIC 39 | strict-transport-security: 40 | - max-age=31536000; includeSubDomains 41 | x-apiquota-remaining: 42 | - '-1' 43 | x-apiquota-reset: 44 | - '2025-07-30T00:00:00Z' 45 | status: 46 | code: 200 47 | message: OK 48 | version: 1 49 | -------------------------------------------------------------------------------- /tests/fixtures/cassettes/email_send_with_headers.yaml: -------------------------------------------------------------------------------- 1 | interactions: 2 | - request: 3 | body: '{"from": {"email": "ms-sdk@igor.fail", "name": "Sender"}, "to": [{"email": 4 | "igor@mailerlite.com", "name": "Recipient"}], "subject": "Test Email", "html": 5 | "

This is a test email

", "headers": [{"name": "X-Custom-Header", "value": 6 | "Custom Value"}]}' 7 | headers: 8 | Accept: 9 | - application/json 10 | Accept-Encoding: 11 | - gzip, deflate 12 | Connection: 13 | - keep-alive 14 | Content-Length: 15 | - '251' 16 | Content-Type: 17 | - application/json 18 | User-Agent: 19 | - mailersend-python/2.0.0 (Python/3.13.5; OS/Darwin 24.5.0; Impl/CPython) 20 | method: POST 21 | uri: https://api.mailersend.com/v1/email 22 | response: 23 | body: 24 | string: '' 25 | headers: 26 | CF-RAY: 27 | - 966d6df75d1871a6-BEG 28 | Cache-Control: 29 | - no-cache, private 30 | Connection: 31 | - keep-alive 32 | Content-Type: 33 | - text/html; charset=UTF-8 34 | Date: 35 | - Tue, 29 Jul 2025 14:50:36 GMT 36 | Server: 37 | - cloudflare 38 | Transfer-Encoding: 39 | - chunked 40 | cf-cache-status: 41 | - DYNAMIC 42 | strict-transport-security: 43 | - max-age=31536000; includeSubDomains 44 | x-apiquota-remaining: 45 | - '-1' 46 | x-apiquota-reset: 47 | - '2025-07-30T00:00:00Z' 48 | x-message-id: 49 | - 6888dfbc49f14409301e4d5c 50 | x-send-paused: 51 | - 'true' 52 | status: 53 | code: 202 54 | message: Accepted 55 | version: 1 56 | --------------------------------------------------------------------------------