# API & SMTP request logs

Professional and Enterprise plans, as well as Professional trial accounts, can get full visibility into every API & SMTP request with Logs, while all users can access template error logs.

The Logs feature provides advanced request tracking with detailed logs to give you deep insights into every request made. It’s a powerful tool that can help you debug faster, monitor your quota usage, and keep your account secure.

## How to access Logs

API and SMTP logs are available to Professional and Enterprise plan accounts, as well as Professional trial accounts (learn more about our [plans and pricing](/content/pricing/index.html)). If you have a Hobby or Starter account, you can still access Template error logs.

**Before using the Logs feature, you'll need to enable it for your account:**

1\. Navigate to **Settings** from the main menu.

2\. In the **Account** tab, scroll down to **Enable API Logging**.

3\. Toggle the option on and then click **Update**.

**Note:**

You must click **Update** to enable the logs.

To access Logs, simply click **Logs** in the left-hand navigation menu. You can switch between **API & SMTP logs** and **Template errors** by selecting the respective tab.

## API & SMTP logs

This tab contains a complete list of your API and SMTP requests, within your plan’s data retention period. For each request, you’ll be able to view:

- Response code

- Request method

- Endpoint used

- IP address

- User agent

- Date and time the request was made

You can also view the full request and response by clicking **Details**.

### Filtering

To more easily locate specific requests, you can filter the logs by:

- Endpoint

- Method: GET, POST, PUT, DELETE

- API token used

- Response code

For example, you can check whether there is an issue with your API keys by filtering the logs for the 401 response code, which indicates that the API token used is invalid.

