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

> ## Agent Instructions
> AhaSend stores all message data in the EU. See /facts.
> The API base URL is https://api.ahasend.com. Send the API key in the Authorization: Bearer header. See /api-reference/authentication.
> Use send.ahasend.com for SMTP. Ports 25, 587 and 2525 use STARTTLS. Port 465 is not supported. See /smtp.
> For send-only integrations, create an API Key v2 under Credentials → Add and scope it to messages:send:{your-domain}. See /send-api/credentials and /api-reference/scopes.

# Tags

> Tag the emails you send with the AhaSend API, for example by email type or feature, and filter messages by tag when you look them up or investigate a problem.

Tags label a message with what it is, such as `password-reset`, `invoice` or `onboarding`. You can then filter your messages by tag, for example to see how all invoice emails were delivered last week.

Available on Free, Pro and Max. See [plans and features](https://ahasend.com/docs/facts.md#plans-and-features).

## How do I tag an email?

Add a `tags` array to the send request:

```json theme={null}
{
  "sandbox": true,
  "from": { "email": "billing@yourdomain.com", "name": "Your Company" },
  "recipients": [{ "email": "customer@example.com" }],
  "subject": "Your invoice",
  "text_content": "Your invoice is attached.",
  "tags": ["invoice", "billing"]
}
```

| Rule | Limit |
| - | - |
| Tags per message | Up to 10 |
| Length of a tag | Up to 64 characters |
| Case | Tags are case-sensitive: `Invoice` and `invoice` are different tags |
| Characters | Don't use commas: AhaSend stores the tags as a comma-separated list |

## How do I find messages by tag?

[List Messages](https://ahasend.com/docs/api-reference/messages/get-messages.md) takes a `tags` filter with up to 20 comma-separated tags:

```bash theme={null}
curl --request GET \
  --url 'https://api.ahasend.com/v2/accounts/{account_id}/messages?tags=invoice&from_time=2026-11-01T00:00:00Z' \
  --header 'Authorization: Bearer YOUR_API_KEY'
```

## How should I name tags?

Name tags after what the email is, not after the recipient: a tag per user makes filtering useless. Lowercase with hyphens works well, such as `password-reset`, `order-confirmation` or `trial-ending`.

Over SMTP, use the `ahasend-tags` [special header](https://ahasend.com/docs/smtp/special-headers.md#message-tags-header) with the same rules.

## Related guides

* [Send email](https://ahasend.com/docs/send-api/send-email.md), [List Messages reference](https://ahasend.com/docs/api-reference/messages/get-messages.md), [SMTP special headers](https://ahasend.com/docs/smtp/special-headers.md).


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