# Mail Unsubscribe API

API for managing email unsubscription

**Version:** 1.0.0

## Overview

### Base URLs

- **Production server**: `https://api.repzo.me/v1`

### API Categories

- **Mail Unsubscribe**: Email unsubscription management operations

## Authentication

This API uses the following authentication methods:

- **ApiKeyAuth**

## Endpoints

### `/mail-unsubscribe`

#### GET /mail-unsubscribe

**Summary:** Get all unsubscribed emails

**Description:** Retrieve a list of all unsubscribed email addresses with optional filtering and pagination

**Tags:** Mail Unsubscribe

##### Parameters

| Name | Location | Type | Required | Description |
| ---- | -------- | ---- | -------- | ----------- |

| `page` | query | integer | No | Page number for pagination |

| `per_page` | query | integer | No | Number of items per page |

| `sort` | query | string | No | Sort field |

| `email` | query | string | No | Filter by email address |

| `company_namespace` | query | array | No | Company namespace for filtering |

| `_id` | query | array | No | Filter by ID |

##### Responses

**200** - Successful response

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**500** - No description

---

#### POST /mail-unsubscribe

**Summary:** Add email to unsubscribe list

**Description:** Add an email address to the unsubscribe list

**Tags:** Mail Unsubscribe

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**201** - Email unsubscribed successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**422** - No description

**500** - No description

---

### `/mail-unsubscribe/{id}`

#### GET /mail-unsubscribe/{id}

**Summary:** Get unsubscribe record by ID

**Description:** Retrieve a specific unsubscribe record by its ID

**Tags:** Mail Unsubscribe

##### Parameters

| Name | Location | Type | Required | Description |
| ---- | -------- | ---- | -------- | ----------- |

| `id` | path | string | Yes | Unsubscribe record ID |

##### Responses

**200** - Successful response

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**404** - No description

**500** - No description

---

#### DELETE /mail-unsubscribe/{id}

**Summary:** Remove email from unsubscribe list

**Description:** Remove an email address from the unsubscribe list (re-subscribe)

**Tags:** Mail Unsubscribe

##### Parameters

| Name | Location | Type | Required | Description |
| ---- | -------- | ---- | -------- | ----------- |

| `id` | path | string | Yes | Unsubscribe record ID |

##### Responses

**200** - Email re-subscribed successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**404** - No description

**500** - No description

---

### `/mail-unsubscribe/remove`

#### POST /mail-unsubscribe/remove

**Summary:** Bulk remove emails from unsubscribe list

**Description:** Remove multiple email addresses from the unsubscribe list

**Tags:** Mail Unsubscribe

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**200** - Emails re-subscribed successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**500** - No description

---

### `/mail-unsubscribe/check`

#### POST /mail-unsubscribe/check

**Summary:** Check if email is unsubscribed

**Description:** Check if an email address is in the unsubscribe list

**Tags:** Mail Unsubscribe

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**200** - Check result

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**500** - No description

---

## Data Models

### MailUnsubscribe

| Property | Type | Required | Description |
| -------- | ---- | -------- | ----------- |

| `_id` | string | No | Unique identifier |

| `email` | string | Yes | Unsubscribed email address |

| `reason` | string | No | Reason for unsubscribing |

| `unsubscribe_types` | array | No | Types of emails to unsubscribe from |

| `company_namespace` | array | No | Company namespace |

| `user_agent` | string | No | User agent of the request |

| `ip_address` | string | No | IP address of the request |

| `createdAt` | string | No | Unsubscribe date |

| `modifiedAt` | string | No | Last modification timestamp |

| `SVClient` | integer | No | Client version |

| `__v` | integer | No | Document version |

### CreateMailUnsubscribeRequest

| Property | Type | Required | Description |
| -------- | ---- | -------- | ----------- |

| `email` | string | Yes | Email address to unsubscribe |

| `reason` | string | No | Reason for unsubscribing |

| `unsubscribe_types` | array | No | Types of emails to unsubscribe from |

| `company_namespace` | array | No | Company namespace |

| `user_agent` | string | No | User agent of the request |

| `ip_address` | string | No | IP address of the request |

### PagingInfo

| Property | Type | Required | Description |
| -------- | ---- | -------- | ----------- |

| `total` | integer | No | Total number of items |

| `page` | integer | No | Current page number |

| `per_page` | integer | No | Items per page |

| `pages` | integer | No | Total number of pages |

## TypeScript Usage

See [mail-unsubscribe-examples.md](./mail-unsubscribe-examples.md) for detailed TypeScript usage examples.
