> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lettr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Filtering and Searching

> Filter the Logs dashboard by date range, API key, client type, and HTTP status code to find the exact Lettr API requests you need.

The Logs page provides several filters that let you narrow down your API activity to exactly the requests you care about. All filters are applied together — if you set both an API key filter and a status filter, you'll only see requests that match both.

> [card] [Try it in the app](https://app.lettr.com/log?guide=eyJ2IjoxLCJzdGVwcyI6W3siYW5jaG9yIjoibG9ncy5maWx0ZXJzIiwibWVzc2FnZSI6IlVzZSB0aGVzZSBmaWx0ZXJzIHRvIG5hcnJvdyBBUEkgcmVxdWVzdHMgYnkgZGF0ZSByYW5nZSwgQVBJIGtleSwgY2xpZW50IHR5cGUgYW5kIEhUVFAgc3RhdHVzLiBGaWx0ZXJzIGNvbWJpbmUsIHNvIHJlc3VsdHMgbWF0Y2ggYWxsIG9mIHRoZW0uIn1dLCJkb2NzIjoiaHR0cHM6Ly9kb2NzLmxldHRyLmNvbS9sZWFybi9sb2dzL2ZpbHRlcmluZy1hbmQtc2VhcmNoaW5nIn0)
>
> Follow an interactive walkthrough of this guide inside Lettr.

## Date Range

The date range picker controls which time window Lettr queries for log data. By default it covers the last 7 days. You can extend it up to 30 days into the past — this is the maximum retention period for API logs. Dates beyond that are no longer available, and the picker doesn't offer future days.

The picker includes both a start and end date, as well as start and end times. Your local time is converted to UTC before the query runs, so you don't need to think about timezone conversion yourself.

## API Key

If your account has multiple API keys, this filter lets you isolate requests made with a specific key. This is particularly useful when you have separate keys for different environments (staging vs. production) or different services. Select **All API Keys** to see everything, or choose a specific key from the dropdown.

## User Agent

Lettr automatically detects the client type based on the user agent string in each request and groups them into recognizable categories. The available options are:

| Filter Label | What It Matches |
| - | - |
| SMTP | Requests routed through the SMTP proxy |
| Node.js | Requests from Node.js HTTP clients (axios, got, node-fetch, undici, and similar) |
| PHP | Requests from PHP HTTP clients (Guzzle and similar) |
| Python | Requests from Python HTTP libraries (requests, aiohttp, httpx, urllib) |
| Ruby | Requests from Ruby HTTP libraries (Faraday, HTTParty, rest-client, Net::HTTP) |
| GO | Requests from Go's standard HTTP client |
| Rust | Requests from Rust HTTP libraries (reqwest, hyper) |
| Java | Requests from Java HTTP clients (Apache HttpClient, OkHttp, HttpURLConnection) |
| .NET | Requests from .NET HTTP clients (HttpClient, RestSharp) |
| cURL | Requests made with the cURL command-line tool |
| Other | Any request whose user agent doesn't match the patterns above |

Selecting **Other** is useful when you're trying to identify unexpected traffic sources on your account.

## HTTP Status Code

Filter by the response status code to focus on successes or errors:

| Status | Meaning |
| - | - |
| 200 OK | The request succeeded and returned data |
| 201 Created | A resource was successfully created (e.g., an email was sent) |
| 400 Bad Request | The request was malformed or contained invalid parameters |
| 401 Unauthorized | The API key was missing or invalid |
| 403 Forbidden | The API key doesn't have permission for this action |
| 404 Not Found | The requested resource doesn't exist |
| 422 Unprocessable Content | The request was valid syntactically but failed validation (e.g., an invalid email address) |
| 429 Too Many Requests | You've exceeded the rate limit — see [Rate Limits](https://docs.lettr.com/api-reference/rate-limit.md) for details |
| 451 Unavailable For Legal Reasons | The request was blocked for compliance reasons |
| 500 Internal Server Error | Something went wrong on Lettr's side |

Filtering by 4xx or 5xx status codes is the fastest way to find failed requests when debugging an integration.

## Pagination

Log results are paginated using cursor-based navigation. The footer of the table shows how many requests are displayed on the current page, along with **Previous** and **Next** buttons. Cursor-based pagination means the results are always consistent — new log entries appearing in real time won't cause items to shift between pages as you navigate.

When you apply or change any filter, pagination resets to the first page automatically.

## Inspecting a Log Entry

Click the info icon on any row to open the detail dialog. This shows:

* The **Request Body** — the JSON payload your application sent, with large and sensitive fields shortened. This is where you can verify that fields like `from`, `to`, `subject`, `template_slug`, and `options` are structured correctly. `html`, `text`, and `amp_html` are cut off after 200 characters, and `substitution_data`, `metadata`, and `attachments` are replaced by a count such as `"3 items"` — see [Truncated Fields](https://docs.lettr.com/learn/logs/introduction.md#truncated-fields).
* The full **Response Body** — exactly what Lettr returned. For successful requests this includes the `request_id` and other confirmation data. For errors, it includes the error code and message.
* The **IP Address** and **User Agent** string, along with the **API Key** name and prefix.

> [!TIP]
>
> If you're debugging a specific email send that failed, start by filtering Logs by the date and time you attempted the send, then look for a POST request to `/api/emails`. The detail dialog will show you exactly what went wrong in the response.

## What You Can't Filter By

Logs record API *requests*, not emails, so the filters are about the request: when it was made, with which key, by which client, and how it ended. There is no filter for template, recipient, subject, or email content.

| You're looking for | Where to look |
| - | - |
| Emails sent to a specific recipient | [Events](https://docs.lettr.com/learn/events/introduction.md) — search by the recipient's exact email address |
| What happened to one email after sending | [Message Details](https://docs.lettr.com/learn/events/message-details.md) |
| The request that sent a template email | Logs — narrow the date and time to the send, then open the `POST /api/emails` entries and check `template_slug` in the request body |
| The merge tag values an email was sent with | Not available — see below |

### Merge Tag Values Are Not Stored

The request body shows `substitution_data` as a count (`"3 items"`), never the values themselves, and no other page shows them either. Merge tag values routinely contain personal data such as names, addresses, and order details, so Lettr uses them to build the email and then discards them rather than keeping them in logs.

The count is still useful: if it shows fewer items than the template has merge tags, your application didn't send all of them. To check the actual values, log the payload in your own application at send time, or send the same request with a [sandbox API key](https://docs.lettr.com/learn/api-keys/sandbox.md) — the email is delivered to your own address, so you can inspect exactly how the values were rendered.

> [card] [API Logs Overview](https://docs.lettr.com/learn/logs/introduction.md)
>
> What logs capture and when to use them

> [card] [Rate Limits](https://docs.lettr.com/api-reference/rate-limit.md)
>
> Understanding and handling 429 responses

> [card] [Errors and Retries](https://docs.lettr.com/learn/sending/errors-retries.md)
>
> How to handle common API errors

> [card] [API Keys](https://docs.lettr.com/learn/api-keys/introduction.md)
>
> Managing and securing the keys shown in your logs


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.