`https://lumail.io/api/v1/tags`

Retrieves all tags for your organization to help you categorize subscribers and target specific audiences for your campaigns.

## Response

- **Success (200 OK)** - Returns an array of tag objects.

## Response Fields

| Field         | Type    | Description                               |
| ------------- | ------- | ----------------------------------------- |
| `success`     | boolean | Indicates if the operation was successful |
| `tags`        | array   | Array of tag objects                      |
| `tags[].id`   | string  | Unique identifier for the tag             |
| `tags[].name` | string  | Name of the tag                           |

## Request Schema

No request body is required for this endpoint.

## Usage Example

Use this API endpoint to retrieve all tags in your organization, which can help you:

- Display all available tags in your application UI
- Create dropdown menus for tag selection in forms
- Sync tags between different systems or applications
- Get tag IDs needed for other API operations such as adding tags to subscribers
- Build tag-based filtering and segmentation tools


## API Reference
**Method:** GET
**Endpoint:** /api/v1/tags

### SDK
```ts
import { Lumail } from "lumail";
const lumail = new Lumail({ apiKey: "YOUR_API_TOKEN" });

const { tags } = await lumail.tags.list();
console.log(tags);
```

### cURL
```bash
curl -X GET https://lumail.io/api/v1/tags \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
```

### JavaScript
```javascript
const response = await fetch('https://lumail.io/api/v1/tags', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json',
  },
});

const data = await response.json();
console.log(data);
```

### Python
```python
import requests

url = "https://lumail.io/api/v1/tags"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}

response = requests.get(url, headers=headers)
data = response.json()
print(data)
```

### Success Response
```json
{
  "success": true,
  "tags": [
    {
      "id": "tag_JqaddtEx7z",
      "name": "newsletter"
    },
    {
      "id": "tag_rdEPhyjnfA",
      "name": "promotional"
    },
    {
      "id": "tag_kL9pqRs2tU",
      "name": "welcome-sequence"
    }
  ]
}
```

### Error Response
```json
{
  "message": "Invalid API token"
}
```