Learn more about [HTTP response codes](https://developers.mailersend.com/general.html#http-status-codes).

## Template errors

The Template errors tab is available for all plans and contains any Twig errors that come from the variables you use in your email templates. It identifies which line of code contains the error, making troubleshooting Twig errors much easier. For each error, you’ll be able to view:

- The error type

- The message containing the error and line of code

You can open the affected email template by clicking **Open email**.

### Filtering

To search for errors on specific templates, you can filter them by:

- Resource (template) ID

- Email subject

- Email HTML

- Email text

- SMS text

- Long URL

Once you’ve identified the error, click **Open email** to fix the issue.

## Limitations

API and SMTP logs are available to Professional and Enterprise plans, as well as Professional trial accounts, while Template errors can be accessed by all plans.

For Professional plans, log retention is 7 days, for Enterprise, 14 days, and for Professional trial accounts, 1 day.

## Example use cases

### 1\. Understand why requests fail and fix issues

Password resets, email verifications, and order confirmations are a few examples of crucial customer communication. If recipients don’t receive them, and they reach out to support for help, the added visibility of Logs will help you to quickly identify the reason the specific request failed and allow you to fix it.

### 2\. Optimize sendings based on quota usage

If you regularly hit your daily request quota or rate limit, you can filter requests by response code 429 (Too many requests) to understand more about when these errors happen. You can then adjust your sending strategy, for example, by implementing bulk sending and queues for affected emails or specific times of the day to avoid hitting these limits.

### 3\. Monitor sending sources

With visibility into the user agent and IP of every request, you can quickly identify if any unauthorized sending sources are making requests. What’s more, it can help you spot unusual sending patterns and detect unusual spikes from API keys.

## Need more info?

Feel free to reach out to support@mailersend.com. A member of our support team will gladly assist you.

- [Getting started: Sending your first email](/content/help/getting-started/index.html)  - [Navigating the app interface](/content/help/navigating-the-dashboard/index.html)
- [Email](/content/help/email/index.html)  - [Add and verify a sending domain](/content/help/how-to-verify-and-authenticate-a-sending-domain/index.html)
  - [How to merge multiple SPF records](/content/help/how-to-merge-spf-records/index.html)
  - [Start sending transactional emails](/content/help/how-to-start-sending-emails/index.html)
  - [SMTP relay](/content/help/smtp-relay/index.html)
  - [Testing email sending with blackhole recipients](/content/help/how-to-test-email-sending-in-mailersend/index.html)
  - [Email Activity](/content/help/activity/index.html)
  - [Analytics](/content/help/analytics/index.html)
  - [Bulk email sending](/content/help/schedule-bulk-emails-with-the-bulk-endpoint/index.html)
  - [Custom headers](/content/help/custom-headers/index.html)
  - [Custom unsubscribe headers](/content/help/how-to-add-a-custom-unsubscribe-header/index.html)
  - [Sending domains](/content/help/what-is-a-sending-domain/index.html)
  - [Domain reputation](/content/help/domain-reputation/index.html)
  - [Domain tracking options](/content/help/domain-tracking-options/index.html)
  - [Personalization in emails](/content/help/how-to-use-personalization/index.html)
  - [Sender identities](/content/help/send-email-on-behalf-of-clients/index.html)
  - [Split Testing](/content/help/a-b-split-testing/index.html)
  - [Surveys](/content/help/how-to-add-a-survey-to-your-emails/index.html)
  - [Tagging emails](/content/help/how-to-tag-emails/index.html)
  - [Templates](/content/help/how-to-create-a-template/index.html)
  - [How to translate email templates automatically](/content/help/template-translations/index.html)
  - [How to configure SMTP connections correctly (421: Service not available error)](/content/help/smtp-configuration-421-error/index.html)
  - [How to enable Google Email Actions & Highlights](/content/help/enable-google-email-actions/index.html)
  - [How transactional emails work](/content/help/how-transactional-emails-work/index.html)
  - [The difference between transactional emails and marketing emails](/content/help/transactional-email-vs-marketing-email/index.html)
- [SMS](/content/help/sms/index.html)  - [Purchase an SMS phone number](/content/help/how-to-purchase-an-sms-phone-number/index.html)
  - [Start sending SMS](/content/help/how-to-start-sending-sms/index.html)
  - [SMS: How to handle opt-in and opt-out](/content/help/sms-how-to-handle-opt-in-and-opt-out/index.html)
  - [SMS verification and usage limits](/content/help/sms-verification-and-limits/index.html)
- [WhatsApp](/content/help/whatsapp/index.html)  - [Getting started with WhatsApp](/content/help/getting-started-with-whatsapp/index.html)
  - [How to connect and use the WhatsApp sandbox](/content/help/whatsapp-sandbox/index.html)
  - [Managing WhatsApp Business phone numbers](/content/help/managing-whatsapp-business-phone-numbers/index.html)
  - [How to create and manage WhatsApp templates](/content/help/how-to-create-and-manage-whatsapp-templates/index.html)
  - [WhatsApp message activity](/content/help/whatsapp-message-activity/index.html)
  - [WhatsApp inbound messaging: How it works and how to set it up](/content/help/whatsapp-inbound-messaging/index.html)
- [Developer tools](/content/help/developer-tools/index.html)  - [Managing API tokens](/content/help/managing-api-tokens/index.html)
  - [Webhooks](/content/help/webhooks/index.html)
  - [API & SMTP request logs](/content/help/api-smtp-logs/index.html)
  - [REST API response codes](/content/help/rest-api-response-codes/index.html)
- [Deliverability](/content/help/deliverability/index.html)  - [Blocklist monitoring](/content/help/blocklist-monitoring/index.html)
  - [DMARC monitoring](/content/help/dmarc-monitoring/index.html)
  - [How to verify an email list](/content/help/how-to-verify-email-addresses/index.html)
  - [Deferred emails](/content/help/what-are-deferred-bounces/index.html)
  - [Suppressions](/content/help/suppression-list-managing/index.html)
  - [On Hold blocklist](/content/help/on-hold-blocklist/index.html)
  - [Spam complaints](/content/help/spam-complaints/index.html)
  - [403, 422, & 429 errors](/content/help/rate-limits-how-to-reduce-403-422-429-errors/index.html)
  - [What are hard and soft bounces?](/content/help/bounced-emails/index.html)
  - [Improve email deliverability](/content/help/improve-email-deliverability/index.html)
  - [Reduce unsubscribe rates](/content/help/reducing-unsubscribe-rates/index.html)
  - [Account reputation statuses](/content/help/account-reputation-statuses/index.html)
- [Account, billing & add-ons](/content/help/account-settings/index.html)  - [Plans, features and limits](/content/help/plans-features-and-limits/index.html)
  - [Plan add-ons](/content/help/plan-add-ons/index.html)
  - [User management](/content/help/user-management/index.html)
  - [Change password](/content/help/change-password/index.html)
  - [Two-factor authentication](/content/help/two-factor-authentication/index.html)
  - [Switch accounts](/content/help/switch-accounts/index.html)
  - [How to whitelist IPs](/content/help/how-to-whitelist-ips/index.html)
  - [How to add a domain space to your account](/content/help/how-to-add-a-domain-space-to-your-account/index.html)
  - [How to request a dedicated IP](/content/help/how-to-request-dedicated-ip/index.html)
  - [How to set a billing limit on your account](/content/help/how-to-set-a-billing-limit/index.html)
  - [How to change your payment method](/content/help/how-to-change-your-payment-method/index.html)
  - [How to change or cancel your plan](/content/help/how-to-change-or-cancel-your-plan/index.html)
  - [Delete account](/content/help/delete-account/index.html)
  - [VAT Collection for EU Customers](/content/help/vat-collection-eu/index.html)
  - [VAT Collection for UK Customers](/content/help/vat-collection-uk/index.html)
  - [GST Collection for Customers in India](/content/help/gst-collection-india/index.html)
  - [GST Collection for Customers in Canada](/content/help/gst-collection-canada/index.html)
  - [VAT (IVA) Collection for Customers in Chile](/content/help/vat-iva-collection-chile/index.html)
  - [Sandbox mode and the Professional trial](/content/help/sandbox-mode-and-the-professional-trial/index.html)
  - [Sales Tax Collection for Customers in New York](/content/help/sales-tax-collection-for-customers-in-new-york/index.html)
- [Integrations](/content/help/integrations/index.html)  - [How to integrate MailerSend with Zapier](/content/help/how-to-integrate-mailersend-with-zapier/index.html)
  - [How to integrate MailerSend with Supabase](/content/help/how-to-integrate-mailersend-with-supabase/index.html)
  - [How to integrate MailerSend with Airtable](/content/help/how-to-integrate-mailersend-with-airtable/index.html)
  - [How to integrate MailerSend with Slack for email event notifications](/content/help/how-to-integrate-mailersend-with-slack-for-email-event-notifications/index.html)
  - [WordPress](/content/help/how-to-integrate-mailersend-with-wordpress/index.html)
  - [WooCommerce](/content/help/how-to-integrate-mailersend-with-woocommerce/index.html)
  - [How to configure MailerSend on Google Cloud](/content/help/how-to-configure-mailersend-on-google-cloud/index.html)
  - [How to connect MailerSend's MCP with your AI tools](/content/help/how-to-connect-mailersends-mcp/index.html)
- [Agency guides](/content/help/agency-guides/index.html)  - [Creating sub-accounts for clients](/content/help/creating-sub-accounts/index.html)
  - [Sending emails for clients: domains vs. sender identities](/content/help/sender-identities-vs-domains/index.html)
- [API reference ↗](https://developers.mailersend.com/)

- [How to access Logs](/content/help/api-smtp-logs/index.html#how-to-access-logs)
- [API & SMTP logs](/content/help/api-smtp-logs/index.html#api-smtp-logs)
- [Template errors](/content/help/api-smtp-logs/index.html#template-errors)
- [Limitations](/content/help/api-smtp-logs/index.html#limitations)
- [Example use cases](/content/help/api-smtp-logs/index.html#example-use-cases)
