{
  "openapi": "3.0.0",
  "paths": {
    "/api/health": {
      "get": {
        "description": "\n    Basic health check endpoint to verify API availability.\n    \n    **Purpose:**\n    - Monitor application health status\n    - Verify API server is running and responsive\n    - Used by load balancers and monitoring systems\n    \n    **Response:**\n    - Returns simple \"Healthy\" string when API is operational\n    - No authentication required (public endpoint)\n    \n    **Use Cases:**\n    - Load balancer health checks\n    - Monitoring and alerting systems\n    - Basic connectivity testing\n    - Service discovery and registration\n    ",
        "operationId": "AppController_getHealth",
        "parameters": [],
        "responses": {
          "200": {
            "description": "API is healthy and operational",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "example": "Healthy"
                }
              }
            }
          }
        },
        "summary": "Health check",
        "tags": [
          "Health"
        ]
      }
    },
    "/api/servers/status": {
      "get": {
        "description": "\n    Returns real-time status information about the authenticated server including message counts, throughput rates, queue status, and storage usage.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n\n    **Response Fields:**\n    - **incoming**: Number of incoming messages in the last 60 seconds\n    - **outgoing**: Number of outgoing messages in the last 60 seconds\n    - **rate**: Message throughput rate per minute (rounded to 1 decimal place)\n    - **held**: Number of messages currently held\n    - **queued**: Number of messages currently in the queue ready to send\n    - **bounceRate**: Bounce rate as a percentage over the last 30 days (rounded to 1 decimal place)\n    - **storage**: Total storage occupied by message content in MB (rounded to 1 decimal place)\n\n    **Notes:**\n    - Statistics are retrieved only for the server associated with the API key used for authentication\n    - incoming and outgoing counts represent message activity in the last 60 seconds\n    - rate is calculated from the total message throughput (incoming + outgoing) over the last 60 seconds, expressed as messages per minute\n    - bounceRate is calculated from the ratio of bounced messages to total outgoing messages over the last 30 days\n    - storage represents the total size of raw message data (headers and body) stored for the server\n    ",
        "operationId": "ServersController_getServerStatus",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Server status retrieved successfully",
            "schema": {
              "example": {
                "incoming": 10,
                "outgoing": 21,
                "rate": 9.1,
                "held": 3,
                "queued": 10,
                "bounceRate": 4.4,
                "storage": 30.8
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServerStatusDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Server not authorized for this organization"
          },
          "422": {
            "description": "Unprocessable entity - Unable to retrieve server status"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get server status",
        "tags": [
          "Server Management"
        ]
      }
    },
    "/api/servers/ip-addresses": {
      "get": {
        "description": "\n    Returns the list of IP addresses configured for the authenticated server.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n\n    **Response Fields:**\n    - **ipAddresses**: Array of IP address objects\n      - **ipv4**: IPv4 address (can be null)\n      - **ipv6**: IPv6 address (can be null)\n      - **hostname**: Hostname associated with the IP\n      - **priority**: Priority of the IP address (lower number = higher priority)\n\n    **Notes:**\n    - IP addresses are ordered by priority (lowest to highest)\n    - Either ipv4 or ipv6 (or both) will be present for each entry\n    - Priority is used to determine the order in which IPs are used for sending\n    ",
        "operationId": "ServersController_getIpAddresses",
        "parameters": [],
        "responses": {
          "200": {
            "description": "IP addresses retrieved successfully",
            "schema": {
              "example": {
                "ipAddresses": [
                  {
                    "ipv4": "192.168.0.1",
                    "ipv6": null,
                    "hostname": "server1.example.com",
                    "priority": 10
                  },
                  {
                    "ipv4": "192.168.0.3",
                    "ipv6": null,
                    "hostname": "server3.example.com",
                    "priority": 20
                  }
                ]
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IpAddressesResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Server not authorized for this organization"
          },
          "422": {
            "description": "Unprocessable entity - Unable to retrieve IP addresses"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get server IP addresses",
        "tags": [
          "Server Management"
        ]
      }
    },
    "/api/servers/suppressions": {
      "get": {
        "description": "\n    Returns the suppression list with pagination and optional keyword search.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n\n    **Query Parameters:**\n    - **page**: Page number for pagination (default: 1)\n    - **limit**: Number of items per page (default: 20, max: 100)\n    - **keyword**: Search keyword to filter by email address (partial match)\n\n    **Response Fields:**\n    - **data**: Array of suppression entries with id, email, reason, createdAt, expireAt\n    - **total**: Total number of suppression entries\n    - **page**: Current page number\n    - **limit**: Items per page\n    - **totalPages**: Total number of pages\n\n    **Notes:**\n    - The keyword parameter performs a partial match on the email address field\n    - Use this to search for all suppressions from a specific domain (e.g., keyword=@example.com)\n    - Results are ordered by creation date (newest first)\n    - Suppressed email addresses will not receive outgoing emails\n    - **Transactional product:** entries also carry **source** and **removable**, and **expireAt** is null because these suppressions do not expire. The list is per organization product and holds hard bounces and spam complaints recorded from Amazon SES plus addresses added manually. Complaint coverage is partial by nature: some mailbox providers, Gmail among them, do not report complaints to Amazon SES.\n    ",
        "operationId": "ServersController_listSuppressions",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number",
            "schema": {
              "minimum": 1,
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Items per page",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "type": "number"
            }
          },
          {
            "name": "keyword",
            "required": false,
            "in": "query",
            "description": "Search keyword to filter by email address (partial match). Use to search for all suppressions from a specific domain (e.g., @example.com)",
            "schema": {
              "example": "@example.com",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Suppressions list retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SuppressionDto"
                      },
                      "example": [
                        {
                          "id": 123,
                          "email": "user@example.com",
                          "reason": "too many hard fails",
                          "createdAt": "2025-01-15T10:30:00Z",
                          "expireAt": "2025-02-14T10:30:00Z"
                        },
                        {
                          "id": 124,
                          "email": "another@example.com",
                          "reason": "too many soft fails",
                          "createdAt": "2025-01-14T08:15:00Z",
                          "expireAt": "2025-02-13T08:15:00Z"
                        }
                      ]
                    },
                    "total": {
                      "type": "number",
                      "description": "Total number of suppression entries",
                      "example": 150
                    },
                    "page": {
                      "type": "number",
                      "description": "Current page number",
                      "example": 1
                    },
                    "limit": {
                      "type": "number",
                      "description": "Items per page",
                      "example": 20
                    },
                    "totalPages": {
                      "type": "number",
                      "description": "Total number of pages",
                      "example": 8
                    }
                  },
                  "example": {
                    "data": [
                      {
                        "id": 123,
                        "email": "user@example.com",
                        "reason": "too many hard fails",
                        "createdAt": "2025-01-15T10:30:00Z",
                        "expireAt": "2025-02-14T10:30:00Z"
                      },
                      {
                        "id": 124,
                        "email": "another@example.com",
                        "reason": "too many soft fails",
                        "createdAt": "2025-01-14T08:15:00Z",
                        "expireAt": "2025-02-13T08:15:00Z"
                      }
                    ],
                    "total": 150,
                    "page": 1,
                    "limit": 20,
                    "totalPages": 8
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Server not authorized for this organization"
          },
          "422": {
            "description": "Unprocessable entity - Unable to retrieve suppressions"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "List suppressions",
        "tags": [
          "Server Management"
        ]
      },
      "post": {
        "description": "\n    Adds an email address to the suppression list. **Transactional product only** --\n    Sales suppressions are written by the sending server itself and cannot be added here.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n\n    **Request Body:**\n    - **email**: The address to stop sending to\n    - **reason**: Optional note shown as the reason in the list and the export\n\n    **Notes:**\n    - Any send to this address (to, cc or bcc) is refused with a 403 from now on and recorded in the email logs with status Suppressed\n    - Matching is case-insensitive; the address is stored exactly as given\n    - Returns 409 if the address is already on the list\n    - Limited to 30 additions per minute per product\n    - Suppressions added here never expire; remove them from the list when they should no longer apply\n    ",
        "operationId": "ServersController_createSuppression",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSuppressionDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Suppression added",
            "schema": {
              "example": {
                "id": 125,
                "email": "user@example.com",
                "reason": "Unsubscribed via support",
                "createdAt": "2026-09-02T10:30:00Z",
                "expireAt": null,
                "source": "manual",
                "removable": true
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuppressionDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid email address"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Server not authorized for this organization"
          },
          "404": {
            "description": "Not found - Suppressions cannot be added for this product"
          },
          "409": {
            "description": "Conflict - Address is already on the suppression list"
          },
          "429": {
            "description": "Too many requests - Addition rate limit reached"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Add a suppression",
        "tags": [
          "Server Management"
        ]
      },
      "delete": {
        "description": "\n    Deletes multiple suppression entries by their IDs.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n\n    **Request Body:**\n    - **ids**: Array of suppression IDs to delete\n\n    **Notes:**\n    - The count in the response may be less than the number of IDs provided if some IDs were not found\n    - This operation is atomic - it will delete all valid IDs in a single database operation\n    - Once deleted, the email addresses can receive outgoing emails again\n    - **Transactional product:** hard-bounce entries among the IDs are skipped and stay on the list; the count reports only what was removed\n    ",
        "operationId": "ServersController_deleteSuppressions",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteSuppressionsDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Suppressions deleted successfully",
            "schema": {
              "example": {
                "deleted": true,
                "count": 3
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuppressionsDeleteResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid request body"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Server not authorized for this organization"
          },
          "422": {
            "description": "Unprocessable entity - Unable to delete suppressions"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Delete multiple suppressions",
        "tags": [
          "Server Management"
        ]
      }
    },
    "/api/servers/suppressions/{id}": {
      "delete": {
        "description": "\n    Deletes a single suppression entry by its ID.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n\n    **Path Parameters:**\n    - **id**: The ID of the suppression to delete\n\n    **Notes:**\n    - Returns 404 if the suppression is not found\n    - Once deleted, the email address can receive outgoing emails again\n    - **Transactional product:** a hard-bounce entry cannot be deleted and returns 403. The address is also on the global suppression list Amazon maintains, which cannot be edited, so removing it here would only produce a second bounce against the account's bounce rate. Contact support to clear one.\n    ",
        "operationId": "ServersController_deleteSuppression",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "The ID of the suppression to delete",
            "schema": {
              "example": 123,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Suppression deleted successfully",
            "schema": {
              "example": {
                "deleted": true,
                "count": 1
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuppressionsDeleteResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Server not authorized for this organization"
          },
          "404": {
            "description": "Not found - Suppression not found"
          },
          "422": {
            "description": "Unprocessable entity - Unable to delete suppression"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Delete suppression by ID",
        "tags": [
          "Server Management"
        ]
      }
    },
    "/api/servers/suppressions/all": {
      "delete": {
        "description": "\n    Deletes all suppression entries for the server. This is a destructive operation.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n\n    **Warning:**\n    - This operation cannot be undone\n    - All suppressed email addresses will be able to receive outgoing emails again\n    - Use with caution in production environments\n    - **Transactional product:** hard-bounce entries are kept; everything else is removed and the count reports what went\n    ",
        "operationId": "ServersController_deleteAllSuppressions",
        "parameters": [],
        "responses": {
          "200": {
            "description": "All suppressions deleted successfully",
            "schema": {
              "example": {
                "deleted": true,
                "count": 1547
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuppressionsDeleteResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Server not authorized for this organization"
          },
          "422": {
            "description": "Unprocessable entity - Unable to delete suppressions"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Delete all suppressions",
        "tags": [
          "Server Management"
        ]
      }
    },
    "/api/domains": {
      "get": {
        "description": "\n    Retrieve a paginated list of domains from the database with project information.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n\n    **Query Parameters:**\n    - **page**: Page number (default: 1)\n    - **limit**: Items per page (default: 30)\n    - **projectId**: Filter by project ID (UUID)\n    - **verified**: Filter by verification status (true/false)\n    - **search**: Search domains by name (partial matching)\n    - **isWarmupActive**: Filter by warmup status (true/false)\n    - **warmedDays**: Filter by minimum warmed days (number)\n    - **createdFrom**: Filter domains created from this date (YYYY-MM-DD)\n    - **createdTo**: Filter domains created until this date (YYYY-MM-DD)\n    - **orderBy**: Sort field (name, createdAt, updatedAt, numberOfMailboxes)\n    - **orderDirection**: Sort direction (ASC, DESC)\n\n    **Database Query:**\n    - Domains are fetched from the local database\n    - Includes project association and relationship data\n    - DNS status reflects last sync with Postal\n    - Multi-tenant isolation via organizationProductId\n\n    **Response Fields:**\n    - Domain ID, name, and verification status\n    - Project ID and name (if associated)\n    - DNS record status (SPF, DKIM, MX, Return Path, DMARC)\n    - Warmup information (isWarmupActive, warmedDays)\n    - Creation and update timestamps\n\n    **Use Cases:**\n    - Domain management dashboard\n    - Project-based domain filtering\n    - Verification status monitoring\n    - Domain search and organization\n    - Warmup progress tracking\n    ",
        "operationId": "DomainsController_listDomains",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number",
            "schema": {
              "minimum": 1,
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Items per page (up to 500)",
            "schema": {
              "minimum": 1,
              "maximum": 500,
              "default": 30,
              "type": "number"
            }
          },
          {
            "name": "projectId",
            "required": false,
            "in": "query",
            "description": "Filter domains by project ID",
            "schema": {
              "example": "550e8400-e29b-41d4-a716-446655440000",
              "type": "string"
            }
          },
          {
            "name": "verified",
            "required": false,
            "in": "query",
            "description": "Filter domains by verification status",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "Search for domains by name",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isWarmupActive",
            "required": false,
            "in": "query",
            "description": "Filter domains by warmup status (active/inactive)",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "warmedDays",
            "required": false,
            "in": "query",
            "description": "Filter domains by minimum warmed days",
            "schema": {
              "example": 14,
              "type": "number"
            }
          },
          {
            "name": "createdFrom",
            "required": false,
            "in": "query",
            "description": "Filter domains created from this date (ISO 8601 format)",
            "schema": {
              "example": "2024-01-01",
              "type": "string"
            }
          },
          {
            "name": "createdTo",
            "required": false,
            "in": "query",
            "description": "Filter domains created until this date (ISO 8601 format)",
            "schema": {
              "example": "2024-12-31",
              "type": "string"
            }
          },
          {
            "name": "orderBy",
            "required": false,
            "in": "query",
            "description": "Field to order by",
            "schema": {
              "type": "string",
              "enum": [
                "name",
                "createdAt",
                "updatedAt",
                "numberOfMailboxes"
              ]
            }
          },
          {
            "name": "orderDirection",
            "required": false,
            "in": "query",
            "description": "Direction to order",
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ]
            }
          },
          {
            "name": "customMxEnabled",
            "required": false,
            "in": "query",
            "description": "Filter domains by custom MX status",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "blacklisted",
            "required": false,
            "in": "query",
            "description": "Filter domains by Spamhaus DBL / SURBL listed status",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "includeStats",
            "required": false,
            "in": "query",
            "description": "Whether to include message statistics for each domain",
            "schema": {
              "default": true,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of domains retrieved successfully from database",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DomainDto"
                      },
                      "example": [
                        {
                          "id": "6a84bf23-825d-464f-8aa2-4ee218ecde93",
                          "domainName": "example.com",
                          "verified": false,
                          "spfStatus": "Missing",
                          "dkimStatus": "Missing",
                          "returnPathStatus": "Missing",
                          "mxStatus": "Missing",
                          "dmarcStatus": "OK",
                          "projectId": "b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a",
                          "projectName": "Q1 Campaign",
                          "warmupStartDate": null,
                          "warmedDays": 0,
                          "totalWarmedDays": 0,
                          "isWarmupActive": false,
                          "emailSent": 0,
                          "mailboxCount": 5,
                          "createdAt": "2025-12-23T05:50:35.579Z",
                          "updatedAt": "2025-12-23T06:09:37.150Z"
                        }
                      ]
                    },
                    "total": {
                      "type": "number",
                      "description": "Total number of domains matching the query",
                      "example": 150
                    },
                    "page": {
                      "type": "number",
                      "description": "Current page number",
                      "example": 1
                    },
                    "limit": {
                      "type": "number",
                      "description": "Items per page",
                      "example": 30
                    },
                    "totalPages": {
                      "type": "number",
                      "description": "Total number of pages",
                      "example": 5
                    }
                  },
                  "example": {
                    "data": [
                      {
                        "id": "6a84bf23-825d-464f-8aa2-4ee218ecde93",
                        "domainName": "example1.com",
                        "verified": false,
                        "spfStatus": "Missing",
                        "dkimStatus": "Missing",
                        "returnPathStatus": "Missing",
                        "mxStatus": "OK",
                        "dmarcStatus": "OK",
                        "projectId": "b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a",
                        "projectName": "Q1 Campaign",
                        "warmupStartDate": "2025-12-18T00:00:00Z",
                        "warmedDays": 5,
                        "totalWarmedDays": 5,
                        "isWarmupActive": true,
                        "emailSent": 125,
                        "mailboxCount": 3,
                        "createdAt": "2025-12-23T05:50:35.579Z",
                        "updatedAt": "2025-12-23T06:09:37.150Z"
                      },
                      {
                        "id": "7c95cf34-936e-575g-9bb3-5ff329edfb04",
                        "domainName": "example2.com",
                        "verified": true,
                        "spfStatus": "OK",
                        "dkimStatus": "OK",
                        "returnPathStatus": "OK",
                        "mxStatus": "OK",
                        "dmarcStatus": "OK",
                        "projectId": "b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a",
                        "projectName": "Q1 Campaign",
                        "warmupStartDate": null,
                        "warmedDays": 14,
                        "totalWarmedDays": 14,
                        "isWarmupActive": false,
                        "emailSent": 450,
                        "mailboxCount": 8,
                        "createdAt": "2025-12-20T10:15:22.123Z",
                        "updatedAt": "2025-12-23T08:30:45.456Z"
                      }
                    ],
                    "total": 150,
                    "page": 1,
                    "limit": 30,
                    "totalPages": 5
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid pagination parameters or server ID"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Server not authorized for this organization or no active servers"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "List domains with advanced filtering and pagination",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/domains/statistic": {
      "get": {
        "description": "\n    Retrieve aggregated statistics about domains for the authenticated product.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n\n    **Statistics Returned:**\n    - **totalDomains**: Total number of domains registered for the product\n    - **verifiedDomains**: Number of fully verified domains (SPF, DKIM, MX, Return Path, and DMARC all OK)\n    - **warmupRunningDomains**: Number of domains currently running warmup\n\n    **Use Cases:**\n    - Domain management dashboard overview\n    - Quick health check of domain portfolio\n    - Monitoring domain setup progress\n    - Tracking warmup campaigns\n    ",
        "operationId": "DomainsController_getStatistics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Domain statistics retrieved successfully",
            "schema": {
              "example": {
                "totalDomains": 100,
                "verifiedDomains": 75,
                "warmupRunningDomains": 30
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainStatisticsDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Organization product ID is required"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get domain statistics",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/domains/export": {
      "get": {
        "description": "\n    Export domains matching the query filters to CSV format for download.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n\n    **Query Parameters (same as list endpoint):**\n    - **projectId**: Filter by project ID (UUID)\n    - **verified**: Filter by verification status (true/false)\n    - **search**: Search domains by name (partial matching)\n    - **isWarmupActive**: Filter by warmup status (true/false)\n    - **warmedDays**: Filter by minimum warmed days (number)\n    - **createdFrom**: Filter domains created from this date (YYYY-MM-DD)\n    - **createdTo**: Filter domains created until this date (YYYY-MM-DD)\n    - **orderBy**: Sort field (name, createdAt, updatedAt, numberOfMailboxes)\n    - **orderDirection**: Sort direction (ASC, DESC)\n\n    **Note:** Unlike the list endpoint, this exports ALL matching domains (no pagination).\n\n    **CSV Columns:**\n    - ID, Domain Name, Project ID, Project Name\n    - Verified (Yes/No)\n    - SPF Status, DKIM Status, Return Path Status, MX Status, DMARC Status\n    - Warmup On (Yes/No), Warmed Days, Email Sent\n    - Mailbox Count\n    - Created At, Updated At\n\n    **Response:**\n    - Content-Type: text/csv\n    - Content-Disposition: attachment; filename=\"domains.csv\"\n    - Returns CSV content as plain text\n\n    **Use Cases:**\n    - Export filtered domain list for reporting\n    - Backup domain configuration data\n    - Generate domain inventory reports\n    - Share domain data with team members\n    - Analyze domain portfolio in spreadsheet tools\n    ",
        "operationId": "DomainsController_exportDomains",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number",
            "schema": {
              "minimum": 1,
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Items per page (up to 500)",
            "schema": {
              "minimum": 1,
              "maximum": 500,
              "default": 30,
              "type": "number"
            }
          },
          {
            "name": "projectId",
            "required": false,
            "in": "query",
            "description": "Filter domains by project ID",
            "schema": {
              "example": "550e8400-e29b-41d4-a716-446655440000",
              "type": "string"
            }
          },
          {
            "name": "verified",
            "required": false,
            "in": "query",
            "description": "Filter domains by verification status",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "Search for domains by name",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isWarmupActive",
            "required": false,
            "in": "query",
            "description": "Filter domains by warmup status (active/inactive)",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "warmedDays",
            "required": false,
            "in": "query",
            "description": "Filter domains by minimum warmed days",
            "schema": {
              "example": 14,
              "type": "number"
            }
          },
          {
            "name": "createdFrom",
            "required": false,
            "in": "query",
            "description": "Filter domains created from this date (ISO 8601 format)",
            "schema": {
              "example": "2024-01-01",
              "type": "string"
            }
          },
          {
            "name": "createdTo",
            "required": false,
            "in": "query",
            "description": "Filter domains created until this date (ISO 8601 format)",
            "schema": {
              "example": "2024-12-31",
              "type": "string"
            }
          },
          {
            "name": "orderBy",
            "required": false,
            "in": "query",
            "description": "Field to order by",
            "schema": {
              "type": "string",
              "enum": [
                "name",
                "createdAt",
                "updatedAt",
                "numberOfMailboxes"
              ]
            }
          },
          {
            "name": "orderDirection",
            "required": false,
            "in": "query",
            "description": "Direction to order",
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ]
            }
          },
          {
            "name": "customMxEnabled",
            "required": false,
            "in": "query",
            "description": "Filter domains by custom MX status",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "blacklisted",
            "required": false,
            "in": "query",
            "description": "Filter domains by Spamhaus DBL / SURBL listed status",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "includeStats",
            "required": false,
            "in": "query",
            "description": "Whether to include message statistics for each domain",
            "schema": {
              "default": true,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CSV file content with domains data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "example": "ID,Domain Name,Project ID,Project Name,Verified,SPF Status,DKIM Status,Return Path Status,MX Status,DMARC Status,Warmup On,Warmed Days,Email Sent,Mailbox Count,Created At,Updated At\\n6a84bf23-825d-464f-8aa2-4ee218ecde93,example.com,b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a,Q1 Campaign,No,Missing,Missing,Missing,OK,OK,No,0,0,5,2025-12-23T05:50:35.579Z,2025-12-23T06:09:37.150Z"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid query parameters or organization product ID required"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Export domains to CSV",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/domains/create": {
      "post": {
        "description": "\n    Register a single domain with an OBM server for email sending.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n\n    **Process:**\n    1. Validates product-level API key and sending account access\n    2. Registers the domain on the sending account's mail server\n    3. Creates the domain in your account and returns its DNS records\n    4. **Pushes the DNS records automatically** when one of your connected DNS\n       provider keys manages the domain (see below), then runs a first\n       verification\n\n    **Automatic DNS push:**\n    - Connect a DNS provider key once with `POST /api/dns-credentials`\n      (Cloudflare, GoDaddy, Porkbun, Spaceship, Dynadot or Vercel). Every domain you add after that whose nameservers\n      point at that provider gets its records written for you.\n    - The provider is found from the domain's live nameservers, so connect the\n      key of the provider that **hosts the DNS**, which is not always the\n      registrar.\n    - The push needs the `X-Server-API-Key` header (a product API key).\n    - The response says what happened: `hasDnsManager` is true when a\n      connected key manages the domain, and `emailDns` carries the push\n      result (`pushed`, `successCount`, `failureCount`, `pushError`) and\n      the first verification statuses.\n    - With no key that manages the domain, `hasDnsManager` is false and\n      nothing is pushed: publish the returned records yourself, or connect a\n      key and call `POST /api/domains/push-dns`.\n\n    **DNS Records Returned:**\n    - **DMARC**: For email authentication policy\n    - **SPF**: For sender policy framework\n    - **DKIM**: For domain key identification\n    - **RP**: For return path configuration\n\n    **Next Steps:**\n    - If `emailDns.pushed` is false, publish the returned records (or push them)\n    - Call `POST /api/domains/verify` to confirm DNS setup; DNS changes can\n      take a few minutes to propagate\n    - Once verified, the domain can send via `/api/email/send`\n    ",
        "operationId": "DomainsController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterDomainDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Domain registered successfully - DNS records returned for configuration",
            "schema": {
              "example": {
                "uuid": "47519fb0-ead8-4a56-94dd-09f095af8be5",
                "domainName": "example.com",
                "verified": true,
                "verificationToken": "1lXizMhoGtBLtyYSw8TZKJMAQtt0PQWF",
                "dnsVerificationString": "postal-verification 1lXizMhoGtBLtyYSw8TZKJMAQtt0PQWF",
                "spfHost": "example.com",
                "spfValue": "v=spf1 ip4:192.0.2.1 ip4:192.0.2.2 ip6:2605:a140:2256:1142::1 ~all",
                "dkimHost": "postal-GyjDIn._domainkey.example.com",
                "dkimValue": "v=DKIM1; t=s; h=sha256; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4rUDR...",
                "rpHost": "psrp.example.com",
                "rpValue": "rp.postal.example.com",
                "mxHost": "example.com",
                "mxValue": "missioninbox.outboxment.com",
                "mxPriority": 10,
                "dmarcHost": "_dmarc.example.com",
                "dmarcValue": "v=DMARC1; p=quarantine; rua=mailto:abuse@example.com; ruf=mailto:abuse@example.com; sp=quarantine; adkim=r; aspf=r; fo=1; ri=864000;",
                "hasDnsManager": true,
                "emailDns": {
                  "pushed": true,
                  "successCount": 5,
                  "failureCount": 0,
                  "verified": true,
                  "statuses": {
                    "spf": "ok",
                    "dkim": "ok",
                    "mx": "ok",
                    "rp": "ok",
                    "dmarc": "ok"
                  }
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDomainResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid domain name or server ID"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Server not authorized for this organization"
          },
          "409": {
            "description": "Conflict - Domain already registered"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Register single domain",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/domains/bulk-create": {
      "post": {
        "description": "\n    Register multiple domains simultaneously, each with its own project.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n    - Projects must exist before referencing them by name\n    - Maximum 50 domains per request recommended\n\n    **Request Body:**\n    - **domains**: Array of domain registration items\n      - **domainName**: Domain name to register (required)\n      - **projectName**: Project name to associate with (optional, must be unique within product)\n\n    **Project Name Resolution:**\n    - Project names are unique within each product\n    - System automatically resolves projectName to projectId\n    - If project doesn't exist, domain creation fails for that item\n    - Each domain can be associated with a different project\n\n    **Process:**\n    1. Validates product-level API key and sending account access\n    2. Creates a background task for asynchronous processing\n    3. Returns task ID immediately for progress monitoring\n    4. Task processes each domain sequentially with rate limiting\n    5. For each domain, resolves project name to project ID\n    6. Creates domain with its specific project\n    7. Pushes each domain's DNS records automatically when a connected DNS\n       provider key manages it, exactly as `POST /api/domains/create` does\n       (each item in the task result carries `hasDnsManager` and `emailDns`)\n    8. Sends real-time progress updates via Server-Sent Events (SSE)\n\n    **Task Processing:**\n    - Domains are processed sequentially to avoid API rate limits\n    - 1-second delay between domain creations\n    - Partial success is possible (some domains may succeed, others fail)\n    - Failed domains are logged and reported in final results\n    - Task can be retried if it fails completely\n\n    **Task Monitoring:**\n    - Poll `GET /api/tasks/{taskId}` to monitor progress\n    - Or subscribe to `GET /api/tasks/{taskId}/events` (Server-Sent Events)\n    - Task results include successful domains with DNS records\n    - Final task result includes all domain creation outcomes\n\n    **DNS Configuration:**\n    - Each successfully created domain includes SPF, DKIM, Return Path, MX, and DMARC DNS records\n    - Configure all returned DNS records before verification\n    - Use domain verification endpoint to confirm DNS setup\n    ",
        "operationId": "DomainsController_bulkCreate",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkRegisterDomainsDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Bulk domain creation task created successfully - use taskId to monitor progress",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskCreateResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid domain names or sending account ID format"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Sending account not authorized for this organization"
          },
          "422": {
            "description": "Unprocessable entity - Sending account not found or domain creation failed"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Bulk register multiple domains with individual project assignments",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/domains/bulk-verify": {
      "post": {
        "description": "\n    Verify DNS configuration for multiple domains efficiently.\n    \n    **Prerequisites:**\n    - All domains must be registered and owned by the organization\n    - DNS records must be configured for all domains\n    - Customer user must be authenticated\n    \n    **Bulk Verification Benefits:**\n    - Efficient verification of multiple domains\n    - Reduced API calls and faster processing\n    - Atomic verification results for all domains\n    \n    **Process:**\n    1. Validates all domains belong to the organization\n    2. Performs DNS verification for each domain\n    3. Updates verification status for all domains\n    4. Returns consolidated verification results\n    \n    **Response:**\n    - Array of domain objects with updated verification status\n    - Individual verification status for each domain\n    - Detailed DNS configuration results\n    ",
        "operationId": "DomainsController_bulkVerifyDomain",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkVerifyDomainsDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Bulk domain verification task created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskCreateResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid domain list or format"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - One or more domains not owned by organization"
          },
          "404": {
            "description": "Not found - One or more domains not registered"
          },
          "422": {
            "description": "Unprocessable entity - DNS records not properly configured for some domains"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Bulk verify multiple domains",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/domains/bulk-delete": {
      "post": {
        "description": "\n    Delete multiple domains simultaneously using a background task.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n    - All domains must exist and belong to the organization\n\n    **Request Body:**\n    - **domainNames**: Array of domain names to delete\n\n    **Cascade Delete:**\n    - All mailboxes associated with each domain will be automatically deleted\n    - This is a permanent operation and cannot be undone\n\n    **Process:**\n    1. Validates product-level API key and sending account access\n    2. Creates a background task for asynchronous processing\n    3. Returns task ID immediately for progress monitoring\n    4. Task processes each domain sequentially\n    5. For each domain, deletes all associated mailboxes first\n    6. Deletes domain from OBM server\n    7. Deletes domain from local database\n    8. Sends real-time progress updates via Server-Sent Events (SSE)\n\n    **Task Processing:**\n    - Domains are processed sequentially to ensure data consistency\n    - 1-second delay between domain deletions\n    - Partial success is possible (some domains may succeed, others fail)\n    - Failed deletions are logged and reported in final results\n\n    **Task Monitoring:**\n    - Poll `GET /api/tasks/{taskId}` to monitor progress\n    - Or subscribe to `GET /api/tasks/{taskId}/events` (Server-Sent Events)\n    - Task results include deleted domains and mailbox counts\n    - Final task result includes all domain deletion outcomes\n    ",
        "operationId": "DomainsController_bulkDeleteDomains",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkDeleteDomainsDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Bulk domain deletion task created successfully - use taskId to monitor progress",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskCreateResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid domain names format"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Sending account not authorized for this organization"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Bulk delete multiple domains",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/domains/verify": {
      "post": {
        "description": "\n    Verify that DNS records for a domain have been properly configured on the Postal server.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n    - Domain must exist on the postal server\n    - DNS records must be configured as returned during domain creation\n\n    **Request Body:**\n    - **domainName**: Domain name to verify (e.g., \"example.com\")\n\n    **Verification Process:**\n    1. Validates product-level API key and sending account access\n    2. Calls Postal API to check DNS record configuration\n    3. Verifies SPF, DKIM, and return path records individually\n    4. Returns detailed verification results for each DNS record\n    \n    **DNS Records Verified:**\n    - **SPF**: Sender policy framework record validation\n    - **DKIM**: Domain key identification signature verification\n    - **Return Path**: Return path record configuration check\n\n    **Post-Verification:**\n    - Fully verified domains can be used for email sending\n    - Partial verification helps identify specific DNS configuration issues\n    ",
        "operationId": "DomainsController_verifyDomain",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyDomainDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Domain verification completed - detailed DNS checks returned",
            "schema": {
              "example": {
                "message": "We couldn't verify your domain. Please double check you've added the TXT record correctly.",
                "dnsVerificationString": "postal-verification 1lXizMhoGtBLtyYSw8TZKJMAQtt0PQWF",
                "dnsChecks": {
                  "spf": {
                    "status": "Missing",
                    "error": "No SPF record exists for this domain"
                  },
                  "dkim": {
                    "status": "Missing",
                    "error": "No TXT records were returned for mi-l8nFbS._domainkey.example.com"
                  },
                  "return_path": {
                    "status": "Missing",
                    "error": "There is no return path record at bounce.example.com"
                  },
                  "mx": {
                    "status": "Missing",
                    "error": "There are no MX records for example.com"
                  },
                  "dmarc": {
                    "status": "OK",
                    "error": null
                  }
                },
                "code": "VerificationFailed",
                "fullyVerified": false
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainVerificationResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid domain name or sending account ID format"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Sending account not authorized for this organization"
          },
          "404": {
            "description": "Not found - Domain not found on the server"
          },
          "422": {
            "description": "Unprocessable entity - Sending account not found or DNS verification failed"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Verify domain DNS configuration",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/domains/push-dns": {
      "post": {
        "description": "\n    Writes a domain's email DNS records to its DNS provider, using a DNS\n    provider key you connected with `POST /api/dns-credentials`, then runs a\n    verification so the domain's DNS statuses are current.\n\n    Domains added while a key is connected are pushed automatically at\n    creation; call this to push again (after connecting a key for a domain you\n    added earlier, or if records were changed or removed at the provider).\n    For many domains at once use `POST /api/domains/bulk-push-dns`.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n    - Domain must exist and belong to the authenticated product\n    - An active DNS provider key for the provider that hosts the domain's DNS\n      (Cloudflare, GoDaddy, Porkbun, Spaceship, Dynadot or Vercel)\n\n    **Request Body:**\n    - **domainName** (required): Domain name to push DNS records for\n\n    **Process:**\n    1. Reads the records the domain needs from its mail server\n    2. Finds which of your connected keys manages the domain, from its live\n       nameservers\n    3. Creates or updates each record at that provider (existing records with\n       the same name and type are replaced; other records are left alone)\n    4. Triggers verification\n    5. Returns every record with its own result\n\n    **DNS Records:**\n    - SPF: Sender policy framework record\n    - DKIM: DomainKeys Identified Mail signature\n    - Return Path: Bounce handling configuration\n    - MX: Mail exchange record\n    - DMARC: Domain-based Message Authentication\n\n    **Partial success:** each record is pushed on its own, so a 200 can carry\n    failed records. Check `results[].success` and `results[].error`.\n    ",
        "operationId": "DomainsController_pushDnsRecords",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PushDnsRecordsDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "DNS records pushed; per-record results in `results`",
            "schema": {
              "example": {
                "domainName": "example.com",
                "message": "Successfully pushed 5 DNS records for example.com via Cloudflare.",
                "dnsRecords": [
                  {
                    "type": "TXT",
                    "name": "example.com",
                    "value": "v=spf1 include:spf.cobalt.obmengine.com ~all",
                    "purpose": "spf"
                  },
                  {
                    "type": "TXT",
                    "name": "mi-l8nFbS._domainkey.example.com",
                    "shortName": "mi-l8nFbS._domainkey",
                    "value": "v=DKIM1; t=s; h=sha256; p=MIGfMA0GCSqGSIb3DQEBAQUAA...",
                    "purpose": "dkim"
                  },
                  {
                    "type": "CNAME",
                    "name": "bounce.example.com",
                    "shortName": "bounce",
                    "value": "rp.cobalt.obmengine.com",
                    "purpose": "return_path"
                  },
                  {
                    "type": "MX",
                    "name": "example.com",
                    "value": "staging.outboxment.com",
                    "priority": 10,
                    "purpose": "mx"
                  },
                  {
                    "type": "TXT",
                    "name": "_dmarc.example.com",
                    "value": "v=DMARC1; p=quarantine; rua=mailto:abuse@example.com;",
                    "purpose": "dmarc"
                  }
                ]
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PushDnsRecordsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Failed to fetch DNS records from OBM server"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Domain not owned by organization"
          },
          "404": {
            "description": "Not found - Domain not found"
          },
          "422": {
            "description": "Unprocessable entity - No active DNS provider key is connected, or none of the connected keys manages this domain"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Push DNS records for a domain",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/domains/bulk-push-dns": {
      "post": {
        "description": "\n    Push DNS records to DNS provider for multiple domains simultaneously using a background task.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n    - All domains must exist and belong to the organization\n    - A DNS provider key must be connected with `POST /api/dns-credentials` (Cloudflare, GoDaddy, Porkbun, Spaceship, Dynadot or Vercel)\n\n    **Request Body:**\n    - **domainNames**: Array of domain names to push DNS records for\n\n    **Process:**\n    1. Validates product-level API key and sending account access\n    2. Creates a background task for asynchronous processing\n    3. Returns task ID immediately for progress monitoring\n    4. Task processes each domain sequentially with rate limiting\n    5. For each domain:\n       - Fetches DNS records from OBM (Postal) server\n       - Identifies the DNS provider managing the domain\n       - Pushes DNS records to the provider (Cloudflare, GoDaddy, Porkbun, Spaceship, Dynadot or Vercel)\n       - Triggers domain verification to update status\n    6. Sends real-time progress updates via Server-Sent Events (SSE)\n\n    **Task Processing:**\n    - Domains are processed sequentially to avoid API rate limits\n    - 1-second delay between domain processing\n    - Partial success is possible (some domains may succeed, others fail)\n    - Failed domains are logged and reported in final results\n\n    **Task Monitoring:**\n    - Poll `GET /api/tasks/{taskId}` to monitor progress\n    - Or subscribe to `GET /api/tasks/{taskId}/events` (Server-Sent Events)\n    - Task results include pushed records count per domain\n    - Final task result includes all domain push outcomes\n\n    **DNS Provider Detection:**\n    - System automatically detects DNS provider via NS record lookup\n    - Supported providers: Cloudflare, GoDaddy, Porkbun, Spaceship, Dynadot, Vercel\n    - Domain must be accessible by one of the configured credentials\n    ",
        "operationId": "DomainsController_bulkPushDnsRecords",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkPushDnsRecordsDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Bulk DNS push task created successfully - use taskId to monitor progress",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskCreateResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid domain names format"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Sending account not authorized for this organization"
          },
          "422": {
            "description": "Unprocessable entity - No DNS provider credentials found or configured"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Bulk push DNS records for multiple domains",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/domains/repush": {
      "post": {
        "description": "\n    Deletes a domain from the OBM server and immediately re-creates it, applying\n    the current org product config (custom DMARC, custom MX). No database records\n    are modified and no MI-Events are fired — this is an OBM-level sync operation.\n\n    **Use cases:**\n    - Apply a newly configured custom DMARC record to an existing domain\n    - Recover a domain that is out of sync with OBM without losing mailbox data\n\n    **What happens:**\n    1. Domain is deleted from Postal/OBM\n    2. Domain is re-created in Postal/OBM with:\n       - Current custom DMARC (if configured on the org product)\n       - Existing active DKIM key (reused to avoid DNS DKIM record churn)\n       - Current custom MX host (if configured)\n    3. Postal inbound wildcard route is re-created\n    4. All email DNS records are re-pushed to the DNS provider (if DNS manager available)\n\n    **What is NOT affected:**\n    - Domain record in our database\n    - Mailboxes\n    - MI billing events\n      ",
        "operationId": "DomainsController_repushDomain",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RepushDomainDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Domain successfully repushed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepushDomainResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request — missing product ID, or OBM delete/create failed"
          },
          "401": {
            "description": "Unauthorized — invalid or missing authentication credentials"
          },
          "403": {
            "description": "Forbidden — domain does not belong to your organization"
          },
          "404": {
            "description": "Not Found — domain not found in the database"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Force-repush a domain through OBM",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/domains/bulk-repush": {
      "post": {
        "description": "\n    Starts a background task that performs the force-repush operation on multiple\n    domains sequentially. Each domain is deleted from OBM and immediately re-created\n    with the current org product config (custom DMARC, custom MX, existing DKIM key).\n\n    Returns a task ID to monitor progress via the tasks SSE endpoint.\n      ",
        "operationId": "DomainsController_bulkRepushDomains",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkRepushDomainsDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Bulk repush task started",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskCreateResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request — missing product ID or empty domain list"
          },
          "401": {
            "description": "Unauthorized — invalid or missing authentication credentials"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Bulk force-repush domains through OBM (async task)",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/domains/by-id/{id}": {
      "get": {
        "description": "\n    Fetch detailed information about a specific domain using its UUID.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n    - Domain must exist and belong to the authenticated product\n\n    **Path Parameters:**\n    - **id** (required): Domain UUID\n\n    **Returns:**\n    - Complete domain information from the database\n    - DNS status for all records (SPF, DKIM, Return Path, MX, DMARC)\n    - Project association information\n    - Warmup information (status, days warmed, etc.)\n    - Mailbox count and email statistics\n    - Timestamps (created, updated)\n\n    **Multi-tenant Isolation:**\n    - Automatically filters by organization product ID\n    - Returns 404 if domain exists but belongs to a different product\n\n    **Use Cases:**\n    - Quick domain lookup by known UUID\n    - Fetch domain details for dashboard display\n    - Retrieve domain information for API integrations\n    - Check domain configuration status\n    - Monitor warmup progress\n    ",
        "operationId": "DomainsController_getDomainById",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Domain UUID",
            "schema": {
              "example": "6a84bf23-825d-464f-8aa2-4ee218ecde93",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Domain details retrieved successfully",
            "schema": {
              "example": {
                "id": "6a84bf23-825d-464f-8aa2-4ee218ecde93",
                "domainName": "example.com",
                "verified": false,
                "spfStatus": "Missing",
                "dkimStatus": "Missing",
                "returnPathStatus": "Missing",
                "mxStatus": "OK",
                "dmarcStatus": "OK",
                "projectId": "b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a",
                "projectName": "Q1 Campaign",
                "warmupStartDate": "2025-12-18T00:00:00Z",
                "warmedDays": 5,
                "totalWarmedDays": 5,
                "isWarmupActive": true,
                "emailSent": 125,
                "mailboxCount": 3,
                "createdAt": "2025-12-23T05:50:35.579Z",
                "updatedAt": "2025-12-23T06:09:37.150Z"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid domain ID format or organization product ID is required"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Domain not owned by organization"
          },
          "404": {
            "description": "Not found - Domain not found"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get domain by ID",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/domains/{domainName}/admin-mailboxes": {
      "get": {
        "description": "Returns the admin/abuse/postmaster mailbox addresses for the domain and the shared password used to log into them. The password may be null for domains provisioned before admin mailboxes were introduced.",
        "operationId": "DomainsController_getDomainAdminMailboxes",
        "parameters": [
          {
            "name": "domainName",
            "required": true,
            "in": "path",
            "description": "Domain name to get admin mailbox credentials for",
            "schema": {
              "example": "example.com",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Admin mailbox credentials for the domain",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainAdminMailboxesResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Organization product ID is required"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Domain not owned by organization"
          },
          "404": {
            "description": "Not found - Domain not found"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get admin mailbox credentials for a domain",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/domains/{domainName}": {
      "get": {
        "description": "\n    Retrieve DNS records and domain information with automatic status sync.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n    - Domain must exist in the database (created via POST /api/domains/create)\n\n    **Path Parameters:**\n    - **domainName** (required): Domain name to get DNS records for\n\n    **Automatic Status Update:**\n    - Fetches current DNS records from Postal server\n    - Updates domain status in database automatically\n    - Syncs SPF, DKIM, Return Path, MX, and DMARC status\n\n    **Response Fields:**\n    - **Domain Information**: ID, name, project, status fields, warmup info, timestamps\n    - **dnsRecords**: DNS records the customer needs to publish on their own domain\n      (SPF, DKIM s1, DKIM s2, MX, DMARC, and Return Path unless the sending account has\n      optionalReturnPathCheck enabled)\n    - **platformRecords**: Platform-side records (\"_target\" purposes) Postal expects at its\n      own CNAME/SPF-include targets, on the platform's own zone -- not for the customer to\n      publish; pushed there on the backend instead\n    - Each DNS record includes type, name, value, and purpose\n\n    **Use Cases:**\n    - Domain configuration setup\n    - DNS record verification\n    - Status monitoring and sync\n    - Email deliverability troubleshooting\n    ",
        "operationId": "DomainsController_getDnsRecords",
        "parameters": [
          {
            "name": "domainName",
            "required": true,
            "in": "path",
            "description": "Domain name to get DNS records for",
            "schema": {
              "example": "example.com",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "DNS records and domain status retrieved successfully",
            "schema": {
              "example": {
                "id": "6a84bf23-825d-464f-8aa2-4ee218ecde93",
                "name": "guten.accesslended.co",
                "projectId": "b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a",
                "projectName": "MI transaction",
                "spfStatus": "Missing",
                "dkimStatus": "Missing",
                "rpStatus": "Missing",
                "mxStatus": "Missing",
                "dmarcStatus": "OK",
                "warmupStartDate": null,
                "warmedDays": 0,
                "totalWarmedDays": 0,
                "isWarmupActive": false,
                "createdAt": "2025-12-23T05:50:35.579Z",
                "updatedAt": "2025-12-23T06:09:37.150Z",
                "dnsRecords": [
                  {
                    "type": "TXT",
                    "name": "guten.accesslended.co",
                    "value": "v=spf1 include:sserhq7.p7mn8r4.oxygen.simpliemail.com -all",
                    "purpose": "spf"
                  },
                  {
                    "type": "CNAME",
                    "name": "s1._domainkey.guten.accesslended.co",
                    "shortName": "s1._domainkey",
                    "value": "s1._domainkey.sserhq7.oxygen.simpliemail.com",
                    "purpose": "dkim_s1"
                  },
                  {
                    "type": "CNAME",
                    "name": "s2._domainkey.guten.accesslended.co",
                    "shortName": "s2._domainkey",
                    "value": "s2._domainkey.sserhq7.oxygen.simpliemail.com",
                    "purpose": "dkim_s2"
                  },
                  {
                    "type": "CNAME",
                    "name": "rp.guten.accesslended.co",
                    "shortName": "rp",
                    "value": "oxygen.simpliemail.com",
                    "purpose": "return_path"
                  },
                  {
                    "type": "MX",
                    "name": "guten.accesslended.co",
                    "value": "staging.outboxment.com",
                    "priority": 10,
                    "purpose": "mx"
                  },
                  {
                    "type": "TXT",
                    "name": "_dmarc.guten.accesslended.co",
                    "value": "v=DMARC1; p=quarantine; rua=mailto:abuse@guten.accesslended.co; ruf=mailto:abuse@guten.accesslended.co; sp=quarantine; adkim=r; aspf=r; fo=1; ri=864000;",
                    "purpose": "dmarc"
                  }
                ],
                "platformRecords": [
                  {
                    "type": "TXT",
                    "name": "sserhq7.p7mn8r4.oxygen.simpliemail.com",
                    "value": "v=spf1 ip4:91.103.141.99 -all",
                    "purpose": "spf_target"
                  },
                  {
                    "type": "TXT",
                    "name": "s1._domainkey.sserhq7.oxygen.simpliemail.com",
                    "value": "v=DKIM1; t=s; h=sha256; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuA8zh1tHFhh3CJgmA/tJ6zWtNqj3WYTNgOv9PUzXWO1PG2u7rkaCDkz8E0GbjteqsimhJ7akk7JFeelT5wz5v0UW34/nIgE6YjBq9SG9WbvE7DVpf0nS6DzSvp8b+/mr8DRwYIIDZv/nJmIHqTNb9nt4hITGDypp9YxQugCDkQRc/9qrc792IT3YuK18W7Oyzh7O5OpMTRl9cuASrZhV1aaHusVTz0N5sYw6Vog6lss77wIJzngZtlnpEATEdJUywQgXEbkintA6K99txE+/hWyXUSbbDsQ0eXjd6j6gxmhr4qWlrEoV4oFTJnPTD6g23M7CHV/FcxojTTVJya6VzwIDAQAB;",
                    "purpose": "dkim_s1_target"
                  },
                  {
                    "type": "TXT",
                    "name": "s2._domainkey.sserhq7.oxygen.simpliemail.com",
                    "value": "v=DKIM1; t=s; h=sha256; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAn1cH/LTPh7g2TKDpO/a+rSsmU+JSTQ6i9vOb9rKCERPDw3H+s1FME5x6HmF7+/YOVb2s6OA0o+Ao/GLSCLCW3Uu1C6vyCz93ykdQVzvtaAiaLgABii9A+U4Zi2ObC9VLWkrydKngJbIqEbbwfNQ71nVdrGDegoC09t6JS86dMi4EUcAlQUc5sqxj6mITwu//vBBRmmQFToMTzv/ooqYP6IEOnQDirCpREPqkrLvz6zjAs5Lv61nHQ75sDRMcTez1g+1d2Cu+/OuLK7DZjhjJ7o69K1seT2No6jpMs1I3NSLFKuXTISuxazA5XtYrAGSKQBiECu87USBtQcr+a+SMUwIDAQAB;",
                    "purpose": "dkim_s2_target"
                  }
                ]
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DnsRecordsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid domain name or server ID"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Server not authorized for this organization"
          },
          "404": {
            "description": "Not found - Domain not found on the server"
          },
          "422": {
            "description": "Unprocessable entity - Unable to retrieve DNS records"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get DNS records and domain status",
        "tags": [
          "Domain Management"
        ]
      },
      "patch": {
        "description": "\n    Set open tracking, click tracking and the tracking subdomain for one\n    sending domain. Transactional only.\n\n    **How a send decides what to track**\n    1. `track_opens` / `track_clicks` on the send request, if given.\n    2. This domain's own `open_tracking` / `click_tracking`, if not null.\n    3. The account default under Settings, Tracking.\n    4. Off.\n\n    Send `null` for either switch to hand that decision back to the account\n    default, and leave a field out entirely to change nothing.\n\n    **The tracking subdomain**\n    Give a label such as `links`, or the whole hostname\n    `links.yourdomain.com`. It must sit under this domain, cannot be the\n    domain itself, cannot be `www`, and cannot be a name already carrying\n    this domain's mail records. Publish the returned CNAME, set to DNS only,\n    and verification and the certificate happen on their own.\n\n    It can be changed but never removed. A hostname that was live keeps\n    serving, so links in mail already sent keep working, for as long as its\n    CNAME stays published. Deleting the sending domain is the only thing that\n    takes them all down.\n  ",
        "operationId": "DomainsController_updateDomain",
        "parameters": [
          {
            "name": "domainName",
            "required": true,
            "in": "path",
            "description": "A sending domain you have already added",
            "schema": {
              "example": "yourdomain.com",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDomainDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The domain’s tracking as it now stands",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainTrackingDto"
                }
              }
            }
          },
          "400": {
            "description": "The hostname was refused, or this is a Sales product"
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "404": {
            "description": "No such sending domain on this account"
          },
          "429": {
            "description": "A change cap or the certificate authority’s weekly limit was reached"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Change a domain’s tracking",
        "tags": [
          "Domain Management"
        ]
      },
      "delete": {
        "description": "\n    Delete a domain from both the OBM server and the database.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n    - Domain must exist and belong to the authenticated product\n\n    **Path Parameters:**\n    - **domainName** (required): Domain name to delete\n\n    **Process:**\n    1. Validates product-level API key and sending account access\n    2. Verifies domain exists and belongs to the authenticated product\n    3. Deletes domain from OBM (Postal) server\n    4. Removes domain record from database\n\n    **Warning:**\n    - This action is irreversible\n    - Associated mailboxes may be affected\n    - DNS records will no longer be valid for this domain\n    ",
        "operationId": "DomainsController_deleteDomain",
        "parameters": [
          {
            "name": "domainName",
            "required": true,
            "in": "path",
            "description": "Domain name to delete",
            "schema": {
              "example": "example.com",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Domain deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Domain example.com deleted successfully"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Failed to delete domain from OBM server"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Domain not owned by organization"
          },
          "404": {
            "description": "Not found - Domain not found"
          },
          "409": {
            "description": "Conflict - Domain has associated mailboxes that must be deleted first; or a nameserver change is running on the domain; or the domain is being moved back to its earlier nameservers first ('We are moving this domain back first. Delete it again in a few minutes.'), which happens when a Move back of the domain is already queued or running, when setting them back takes longer than 20 seconds, or when another delete of the same domain is doing it; or the move back could not be queued because another one was being queued at that moment ('This domain is moving now. Try again in a few minutes.'); or the domain was already moved back but the registry does not show its earlier nameservers yet, and sending them once more did not get a clear yes ('We are moving this domain back first. This can take up to three days; delete it again later.'); or its earlier DNS host no longer has the domain (code DELETE_OLD_HOST_GONE), so it stays on its own nameservers; or the records listed under records have to be added at its earlier DNS host first, because we cannot update it there (code DELETE_OLD_PROVIDER_NOT_UPDATED). Nothing was deleted; delete it again later"
          },
          "503": {
            "description": "Service unavailable - the domain's earlier nameservers could not be set back first, so nothing was deleted: the registrar refused or was busy, or its answer was unclear, so the change may not have been made (\"This domain's earlier nameservers could not be set back right now, so it was not deleted. Try again in a few minutes.\"). The delete goes ahead only once the registrar has accepted the change or the registry shows the earlier nameservers; try again in a few minutes"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Delete a domain",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/domains/{domainName}/registration-info/refresh": {
      "post": {
        "description": "Re-collects public registration metadata (DNS provider, name servers, registrar, registration date, age, expiry) for a Transactional sending domain and returns the refreshed block. Best-effort: fields the registry redacts or the lookup misses come back empty.",
        "operationId": "DomainsController_refreshRegistrationInfo",
        "parameters": [
          {
            "name": "domainName",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "The refreshed registration metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainRegistrationInfoDto"
                }
              }
            }
          }
        },
        "summary": "Refresh a domain’s registration metadata",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/domains/{domainName}/tracking": {
      "get": {
        "description": "\n    This domain's tracking on its own: the hostname and how far along it is,\n    the record to publish, the two switches at every level, and the hostnames\n    it has retired. The same block rides on the domain detail response; this\n    route is the cheap one to poll while a hostname is being set up.\n  ",
        "operationId": "DomainsController_getDomainTracking",
        "parameters": [
          {
            "name": "domainName",
            "required": true,
            "in": "path",
            "description": "A sending domain you have already added",
            "schema": {
              "example": "yourdomain.com",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The domain’s tracking as it stands",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainTrackingDto"
                }
              }
            }
          },
          "400": {
            "description": "This is a Sales product"
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "404": {
            "description": "No such sending domain, or no tracking hostname configured on it"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Read a domain’s tracking",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/domains/{domainName}/tracking/verify": {
      "post": {
        "description": "\n    Read the tracking CNAME again immediately rather than waiting for the next\n    scheduled check. Limited to one every ten seconds per account, shared with\n    publishing.\n  ",
        "operationId": "DomainsController_verifyDomainTracking",
        "parameters": [
          {
            "name": "domainName",
            "required": true,
            "in": "path",
            "description": "A sending domain you have already added",
            "schema": {
              "example": "yourdomain.com",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "What the check found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainTrackingDto"
                }
              }
            }
          },
          "400": {
            "description": "This is a Sales product"
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "404": {
            "description": "No such sending domain, or no tracking hostname configured on it"
          },
          "429": {
            "description": "Checking and publishing are limited to one every ten seconds"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Check a domain’s tracking record now",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/domains/{domainName}/tracking/push-dns": {
      "post": {
        "description": "\n    Publish the tracking CNAME through a DNS provider you have connected, then\n    check it. Available when `tracking.canPushDns` is true. The record is\n    published as DNS only, never proxied, because a proxied record hides it and\n    breaks both the check and the certificate.\n  ",
        "operationId": "DomainsController_pushDomainTrackingDns",
        "parameters": [
          {
            "name": "domainName",
            "required": true,
            "in": "path",
            "description": "A sending domain you have already added",
            "schema": {
              "example": "yourdomain.com",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Whether the record was published, and the tracking that follows",
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "pushed": true,
                    "provider": "cloudflare",
                    "error": null,
                    "tracking": {
                      "hostname": "links.yourdomain.com",
                      "status": "pending_dns"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "This is a Sales product"
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "404": {
            "description": "No such sending domain, or no tracking hostname configured on it"
          },
          "429": {
            "description": "Checking and publishing are limited to one every ten seconds"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Publish a domain’s tracking record",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/domains/{domainName}/dns": {
      "delete": {
        "description": "\n    Removes all DNS records that were pushed by MissionInbox for this domain from the\n    connected DNS provider (Cloudflare, GoDaddy, Porkbun, Spaceship, Dynadot or Vercel).\n\n    **Prerequisites:**\n    - Domain must belong to the caller's organization product (403 otherwise)\n    - A DNS provider API key must be connected and active\n    - The DNS provider must have access to the domain's root zone\n\n    **Records removed:**\n    - **DKIM TXT**: Any record matching `(mi|postal)-*._domainkey.{domain}` — catches\n      the current DKIM key and any previously rotated keys\n    - **SPF TXT**: The TXT record at the domain root whose value exactly matches what\n      Postal currently has on file\n    - **DMARC TXT**: The TXT record at `_dmarc.{domain}` matching Postal's value\n    - **Return-Path CNAME**: The CNAME at `bounce.{domain}` matching Postal's value\n    - **MX records**: MX records at the domain root matching Postal's values\n\n    Records not recognised as MissionInbox-managed (e.g. an unrelated TXT record at\n    the same hostname) are left untouched.\n  ",
        "operationId": "DomainsController_cleanDnsRecords",
        "parameters": [
          {
            "name": "domainName",
            "required": true,
            "in": "path",
            "description": "Domain name to clean DNS records for",
            "schema": {
              "example": "hong.fastmissioninbox.com",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Clean operation completed. Check per-record results for individual outcomes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CleanDnsRecordsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — missing organization product ID, Postal lookup failed, or the domain is leased or managed by Mission Inbox"
          },
          "401": {
            "description": "Unauthorized — invalid or missing authentication credentials"
          },
          "403": {
            "description": "Forbidden — domain does not belong to your organization"
          },
          "422": {
            "description": "Unprocessable — no active DNS provider credentials found, or provider not detected"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Clean MissionInbox DNS records for a domain",
        "tags": [
          "Domain Management"
        ]
      }
    },
    "/api/transactional/tracking-domain": {
      "get": {
        "deprecated": true,
        "description": "\n    **Deprecated.** Use the per-domain routes instead: `GET /api/domains/:domainName/tracking`,\n    `PATCH /api/domains/:domainName`, and `POST /api/domains/:domainName/tracking/verify` and\n    `/tracking/push-dns`.\n\n    The tracking hostname for this account, the record to publish, and how far\n    along it is. `hostname` is null when none is configured.\n\n    **Your own tracking domain.** With open or click tracking on, the pixel and\n    the rewritten links in your HTML carry a Mission Inbox hostname by default.\n    Set a tracking hostname here and they carry yours instead, so the links\n    your readers see, and the domain their mail provider judges them by, are\n    your own.\n\n    **One record.** Publish a CNAME from a subdomain of a domain you already\n    send from -- `track.yourdomain.com` is the usual choice -- to the target\n    in `cnameTarget`. It must be **DNS only**: a proxied record, the orange\n    cloud in Cloudflare, hides the record and breaks both the check and the\n    certificate.\n\n    **Nothing is used until it is proven.** The hostname moves from\n    `pending_dns` to `provisioning_tls` once the record is right, and to\n    `active` only after a real HTTPS request to your hostname has returned\n    the tracking pixel over a valid certificate. Until then, and any time it\n    stops answering, sends fall back to the Mission Inbox hostname. A problem\n    here never blocks or delays a send.\n\n    **Mail already sent keeps the host it was sent with.** Removing or changing\n    a hostname stops the links in messages already delivered on it from working.\n\n    ",
        "operationId": "TransactionalTrackingDomainsController_get",
        "parameters": [],
        "responses": {
          "200": {
            "description": "The tracking domain, or nulls when none is configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackingDomainResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get the tracking domain",
        "tags": [
          "Transactional Tracking Domain"
        ]
      },
      "put": {
        "deprecated": true,
        "description": "\n    **Deprecated.** Use the per-domain routes instead: `GET /api/domains/:domainName/tracking`,\n    `PATCH /api/domains/:domainName`, and `POST /api/domains/:domainName/tracking/verify` and\n    `/tracking/push-dns`.\n\n    Set or replace the tracking hostname. The DNS is checked immediately, so\n    the response already says whether the record is there.\n\n    The hostname must be a subdomain of a domain this account sends from. It\n    cannot be the domain itself, since a CNAME cannot sit at a zone apex; it\n    cannot be `www`; and it cannot be a name that already carries the mail\n    records for that domain, because a CNAME there would replace them.\n\n    Replacing a hostname takes the old one out of service, so links in mail\n    already sent through it stop working.\n\n    **Your own tracking domain.** With open or click tracking on, the pixel and\n    the rewritten links in your HTML carry a Mission Inbox hostname by default.\n    Set a tracking hostname here and they carry yours instead, so the links\n    your readers see, and the domain their mail provider judges them by, are\n    your own.\n\n    **One record.** Publish a CNAME from a subdomain of a domain you already\n    send from -- `track.yourdomain.com` is the usual choice -- to the target\n    in `cnameTarget`. It must be **DNS only**: a proxied record, the orange\n    cloud in Cloudflare, hides the record and breaks both the check and the\n    certificate.\n\n    **Nothing is used until it is proven.** The hostname moves from\n    `pending_dns` to `provisioning_tls` once the record is right, and to\n    `active` only after a real HTTPS request to your hostname has returned\n    the tracking pixel over a valid certificate. Until then, and any time it\n    stops answering, sends fall back to the Mission Inbox hostname. A problem\n    here never blocks or delays a send.\n\n    **Mail already sent keeps the host it was sent with.** Removing or changing\n    a hostname stops the links in messages already delivered on it from working.\n\n    ",
        "operationId": "TransactionalTrackingDomainsController_set",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetTrackingDomainDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tracking domain after the change",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackingDomainResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "The hostname is not usable, and the message says why"
          },
          "401": {
            "description": ""
          },
          "403": {
            "description": ""
          },
          "409": {
            "description": "That hostname is already in use for tracking by another account"
          },
          "429": {
            "description": "A tracking hostname can only be set or changed three times in 24 hours"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Set the tracking domain",
        "tags": [
          "Transactional Tracking Domain"
        ]
      }
    },
    "/api/transactional/tracking-domain/verify": {
      "post": {
        "deprecated": true,
        "description": "\n    **Deprecated.** Use the per-domain routes instead: `GET /api/domains/:domainName/tracking`,\n    `PATCH /api/domains/:domainName`, and `POST /api/domains/:domainName/tracking/verify` and\n    `/tracking/push-dns`.\n\n    Look the record up again straight away rather than waiting for the next\n    automatic check. The hostname's own nameservers are asked directly, so a\n    record published a moment ago is seen immediately rather than through a\n    cached negative answer.\n\n    Once the record is right this also advances the certificate and, when\n    there is one, makes a real request to the hostname before reporting it\n    active.\n\n    Limited to one check every ten seconds per account, shared with publishing\n    the record.\n    ",
        "operationId": "TransactionalTrackingDomainsController_verify",
        "parameters": [],
        "responses": {
          "200": {
            "description": "The tracking domain after the check",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackingDomainResponseDto"
                }
              }
            }
          },
          "400": {
            "description": ""
          },
          "401": {
            "description": ""
          },
          "403": {
            "description": ""
          },
          "404": {
            "description": "No tracking hostname is configured for this account"
          },
          "429": {
            "description": "Checking and publishing are limited to one every ten seconds"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Check the tracking domain now",
        "tags": [
          "Transactional Tracking Domain"
        ]
      }
    },
    "/api/transactional/tracking-domain/push-dns": {
      "post": {
        "deprecated": true,
        "description": "\n    **Deprecated.** Use the per-domain routes instead: `GET /api/domains/:domainName/tracking`,\n    `PATCH /api/domains/:domainName`, and `POST /api/domains/:domainName/tracking/verify` and\n    `/tracking/push-dns`.\n\n    Publish the CNAME through the DNS provider connected for this domain, so\n    the record does not have to be added by hand. Available only when\n    `canPushDns` is true.\n\n    The record is published unproxied. A proxied record hides the CNAME and\n    breaks both the check and the certificate.\n\n    The record is checked immediately afterwards. Limited to one call every ten\n    seconds per account, shared with the check endpoint.\n    ",
        "operationId": "TransactionalTrackingDomainsController_pushDns",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Whether the record was published, and the current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackingDomainPushDnsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": ""
          },
          "401": {
            "description": ""
          },
          "403": {
            "description": ""
          },
          "404": {
            "description": "No tracking hostname is configured for this account"
          },
          "429": {
            "description": "Checking and publishing are limited to one every ten seconds"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Publish the tracking record",
        "tags": [
          "Transactional Tracking Domain"
        ]
      }
    },
    "/api/transactional/settings": {
      "get": {
        "description": "\n    The account-wide defaults for the Transactional product.\n\n    **Open and click tracking.** When click tracking is on, every http or\n    https link in the HTML part of a send is rewritten to pass through the\n    tracking domain, which records the click and immediately sends the reader\n    on to the original address. When open tracking is on, a one-pixel image is\n    added to the HTML part and loading it records an open. Plain-text parts\n    are never changed, and a plain-text-only send is never tracked.\n\n    Both default to **off**. Turn them on here for every send made through\n    the send API, and use `track_opens` and `track_clicks` on an individual\n    send to override the default either way -- keep them off on password\n    resets, verification codes and receipts. A single link opts out with a\n    `data-no-track` attribute on its anchor tag.\n\n    **Mail submitted over SMTP is not tracked.** The relay hands your message\n    to us already composed and passes it on byte for byte, so there is\n    nothing for these settings to change. They apply to the send API only.\n\n    Opens are approximate: some mail apps load images before the reader has\n    seen the message, and others never load them at all.\n\n    ",
        "operationId": "TransactionalSettingsController_get",
        "parameters": [],
        "responses": {
          "200": {
            "description": "The current settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionalSettingsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get transactional settings",
        "tags": [
          "Transactional Settings"
        ]
      },
      "put": {
        "description": "\n    Change one or both tracking defaults. Fields left out keep their value.\n\n    **Open and click tracking.** When click tracking is on, every http or\n    https link in the HTML part of a send is rewritten to pass through the\n    tracking domain, which records the click and immediately sends the reader\n    on to the original address. When open tracking is on, a one-pixel image is\n    added to the HTML part and loading it records an open. Plain-text parts\n    are never changed, and a plain-text-only send is never tracked.\n\n    Both default to **off**. Turn them on here for every send made through\n    the send API, and use `track_opens` and `track_clicks` on an individual\n    send to override the default either way -- keep them off on password\n    resets, verification codes and receipts. A single link opts out with a\n    `data-no-track` attribute on its anchor tag.\n\n    **Mail submitted over SMTP is not tracked.** The relay hands your message\n    to us already composed and passes it on byte for byte, so there is\n    nothing for these settings to change. They apply to the send API only.\n\n    Opens are approximate: some mail apps load images before the reader has\n    seen the message, and others never load them at all.\n\n    Changes apply to sends made after the update; mail already sent keeps\n    whatever it went out with.\n    ",
        "operationId": "TransactionalSettingsController_update",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTransactionalSettingsDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The settings after the update",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionalSettingsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Update transactional settings",
        "tags": [
          "Transactional Settings"
        ]
      }
    },
    "/api/tasks": {
      "get": {
        "description": "Lists the background tasks started for your product (bulk domain create, verify, delete and DNS push, mailbox health checks, SEP connects and so on), newest first. Filter by `type` and `status`; paginate with `page` and `limit` (at most 100).",
        "operationId": "TaskController_getTasks",
        "parameters": [
          {
            "name": "type",
            "required": false,
            "in": "query",
            "description": "Filter by task type",
            "schema": {
              "type": "string",
              "enum": [
                "BULK_DOMAIN_CREATE",
                "BULK_DOMAIN_VERIFY",
                "BULK_DOMAIN_DELETE",
                "BULK_MAILBOX_CREATE",
                "BULK_MAILBOX_DELETE",
                "BULK_DNS_PUSH",
                "BULK_WARMUP_TOGGLE",
                "BULK_DOMAIN_WARMUP_TOGGLE",
                "EMAIL_TEST_SEND",
                "EMAIL_HEALTH_CHECK",
                "MAILBOX_HEALTH_CHECK",
                "ORGANIZATION_CACHE_SYNC",
                "ADMIN_BULK_DOMAIN_POSTAL_SYNC",
                "ADMIN_BULK_DNS_PUSH",
                "ADMIN_BULK_DOMAIN_VERIFY",
                "ADMIN_BULK_MOVE_MAILBOXES_TO_WARMUP",
                "ROUTE_SYNC",
                "BULK_CONNECT_INSTANTLY",
                "BULK_CONNECT_SMARTLEAD",
                "BULK_CONNECT_EMAILBISON",
                "WARMY_SYNC_CHECK",
                "WARMY_CACHE_SYNC",
                "BULK_WARMY_RECONNECT",
                "BULK_WARMY_DELETE",
                "BULK_WARMY_RELINK",
                "ADMIN_BULK_WARMUP_PROVIDER_MIGRATE",
                "DOMAIN_WARMY_CACHE_SYNC",
                "ADMIN_BULK_DOMAIN_WARMY_MAILBOX_DELETE",
                "ADMIN_BULK_DOMAIN_WARMY_MAILBOX_RECONNECT",
                "ADMIN_BULK_FIX_ORPHANED_DOMAIN_WARMUP",
                "ADMIN_BULK_MIGRATE_DOMAIN_WARMUP_TO_IPWARMUP",
                "ADMIN_CLEANUP_CANCELLED_SUBSCRIPTION",
                "ADMIN_BULK_WARMUP_MAILBOX_RECONNECT",
                "ADMIN_BULK_DOMAIN_WARMUP_IPWARMUP_SYNC",
                "BULK_DOMAIN_REPUSH",
                "REGISTER_SWITCHED_DOMAINS",
                "ADMIN_DNS_CREDENTIAL_BACKFILL",
                "NAMESERVER_DELEGATION_CHAIN",
                "NAMESERVER_DELEGATION_STUCK_SWEEP",
                "ADMIN_CUBE_MAILBOX_TRANSFER",
                "DOMAIN_REGISTRATION_INFO_COLLECT",
                "ADMIN_CUBE_TRANSFER_SYNC",
                "NAMESERVER_MOVE_BACK",
                "ADMIN_DOMAIN_WARMUP_PROVIDER_MIGRATE",
                "NAMESERVER_PREMOVE_CHECK",
                "DNS_CHANGE_SCAN",
                "ADMIN_DNS_SNAPSHOT_BACKFILL"
              ]
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter by task status",
            "schema": {
              "type": "string",
              "enum": [
                "PENDING",
                "PROCESSING",
                "COMPLETED",
                "FAILED",
                "CANCELLED"
              ]
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number",
            "schema": {
              "minimum": 1,
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Items per page",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of tasks retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskListResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "X-Server-API-Key": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "List tasks",
        "tags": [
          "Task Management"
        ]
      }
    },
    "/api/tasks/{id}": {
      "get": {
        "description": "Returns one task: its `status` (PENDING, PROCESSING, COMPLETED, FAILED or CANCELLED), `progress` (0-100), and once it has finished, its `result` with one entry per item and any `errors`. This is the recommended way to follow a task: poll it every few seconds until the status is COMPLETED, FAILED or CANCELLED.",
        "operationId": "TaskController_getTask",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Task ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Task retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Task not found"
          }
        },
        "security": [
          {
            "X-Server-API-Key": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Get a task",
        "tags": [
          "Task Management"
        ]
      }
    },
    "/api/tasks/{id}/cancel": {
      "delete": {
        "description": "Cancels a running or pending task. No request body required.",
        "operationId": "TaskController_cancelTask",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Task ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Task cancelled successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Cannot cancel a completed or failed task"
          },
          "404": {
            "description": "Task not found"
          }
        },
        "security": [
          {
            "X-Server-API-Key": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Cancel a task",
        "tags": [
          "Task Management"
        ]
      }
    },
    "/api/tasks/{id}/outputs": {
      "get": {
        "description": "Returns the persisted execution-log lines for a task in chronological order. Pass `since` (ISO timestamp) to fetch only newer lines for incremental polling. Admins can read any task; others only their own.",
        "operationId": "TaskController_getTaskOutputs",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Task ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskOutputsResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "X-Server-API-Key": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Get a task execution log",
        "tags": [
          "Task Management"
        ]
      }
    },
    "/api/tasks/{id}/events": {
      "get": {
        "description": "Opens a Server-Sent Events stream for one task. Events: `connected` once, then `task.updated` (status, progress, and once finished the result and errors), `task.message` (a log line) and `task.cancelled`. The task is finished when a `task.updated` carries status COMPLETED or FAILED, or `task.cancelled` arrives; close the connection then. Each `data` line is JSON. Polling `GET /api/tasks/{id}` gives the same information and is the recommended way to follow a task from a server.",
        "operationId": "TaskController_getTaskEvents",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Task ID to monitor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SSE connection established",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                },
                "example": "event: connected\ndata: {\"message\":\"SSE connection established\"}\n\nevent: task.updated\ndata: {\"taskId\":\"3f1c...\",\"status\":\"PROCESSING\",\"progress\":40}\n\nevent: task.updated\ndata: {\"taskId\":\"3f1c...\",\"status\":\"COMPLETED\",\"progress\":100,\"result\":{}}\n\n"
              }
            },
            "headers": {
              "Content-Type": {
                "description": "text/event-stream"
              },
              "Cache-Control": {
                "description": "no-cache"
              },
              "Connection": {
                "description": "keep-alive"
              }
            }
          }
        },
        "security": [
          {
            "X-Server-API-Key": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Get real-time task updates via Server-Sent Events",
        "tags": [
          "Task Management"
        ]
      }
    },
    "/api/tasks/events/all": {
      "get": {
        "description": "Opens one Server-Sent Events stream carrying the events of every task of your product, in the same format as `GET /api/tasks/{id}/events`.",
        "operationId": "TaskController_getAllTaskEvents",
        "parameters": [],
        "responses": {
          "200": {
            "description": "SSE connection established for all tasks",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                },
                "example": "event: connected\ndata: {\"message\":\"SSE connection established\"}\n\nevent: task.updated\ndata: {\"taskId\":\"3f1c...\",\"status\":\"PROCESSING\",\"progress\":40}\n\nevent: task.updated\ndata: {\"taskId\":\"3f1c...\",\"status\":\"COMPLETED\",\"progress\":100,\"result\":{}}\n\n"
              }
            },
            "headers": {
              "Content-Type": {
                "description": "text/event-stream"
              },
              "Cache-Control": {
                "description": "no-cache"
              },
              "Connection": {
                "description": "keep-alive"
              }
            }
          }
        },
        "security": [
          {
            "X-Server-API-Key": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Get real-time updates for all user tasks via Server-Sent Events",
        "tags": [
          "Task Management"
        ]
      }
    },
    "/api/tasks/stats/summary": {
      "get": {
        "description": "Counts your product's tasks by status: total, pending, processing, completed, failed and cancelled. Counted over the 1,000 most recent tasks.",
        "operationId": "TaskController_getTaskStats",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Task statistics retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskStatsResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "X-Server-API-Key": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Get task counts by status",
        "tags": [
          "Task Management"
        ]
      }
    },
    "/api/warmup/mailboxes/bulk": {
      "post": {
        "description": "Enable or disable email warmup for multiple mailboxes. Returns a task ID for tracking progress. Use GET /api/tasks/{taskId} to check status.",
        "operationId": "WarmupController_bulkToggleWarmup",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkToggleWarmupDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bulk warmup processing started",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkToggleWarmupResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "summary": "Bulk toggle warmup for multiple mailboxes",
        "tags": [
          "Warmup"
        ]
      }
    },
    "/api/warmup/mailboxes/{email}": {
      "post": {
        "description": "Enable or disable email warmup for a specific mailbox",
        "operationId": "WarmupController_toggleWarmup",
        "parameters": [
          {
            "name": "email",
            "required": true,
            "in": "path",
            "description": "Mailbox email address",
            "schema": {
              "example": "john.doe@example.com",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToggleWarmupDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Warmup status toggled successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToggleWarmupResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Mailbox not found"
          },
          "409": {
            "description": "Conflict - Domain warmup is already enabled for this domain"
          }
        },
        "summary": "Toggle warmup for a mailbox",
        "tags": [
          "Warmup"
        ]
      },
      "get": {
        "description": "Retrieve comprehensive warmup information for a specific mailbox: the Premium warm-up link and sync status, last-10-day warmup stats, and event history",
        "operationId": "WarmupController_getMailboxWarmupStatus",
        "parameters": [
          {
            "name": "email",
            "required": true,
            "in": "path",
            "description": "Mailbox email address",
            "schema": {
              "example": "john.doe@example.com",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Warmup status retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetMailboxWarmupStatusResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Mailbox not found"
          }
        },
        "summary": "Get mailbox warmup status",
        "tags": [
          "Warmup"
        ]
      }
    },
    "/api/warmup/domains/bulk": {
      "post": {
        "description": "Enable or disable email warmup for all mailboxes in multiple domains. Returns a task ID for tracking progress. Use GET /api/tasks/{taskId} to check status.",
        "operationId": "WarmupController_bulkToggleDomainWarmup",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkToggleDomainWarmupDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bulk domain warmup processing started",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkToggleDomainWarmupResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "summary": "Bulk toggle warmup for multiple domains",
        "tags": [
          "Warmup"
        ]
      }
    },
    "/api/warmup/domains/{domainName}": {
      "get": {
        "description": "Retrieve warmup status and warmup mailboxes for a specific domain",
        "operationId": "WarmupController_getDomainWarmupStatus",
        "parameters": [
          {
            "name": "domainName",
            "required": true,
            "in": "path",
            "description": "Domain name",
            "schema": {
              "example": "example.com",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Domain warmup status retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDomainWarmupStatusResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Domain not found"
          }
        },
        "summary": "Get domain warmup status",
        "tags": [
          "Warmup"
        ]
      },
      "post": {
        "description": "Enable or disable email warmup for all mailboxes belonging to a domain",
        "operationId": "WarmupController_toggleDomainWarmup",
        "parameters": [
          {
            "name": "domainName",
            "required": true,
            "in": "path",
            "description": "Domain name",
            "schema": {
              "example": "example.com",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToggleDomainWarmupDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Domain warmup toggled successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Domain warmup enabled successfully for example.com. 2 warmup mailbox(es) activated."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Domain not found"
          },
          "409": {
            "description": "Conflict - One or more mailboxes in this domain already have warmup enabled"
          }
        },
        "summary": "Toggle warmup for all mailboxes in a domain",
        "tags": [
          "Warmup"
        ]
      },
      "patch": {
        "description": "\n    Update the number of warmup units (mailboxes) allocated to an active domain warmup.\n\n    **1 unit = 2 warmup mailboxes.**\n\n    **Prerequisites:**\n    - Domain warmup must already be enabled\n    - Unit count must differ from the current allocation\n\n    **Process:**\n    1. Validates domain exists and warmup is currently active\n    2. Removes all existing warmup mailboxes from Premium warm-up and DB\n    3. Creates fresh mailboxes at the new count\n    4. Provisions SMTP/IMAP users on the sending server\n    5. Enrols the mailboxes in Premium warm-up\n    6. Preserves the original warmup start date\n\n    **Billing:**\n    - Increasing units fires a billing event for the **delta** (added units only)\n    - Decreasing units fires no billing event\n    - No change in units returns immediately with no modifications\n\n    **Rollback on failure:**\n    - Any activation failure triggers full cleanup of DB records\n    - Cube SMTP/IMAP users are also removed to prevent orphaned accounts\n  ",
        "operationId": "WarmupController_updateDomainWarmupUnits",
        "parameters": [
          {
            "name": "domainName",
            "required": true,
            "in": "path",
            "description": "Domain name",
            "schema": {
              "example": "example.com",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDomainWarmupUnitsDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Warmup units updated successfully",
            "schema": {
              "example": {
                "message": "Domain warmup updated successfully for example.com. 4 warmup mailbox(es) activated.",
                "mailboxesCount": 4,
                "oldUnitCount": 1,
                "newUnitCount": 2,
                "billingEventFired": true
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateDomainWarmupUnitsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Domain warmup is not enabled, or unit count is invalid"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden — insufficient plan or role"
          },
          "404": {
            "description": "Domain not found or does not belong to your organization"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Update warmup unit count for a domain",
        "tags": [
          "Warmup"
        ]
      }
    },
    "/api/mailboxes": {
      "post": {
        "description": "\n    Create a new mailbox associated with a domain.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - Domain must exist and belong to the organization\n    - Domain must be associated with a project\n\n    **Request Body:**\n    - **email**: Email address for the mailbox (must be valid email)\n    - **fullName**: Full name of the mailbox owner\n    - **password**: Password for the mailbox (stored as raw text)\n\n    **Process:**\n    1. Validates product-level API key\n    2. Extracts domain name from email address (e.g., \"example.com\" from \"user@example.com\")\n    3. Validates domain exists and belongs to organization\n    4. Creates mailbox associated with the extracted domain\n    5. Returns created mailbox with domain information\n\n    **Use Cases:**\n    - Create email accounts for sending campaigns\n    - Set up mailboxes for warmup processes\n    - Configure sender identities\n    ",
        "operationId": "MailboxesController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMailboxDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Mailbox created successfully",
            "schema": {
              "example": {
                "email": "john.doe@example.com",
                "fullName": "John Doe",
                "password": "SecurePassword123!",
                "sent": 0,
                "warmupStartDate": null,
                "warmedDays": 0,
                "totalWarmedDays": 0,
                "isWarmupActive": false,
                "domainId": "6a84bf23-825d-464f-8aa2-4ee218ecde93",
                "domainName": "example.com",
                "projectId": "b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a",
                "projectName": "Q1 Campaign",
                "replyTo": null,
                "createdAt": "2025-12-23T05:50:35.579Z",
                "updatedAt": "2025-12-23T05:50:35.579Z"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MailboxResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid input data"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Missing organizationProductId"
          },
          "404": {
            "description": "Not found - Domain not found or does not belong to organization"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Create a new mailbox",
        "tags": [
          "Mailbox Management"
        ]
      },
      "get": {
        "description": "\n    Retrieve a paginated list of mailboxes with advanced filtering options.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n\n    **Query Parameters:**\n    - **page**: Page number (default: 1)\n    - **limit**: Items per page (default: 30)\n    - **projectId**: Filter by project UUID (exact match, takes precedence over projectName)\n    - **domainId**: Filter by domain UUID (exact match)\n    - **email**: Search by email address (partial match)\n    - **domainName**: Search by domain name (partial match)\n    - **projectName**: Search by project name (partial match, ignored if projectId is provided)\n    - **isWarmupActive**: Filter by warmup status (true/false)\n    - **warmedDays**: Filter by minimum warmed days (number)\n    - **createdFrom**: Filter mailboxes created from this date (YYYY-MM-DD)\n    - **createdTo**: Filter mailboxes created until this date (YYYY-MM-DD)\n    - **orderBy**: Sort field — one of `email`, `fullName`, `createdAt`, `healthScore`\n    - **orderDirection**: Sort direction — `ASC` or `DESC` (default: `ASC` for standard fields, `DESC` for `healthScore`)\n\n    **Multi-tenancy:**\n    - Mailboxes are automatically filtered by organizationProductId\n    - Only returns mailboxes for domains belonging to the organization\n    - Cannot access mailboxes from other organizations\n\n    **Filtering Examples:**\n    - `?email=john` - Finds all emails containing \"john\"\n    - `?domainName=example` - Finds all mailboxes on domains containing \"example\"\n    - `?projectId=b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a` - Exact project match\n    - `?projectName=Q1` - Finds all mailboxes in projects containing \"Q1\"\n    - `?page=2&limit=50` - Get second page with 50 items\n\n    **Note:** If both projectId and projectName are provided, projectId takes precedence\n\n    **Sorting:**\n    - Default sort: `healthScore DESC NULLS LAST` (mailboxes without a health check appear last)\n    - `healthScore` uses the most recent completed health check score\n    - Standard fields (`email`, `fullName`, `createdAt`) default to `ASC` when no direction is specified\n\n    **Response:**\n    - Paginated array of mailboxes with domain and project information\n    - Includes email, full name, send count, warmup progress\n    - Total count and pagination metadata\n\n    **Use Cases:**\n    - List all organization mailboxes\n    - Search for specific mailboxes\n    - Filter by domain or project\n    - Monitor mailbox usage and warmup progress\n    - Manage sender accounts\n    ",
        "operationId": "MailboxesController_findAll",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number",
            "schema": {
              "minimum": 1,
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Items per page (up to 500)",
            "schema": {
              "minimum": 1,
              "maximum": 500,
              "default": 30,
              "type": "number"
            }
          },
          {
            "name": "projectId",
            "required": false,
            "in": "query",
            "description": "Filter by project ID (exact match)",
            "schema": {
              "example": "b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a",
              "type": "string"
            }
          },
          {
            "name": "domainId",
            "required": false,
            "in": "query",
            "description": "Filter by domain ID (exact match)",
            "schema": {
              "example": "550e8400-e29b-41d4-a716-446655440000",
              "type": "string"
            }
          },
          {
            "name": "email",
            "required": false,
            "in": "query",
            "description": "Search by email address (partial match)",
            "schema": {
              "example": "john",
              "type": "string"
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "Free-text search across email and full name (partial match, case-insensitive)",
            "schema": {
              "example": "john",
              "type": "string"
            }
          },
          {
            "name": "domainName",
            "required": false,
            "in": "query",
            "description": "Search by domain name (partial match)",
            "schema": {
              "example": "example.com",
              "type": "string"
            }
          },
          {
            "name": "projectName",
            "required": false,
            "in": "query",
            "description": "Search by project name (partial match)",
            "schema": {
              "example": "Q1 Campaign",
              "type": "string"
            }
          },
          {
            "name": "isWarmupActive",
            "required": false,
            "in": "query",
            "description": "Filter mailboxes by warmup status (active/inactive)",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "warmedDays",
            "required": false,
            "in": "query",
            "description": "Filter mailboxes by minimum warmed days",
            "schema": {
              "example": 14,
              "type": "number"
            }
          },
          {
            "name": "createdFrom",
            "required": false,
            "in": "query",
            "description": "Filter mailboxes created from this date (ISO 8601 format)",
            "schema": {
              "example": "2024-01-01",
              "type": "string"
            }
          },
          {
            "name": "createdTo",
            "required": false,
            "in": "query",
            "description": "Filter mailboxes created until this date (ISO 8601 format)",
            "schema": {
              "example": "2024-12-31",
              "type": "string"
            }
          },
          {
            "name": "orderBy",
            "required": false,
            "in": "query",
            "description": "Field to sort by",
            "schema": {
              "type": "string",
              "enum": [
                "email",
                "fullName",
                "createdAt",
                "healthScore"
              ]
            }
          },
          {
            "name": "orderDirection",
            "required": false,
            "in": "query",
            "description": "Sort direction",
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of mailboxes retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MailboxResponseDto"
                      }
                    },
                    "total": {
                      "type": "number",
                      "description": "Total number of mailboxes matching the query"
                    },
                    "page": {
                      "type": "number",
                      "description": "Current page number"
                    },
                    "limit": {
                      "type": "number",
                      "description": "Items per page"
                    },
                    "totalPages": {
                      "type": "number",
                      "description": "Total number of pages"
                    }
                  },
                  "example": {
                    "data": [
                      {
                        "email": "sender1@example.com",
                        "fullName": "John Doe",
                        "password": "SecurePassword123!",
                        "sent": 1250,
                        "warmupStartDate": "2025-12-10T00:00:00Z",
                        "warmedDays": 13,
                        "totalWarmedDays": 17,
                        "isWarmupActive": true,
                        "domainId": "6a84bf23-825d-464f-8aa2-4ee218ecde93",
                        "domainName": "example.com",
                        "projectId": "b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a",
                        "projectName": "Q1 Campaign",
                        "replyTo": "reply@example.com",
                        "createdAt": "2025-12-10T05:50:35.579Z",
                        "updatedAt": "2025-12-23T06:09:37.150Z"
                      },
                      {
                        "email": "sender2@example.com",
                        "fullName": "Jane Smith",
                        "password": "SecurePassword456!",
                        "sent": 850,
                        "warmupStartDate": "2025-12-15T00:00:00Z",
                        "warmedDays": 8,
                        "totalWarmedDays": 10,
                        "isWarmupActive": true,
                        "domainId": "6a84bf23-825d-464f-8aa2-4ee218ecde93",
                        "domainName": "example.com",
                        "projectId": "b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a",
                        "projectName": "Q1 Campaign",
                        "replyTo": null,
                        "createdAt": "2025-12-15T08:20:15.123Z",
                        "updatedAt": "2025-12-23T06:09:37.150Z"
                      }
                    ],
                    "total": 45,
                    "page": 1,
                    "limit": 30,
                    "totalPages": 2
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid query parameters"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Missing organizationProductId"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "List all mailboxes with filtering and pagination",
        "tags": [
          "Mailbox Management"
        ]
      }
    },
    "/api/mailboxes/bulk-create": {
      "post": {
        "description": "\n    Create multiple mailboxes simultaneously using a background task.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - All domains referenced in email addresses must exist and belong to the organization\n    - Maximum 100 mailboxes per request recommended\n\n    **Request Body:**\n    - **mailboxes**: Array of mailbox creation items\n      - **email**: Email address for the mailbox (required, domain will be extracted)\n      - **fullName**: Full name of the mailbox owner (required)\n      - **password**: Password for the mailbox (optional, auto-generated if not provided)\n      - **replyTo**: Forward replies to this address (optional). Replies still land in the mailbox; outgoing mail carries no Reply-To header\n\n    **Process:**\n    1. Validates product-level API key\n    2. Creates a background task for asynchronous processing\n    3. Returns task ID immediately for progress monitoring\n    4. Task processes each mailbox sequentially\n    5. For each mailbox, extracts domain from email and validates ownership\n    6. Auto-generates password if not provided\n    7. Creates mailbox associated with the extracted domain\n    8. Sends real-time progress updates via Server-Sent Events (SSE)\n\n    **Task Processing:**\n    - Mailboxes are processed sequentially\n    - 100ms delay between mailbox creations\n    - Partial success is possible (some mailboxes may succeed, others fail)\n    - Failed mailboxes are logged and reported in final results\n    - Task can be retried if it fails completely\n\n    **Task Monitoring:**\n    - Use /api/tasks/{taskId} to monitor progress\n    - Or subscribe to `GET /api/tasks/{taskId}/events` (Server-Sent Events)\n    - Task results include successful mailboxes with details\n    - Final task result includes all mailbox creation outcomes\n\n    **Use Cases:**\n    - Bulk onboarding of sender accounts\n    - Setting up mailboxes for multiple domains\n    - Automated mailbox provisioning\n    - Campaign sender setup\n    ",
        "operationId": "MailboxesController_bulkCreate",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkCreateMailboxesDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Bulk mailbox creation task created successfully - use taskId to monitor progress",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "taskId": {
                      "type": "string",
                      "description": "Task ID to monitor bulk mailbox creation progress",
                      "example": "task-uuid-123e4567-e89b-12d3-a456-426614174000"
                    },
                    "message": {
                      "type": "string",
                      "description": "Success message with task details",
                      "example": "Bulk mailbox creation task started for 5 mailboxes. Use the task ID to monitor progress."
                    }
                  },
                  "example": {
                    "taskId": "task-uuid-123e4567-e89b-12d3-a456-426614174000",
                    "message": "Bulk mailbox creation task started for 5 mailboxes. Use the task ID to monitor progress."
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid mailbox data or email format"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Missing organizationProductId"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Bulk create multiple mailboxes",
        "tags": [
          "Mailbox Management"
        ]
      }
    },
    "/api/mailboxes/bulk-delete": {
      "post": {
        "description": "\n    Delete multiple mailboxes simultaneously using a background task.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - All email addresses must belong to domains owned by the organization\n    - Maximum 100 mailboxes per request recommended\n\n    **Request Body:**\n    - **emails**: Array of email addresses to delete\n\n    **Process:**\n    1. Validates product-level API key\n    2. Creates a background task for bulk deletion\n    3. Returns task ID for monitoring progress\n    4. Each mailbox is validated before deletion:\n       - Email must exist in the database\n       - Associated domain must belong to the organization\n    5. Task continues even if individual deletions fail\n\n    **Task Result:**\n    - **total**: Total number of mailboxes to delete\n    - **successful**: Number of successfully deleted mailboxes\n    - **failed**: Number of failed deletions\n    - **results**: Detailed results for each mailbox deletion\n\n    **Error Handling:**\n    - Individual mailbox deletion errors don't stop the entire task\n    - Failed deletions are reported in the task result\n    - Common errors: mailbox not found, permission denied\n\n    **Task Monitoring:**\n    Use the returned task ID to:\n    - Monitor progress via Server-Sent Events (SSE)\n    - Check final results when task completes\n    - Review individual mailbox deletion outcomes\n\n    **Use Cases:**\n    - Clean up unused mailboxes\n    - Remove mailboxes from deactivated campaigns\n    - Bulk cleanup after domain migration\n    - Decommission mailboxes in batches\n    ",
        "operationId": "MailboxesController_bulkDelete",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkDeleteMailboxesDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bulk mailbox deletion task created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "taskId": "550e8400-e29b-41d4-a716-446655440000",
                    "message": "Bulk mailbox deletion task started for 50 mailboxes. Use the task ID to monitor progress."
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid input data or empty email array"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Missing organizationProductId"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Bulk delete multiple mailboxes",
        "tags": [
          "Mailbox Management"
        ]
      }
    },
    "/api/mailboxes/bulk-connect-instantly": {
      "post": {
        "description": "Initiates a background task to connect the specified mailboxes to the customer's Instantly account using their stored Instantly API key. A mailbox already connected is **rebuilt** — deleted from Instantly and re-added on the product's current cube endpoint. Instantly's update accepts no smtp/imap fields and its account read reports none, so rebuilding is the only way to make the endpoint current. The account's Instantly-side history (warmup progress, campaign membership) does not survive a rebuild.",
        "operationId": "MailboxesController_bulkConnectInstantly",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkConnectInstantlyDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Task created",
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "taskId": "550e8400-e29b-41d4-a716-446655440000",
                    "message": "Connect Instantly task created for 3 mailbox(es)"
                  }
                }
              }
            }
          }
        },
        "summary": "Connect mailboxes to Instantly (SEP)",
        "tags": [
          "Mailbox Management"
        ]
      }
    },
    "/api/mailboxes/bulk-connect-smartlead": {
      "post": {
        "description": "Initiates a background task to connect the specified mailboxes to the customer's Smartlead account using their stored Smartlead API key.",
        "operationId": "MailboxesController_bulkConnectSmartlead",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkConnectSmartleadDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Task created",
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "taskId": "550e8400-e29b-41d4-a716-446655440000",
                    "message": "Connect Smartlead task created for 3 mailbox(es)"
                  }
                }
              }
            }
          }
        },
        "summary": "Connect mailboxes to Smartlead (SEP)",
        "tags": [
          "Mailbox Management"
        ]
      }
    },
    "/api/mailboxes/bulk-connect-plusvibe": {
      "post": {
        "description": "Initiates a background task to push the specified mailboxes into the customer's PlusVibe workspace (the one saved on the connection). PlusVibe adds accounts asynchronously, so each mailbox is reported connected only once PlusVibe lists it; one it has not added after 10 minutes is reported failed. An address the workspace already holds is deleted and added again, which removes it from its PlusVibe campaigns.",
        "operationId": "MailboxesController_bulkConnectPlusVibe",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkConnectPlusVibeDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Task created",
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "taskId": "550e8400-e29b-41d4-a716-446655440000",
                    "message": "Connect PlusVibe task created for 3 mailbox(es)"
                  }
                }
              }
            }
          }
        },
        "summary": "Connect mailboxes to PlusVibe (SEP)",
        "tags": [
          "Mailbox Management"
        ]
      }
    },
    "/api/mailboxes/bulk-connect-emailbison": {
      "post": {
        "description": "Initiates a background task to connect the specified mailboxes to the customer's EmailBison account using their stored EmailBison API key.",
        "operationId": "MailboxesController_bulkConnectEmailBison",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkConnectEmailBisonDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Task created",
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "taskId": "550e8400-e29b-41d4-a716-446655440000",
                    "message": "Connect EmailBison task created for 3 mailbox(es)"
                  }
                }
              }
            }
          }
        },
        "summary": "Connect mailboxes to EmailBison (SEP)",
        "tags": [
          "Mailbox Management"
        ]
      }
    },
    "/api/mailboxes/connect-all-instantly": {
      "post": {
        "description": "Initiates a background task to connect every mailbox in the caller's product to their Instantly account. The mailbox list is resolved server-side from the product API key, so there is no client-side cap. Every mailbox already connected is rebuilt (deleted and re-added) onto the product's current cube endpoint, discarding that account's Instantly-side history — the only way Instantly allows the endpoint to change.",
        "operationId": "MailboxesController_connectAllInstantly",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SepCredentialSelectionDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Task created",
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "taskId": "550e8400-e29b-41d4-a716-446655440000",
                    "message": "Connect Instantly task created for 142 mailbox(es)"
                  }
                }
              }
            }
          }
        },
        "summary": "Connect ALL product mailboxes to Instantly (SEP)",
        "tags": [
          "Mailbox Management"
        ]
      }
    },
    "/api/mailboxes/connect-all-smartlead": {
      "post": {
        "description": "Initiates a background task to connect every mailbox in the caller's product to their Smartlead account. The mailbox list is resolved server-side from the product API key, so there is no client-side cap. Mailboxes already connected are re-sent and treated as a no-op by Smartlead's 409 handling.",
        "operationId": "MailboxesController_connectAllSmartlead",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SepCredentialSelectionDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Task created",
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "taskId": "550e8400-e29b-41d4-a716-446655440000",
                    "message": "Connect Smartlead task created for 142 mailbox(es)"
                  }
                }
              }
            }
          }
        },
        "summary": "Connect ALL product mailboxes to Smartlead (SEP)",
        "tags": [
          "Mailbox Management"
        ]
      }
    },
    "/api/mailboxes/connect-all-plusvibe": {
      "post": {
        "description": "Initiates a background task to push every mailbox in the caller's product into their PlusVibe workspace. The mailbox list is resolved server-side. Same behaviour as bulk-connect-plusvibe.",
        "operationId": "MailboxesController_connectAllPlusVibe",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SepCredentialSelectionDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Task created",
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "taskId": "550e8400-e29b-41d4-a716-446655440000",
                    "message": "Connect PlusVibe task created for 142 mailbox(es)"
                  }
                }
              }
            }
          }
        },
        "summary": "Connect ALL product mailboxes to PlusVibe (SEP)",
        "tags": [
          "Mailbox Management"
        ]
      }
    },
    "/api/mailboxes/connect-all-emailbison": {
      "post": {
        "description": "Initiates a background task to connect every mailbox in the caller's product to their EmailBison account. The mailbox list is resolved server-side from the product API key, so there is no client-side cap. Mailboxes already connected are re-sent and treated as a no-op by EmailBison's 409 handling.",
        "operationId": "MailboxesController_connectAllEmailBison",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SepCredentialSelectionDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Task created",
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "taskId": "550e8400-e29b-41d4-a716-446655440000",
                    "message": "Connect EmailBison task created for 142 mailbox(es)"
                  }
                }
              }
            }
          }
        },
        "summary": "Connect ALL product mailboxes to EmailBison (SEP)",
        "tags": [
          "Mailbox Management"
        ]
      }
    },
    "/api/mailboxes/statistic": {
      "get": {
        "description": "\n    Retrieve aggregated statistics about mailboxes for the authenticated product.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n\n    **Statistics Returned:**\n    - **totalMailboxes**: Total number of mailboxes registered for the product\n    - **readyForOutreach**: Number of mailboxes ready for outreach campaigns (warmedDays > 14)\n    - **warmupRunning**: Number of mailboxes currently running warmup (isWarmupActive is true)\n    - **notUsed**: Number of mailboxes that haven't sent any emails (sent = 0)\n\n    **Use Cases:**\n    - Mailbox management dashboard overview\n    - Quick health check of mailbox portfolio\n    - Monitoring warmup progress across all mailboxes\n    - Identifying unused mailboxes\n    - Campaign readiness assessment\n    ",
        "operationId": "MailboxesController_getStatistics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Mailbox statistics retrieved successfully",
            "schema": {
              "example": {
                "totalMailboxes": 250,
                "readyForOutreach": 180,
                "warmupRunning": 50,
                "notUsed": 75,
                "connectedToSep": 40
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MailboxStatisticsDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Organization product ID is required"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get mailbox statistics",
        "tags": [
          "Mailbox Management"
        ]
      }
    },
    "/api/mailboxes/export": {
      "get": {
        "description": "\n    Export mailboxes matching the query filters to CSV format for download.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n\n    **Query Parameters (same as list endpoint):**\n    - **projectId**: Filter by project ID (exact match)\n    - **domainId**: Filter by domain ID (exact match)\n    - **email**: Search by email address (partial match)\n    - **domainName**: Search by domain name (partial match)\n    - **projectName**: Search by project name (partial match)\n    - **isWarmupActive**: Filter by warmup status (true/false)\n    - **warmedDays**: Filter by minimum warmed days (number)\n    - **createdFrom**: Filter mailboxes created from this date (YYYY-MM-DD)\n    - **createdTo**: Filter mailboxes created until this date (YYYY-MM-DD)\n\n    **Note:** Unlike the list endpoint, this exports ALL matching mailboxes (no pagination).\n\n    **CSV Columns:**\n    - Email, Full Name, Password, Reply To\n    - Sent (email count)\n    - Warmup Started, Warmed Days\n    - Domain ID, Domain Name\n    - Project ID, Project Name\n    - Created At, Updated At\n\n    **Response:**\n    - Content-Type: text/csv\n    - Content-Disposition: attachment; filename=\"mailboxes.csv\"\n    - Returns CSV content as plain text\n\n    **Use Cases:**\n    - Export filtered mailbox list for reporting\n    - Backup mailbox configuration data\n    - Generate mailbox inventory reports\n    - Share mailbox data with team members\n    - Analyze mailbox usage in spreadsheet tools\n    - Password management and backup\n    ",
        "operationId": "MailboxesController_exportMailboxes",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number",
            "schema": {
              "minimum": 1,
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Items per page (up to 500)",
            "schema": {
              "minimum": 1,
              "maximum": 500,
              "default": 30,
              "type": "number"
            }
          },
          {
            "name": "projectId",
            "required": false,
            "in": "query",
            "description": "Filter by project ID (exact match)",
            "schema": {
              "example": "b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a",
              "type": "string"
            }
          },
          {
            "name": "domainId",
            "required": false,
            "in": "query",
            "description": "Filter by domain ID (exact match)",
            "schema": {
              "example": "550e8400-e29b-41d4-a716-446655440000",
              "type": "string"
            }
          },
          {
            "name": "email",
            "required": false,
            "in": "query",
            "description": "Search by email address (partial match)",
            "schema": {
              "example": "john",
              "type": "string"
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "Free-text search across email and full name (partial match, case-insensitive)",
            "schema": {
              "example": "john",
              "type": "string"
            }
          },
          {
            "name": "domainName",
            "required": false,
            "in": "query",
            "description": "Search by domain name (partial match)",
            "schema": {
              "example": "example.com",
              "type": "string"
            }
          },
          {
            "name": "projectName",
            "required": false,
            "in": "query",
            "description": "Search by project name (partial match)",
            "schema": {
              "example": "Q1 Campaign",
              "type": "string"
            }
          },
          {
            "name": "isWarmupActive",
            "required": false,
            "in": "query",
            "description": "Filter mailboxes by warmup status (active/inactive)",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "warmedDays",
            "required": false,
            "in": "query",
            "description": "Filter mailboxes by minimum warmed days",
            "schema": {
              "example": 14,
              "type": "number"
            }
          },
          {
            "name": "createdFrom",
            "required": false,
            "in": "query",
            "description": "Filter mailboxes created from this date (ISO 8601 format)",
            "schema": {
              "example": "2024-01-01",
              "type": "string"
            }
          },
          {
            "name": "createdTo",
            "required": false,
            "in": "query",
            "description": "Filter mailboxes created until this date (ISO 8601 format)",
            "schema": {
              "example": "2024-12-31",
              "type": "string"
            }
          },
          {
            "name": "orderBy",
            "required": false,
            "in": "query",
            "description": "Field to sort by",
            "schema": {
              "type": "string",
              "enum": [
                "email",
                "fullName",
                "createdAt",
                "healthScore"
              ]
            }
          },
          {
            "name": "orderDirection",
            "required": false,
            "in": "query",
            "description": "Sort direction",
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CSV file content with mailboxes data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "example": "Email,Full Name,Password,Reply To,Sent,Warmup Started,Warmed Days,Domain ID,Domain Name,Project ID,Project Name,Created At,Updated At\\nsender@example.com,John Doe,SecurePass123!,reply@example.com,1250,2025-12-10T00:00:00Z,13,6a84bf23-825d-464f-8aa2-4ee218ecde93,example.com,b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a,Q1 Campaign,2025-12-10T05:50:35.579Z,2025-12-23T06:09:37.150Z"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid query parameters or organization product ID required"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Export mailboxes to CSV",
        "tags": [
          "Mailbox Management"
        ]
      }
    },
    "/api/mailboxes/export-list": {
      "get": {
        "description": "\n    Export mailboxes matching the query filters as a JSON array for client-side processing.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n\n    **Query Parameters (same as list endpoint):**\n    - **projectId**: Filter by project ID (exact match)\n    - **domainId**: Filter by domain ID (exact match)\n    - **email**: Search by email address (partial match)\n    - **domainName**: Search by domain name (partial match)\n    - **projectName**: Search by project name (partial match)\n    - **isWarmupActive**: Filter by warmup status (true/false)\n    - **warmedDays**: Filter by minimum warmed days (number)\n    - **createdFrom**: Filter mailboxes created from this date (YYYY-MM-DD)\n    - **createdTo**: Filter mailboxes created until this date (YYYY-MM-DD)\n\n    **Note:** Unlike the list endpoint, this exports ALL matching mailboxes (no pagination).\n    Unlike the CSV export endpoint, this returns JSON array for client-side formatting.\n\n    **Response:**\n    - Content-Type: application/json\n    - Returns array of mailbox objects\n    - Each mailbox includes email, fullName, sent, warmup info, domain and project details\n\n    **Use Cases:**\n    - Export filtered mailbox list for client-side processing\n    - Generate custom report formats (PDF, Excel, etc.) in the UI\n    - Transform data into different formats based on user preferences\n    - Process mailbox data with custom business logic\n    - Build dynamic reports and dashboards\n    ",
        "operationId": "MailboxesController_exportMailboxesList",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number",
            "schema": {
              "minimum": 1,
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Items per page (up to 500)",
            "schema": {
              "minimum": 1,
              "maximum": 500,
              "default": 30,
              "type": "number"
            }
          },
          {
            "name": "projectId",
            "required": false,
            "in": "query",
            "description": "Filter by project ID (exact match)",
            "schema": {
              "example": "b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a",
              "type": "string"
            }
          },
          {
            "name": "domainId",
            "required": false,
            "in": "query",
            "description": "Filter by domain ID (exact match)",
            "schema": {
              "example": "550e8400-e29b-41d4-a716-446655440000",
              "type": "string"
            }
          },
          {
            "name": "email",
            "required": false,
            "in": "query",
            "description": "Search by email address (partial match)",
            "schema": {
              "example": "john",
              "type": "string"
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "Free-text search across email and full name (partial match, case-insensitive)",
            "schema": {
              "example": "john",
              "type": "string"
            }
          },
          {
            "name": "domainName",
            "required": false,
            "in": "query",
            "description": "Search by domain name (partial match)",
            "schema": {
              "example": "example.com",
              "type": "string"
            }
          },
          {
            "name": "projectName",
            "required": false,
            "in": "query",
            "description": "Search by project name (partial match)",
            "schema": {
              "example": "Q1 Campaign",
              "type": "string"
            }
          },
          {
            "name": "isWarmupActive",
            "required": false,
            "in": "query",
            "description": "Filter mailboxes by warmup status (active/inactive)",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "warmedDays",
            "required": false,
            "in": "query",
            "description": "Filter mailboxes by minimum warmed days",
            "schema": {
              "example": 14,
              "type": "number"
            }
          },
          {
            "name": "createdFrom",
            "required": false,
            "in": "query",
            "description": "Filter mailboxes created from this date (ISO 8601 format)",
            "schema": {
              "example": "2024-01-01",
              "type": "string"
            }
          },
          {
            "name": "createdTo",
            "required": false,
            "in": "query",
            "description": "Filter mailboxes created until this date (ISO 8601 format)",
            "schema": {
              "example": "2024-12-31",
              "type": "string"
            }
          },
          {
            "name": "orderBy",
            "required": false,
            "in": "query",
            "description": "Field to sort by",
            "schema": {
              "type": "string",
              "enum": [
                "email",
                "fullName",
                "createdAt",
                "healthScore"
              ]
            }
          },
          {
            "name": "orderDirection",
            "required": false,
            "in": "query",
            "description": "Sort direction",
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of mailboxes matching the filter criteria",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MailboxResponseDto"
                  },
                  "example": [
                    {
                      "email": "sender1@example.com",
                      "fullName": "John Doe",
                      "password": "SecurePassword123!",
                      "sent": 1250,
                      "warmupStartDate": "2025-12-10T00:00:00Z",
                      "warmedDays": 13,
                      "totalWarmedDays": 17,
                      "isWarmupActive": true,
                      "domainId": "6a84bf23-825d-464f-8aa2-4ee218ecde93",
                      "domainName": "example.com",
                      "projectId": "b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a",
                      "projectName": "Q1 Campaign",
                      "replyTo": "reply@example.com",
                      "createdAt": "2025-12-10T05:50:35.579Z",
                      "updatedAt": "2025-12-23T06:09:37.150Z"
                    },
                    {
                      "email": "sender2@example.com",
                      "fullName": "Jane Smith",
                      "password": "SecurePassword456!",
                      "sent": 850,
                      "warmupStartDate": "2025-12-15T00:00:00Z",
                      "warmedDays": 8,
                      "totalWarmedDays": 10,
                      "isWarmupActive": true,
                      "domainId": "6a84bf23-825d-464f-8aa2-4ee218ecde93",
                      "domainName": "example.com",
                      "projectId": "b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a",
                      "projectName": "Q1 Campaign",
                      "replyTo": null,
                      "createdAt": "2025-12-15T08:20:15.123Z",
                      "updatedAt": "2025-12-23T06:09:37.150Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid query parameters or organization product ID required"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Export mailboxes as JSON list",
        "tags": [
          "Mailbox Management"
        ]
      }
    },
    "/api/mailboxes/{email}/sep-connections": {
      "get": {
        "description": "Reports, per SEP provider, what we recorded when the mailbox was connected, the SMTP/IMAP endpoint a connect run would push today, and — where the provider's API allows reading one account back (Instantly only) — the endpoint the provider actually holds, with the fields that disagree. Pass `provider` to report a single provider, including one we hold no connection record for.",
        "operationId": "MailboxesController_getSepConnections",
        "parameters": [
          {
            "name": "email",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SEP connection configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SepConnectionDto"
                  }
                }
              }
            }
          }
        },
        "summary": "Read a mailbox's SEP connection configuration",
        "tags": [
          "Mailbox Management"
        ]
      }
    },
    "/api/mailboxes/{email}": {
      "get": {
        "description": "\n    Retrieve detailed information about a specific mailbox using its email address.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - Mailbox must belong to a domain in the organization\n\n    **Path Parameters:**\n    - **email**: Mailbox email address (e.g., \"john.doe@example.com\")\n\n    **Response:**\n    - Complete mailbox information\n    - Associated domain details\n    - Send statistics\n    - Warmup progress\n\n    **Use Cases:**\n    - View mailbox details\n    - Check send statistics\n    - Monitor warmup progress\n    - Verify configuration\n    ",
        "operationId": "MailboxesController_findOne",
        "parameters": [
          {
            "name": "email",
            "required": true,
            "in": "path",
            "description": "Mailbox email address",
            "schema": {
              "example": "john.doe@example.com",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Mailbox retrieved successfully",
            "schema": {
              "example": {
                "email": "sender@example.com",
                "fullName": "John Doe",
                "password": "SecurePassword123!",
                "sent": 1250,
                "warmupStartDate": "2025-12-10T00:00:00Z",
                "warmedDays": 13,
                "totalWarmedDays": 17,
                "isWarmupActive": true,
                "domainId": "6a84bf23-825d-464f-8aa2-4ee218ecde93",
                "domainName": "example.com",
                "projectId": "b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a",
                "projectName": "Q1 Campaign",
                "replyTo": "reply@example.com",
                "createdAt": "2025-12-10T05:50:35.579Z",
                "updatedAt": "2025-12-23T06:09:37.150Z"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MailboxResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid email address format"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Missing organizationProductId"
          },
          "404": {
            "description": "Not found - Mailbox not found or does not belong to organization"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get mailbox by email address",
        "tags": [
          "Mailbox Management"
        ]
      },
      "patch": {
        "description": "\n    Update mailbox information and statistics using email address.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - Mailbox must belong to a domain in the organization\n\n    **Path Parameters:**\n    - **email**: Mailbox email address (e.g., \"john.doe@example.com\")\n\n    **Updatable Fields:**\n    - **fullName**: Change mailbox owner name\n    - **password**: Update mailbox password\n    - **sent**: Update email sent count\n    - **warmedDays**: Update warmup progress\n\n    **Note:**\n    - Email address cannot be changed (use path parameter to identify mailbox)\n    - Domain association cannot be changed\n\n    **Use Cases:**\n    - Update password\n    - Increment sent email count\n    - Track warmup progress\n    ",
        "operationId": "MailboxesController_update",
        "parameters": [
          {
            "name": "email",
            "required": true,
            "in": "path",
            "description": "Mailbox email address",
            "schema": {
              "example": "john.doe@example.com",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMailboxDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Mailbox updated successfully",
            "schema": {
              "example": {
                "email": "sender@example.com",
                "fullName": "John Doe Updated",
                "password": "SecurePassword123!",
                "sent": 1350,
                "warmupStartDate": "2025-12-10T00:00:00Z",
                "warmedDays": 15,
                "totalWarmedDays": 19,
                "isWarmupActive": true,
                "domainId": "6a84bf23-825d-464f-8aa2-4ee218ecde93",
                "domainName": "example.com",
                "projectId": "b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a",
                "projectName": "Q1 Campaign",
                "replyTo": "reply@example.com",
                "createdAt": "2025-12-10T05:50:35.579Z",
                "updatedAt": "2025-12-23T10:30:00.000Z"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MailboxResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid update data"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Missing organizationProductId"
          },
          "404": {
            "description": "Not found - Mailbox not found or does not belong to organization"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Update mailbox",
        "tags": [
          "Mailbox Management"
        ]
      },
      "delete": {
        "description": "\n    Permanently delete a mailbox using its email address.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - Mailbox must belong to a domain in the organization\n\n    **Path Parameters:**\n    - **email**: Mailbox email address (e.g., \"john.doe@example.com\")\n\n    **Warning:**\n    - This action is permanent and cannot be undone\n    - All mailbox data will be removed\n    - Email address can be reused after deletion\n\n    **Use Cases:**\n    - Remove unused mailboxes\n    - Clean up test accounts\n    - Deactivate compromised accounts\n    ",
        "operationId": "MailboxesController_remove",
        "parameters": [
          {
            "name": "email",
            "required": true,
            "in": "path",
            "description": "Mailbox email address",
            "schema": {
              "example": "john.doe@example.com",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Mailbox deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Mailbox deleted successfully"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid email address format"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Missing organizationProductId"
          },
          "404": {
            "description": "Not found - Mailbox not found or does not belong to organization"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Delete mailbox",
        "tags": [
          "Mailbox Management"
        ]
      }
    },
    "/api/health-check/templates": {
      "get": {
        "description": "\n    Returns the full set of built-in B2B email templates used for health checks.\n    The UI can call this on the \"trigger health check\" view to let the user pick\n    one (or pick at random) before submitting POST /health-check/mailboxes.\n\n    **Prerequisites:**\n    - Must be authenticated with valid credentials\n\n    **Behavior:**\n    - Templates are static (shipped with the API). The endpoint does not hit the\n      database or any external service.\n    - All templates are crafted to avoid common spam-filter triggers (no fake\n      `Re:` subjects, no claimed attachments, no marketing language, no\n      \"Quick X\" patterns, varied senders/recipients/topics).\n    - The full list rotates randomly on automated/cron-driven health checks; this\n      endpoint exists so manual UI-driven flows can present the same options.\n\n    **Response:**\n    - Array of `{ id, subject, textContent }`\n    - `id` is the template's position in the built-in array. Use it for tracking\n      which template was picked. UI should submit the literal `subject` and\n      `textContent` strings back when calling POST /health-check/mailboxes.\n\n    **Use Cases:**\n    - Render a template picker on the \"send health check\" UI\n    - Preview a template before submission\n    - Pick one at random client-side for variation\n    ",
        "operationId": "MailboxHealthCheckController_getHealthCheckTemplates",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Built-in health check email templates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EmailTemplateDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List built-in health check email templates",
        "tags": [
          "Mailbox Health Check"
        ]
      }
    },
    "/api/health-check/mailboxes": {
      "post": {
        "description": "\n    Creates a background task to perform health checks on specified mailboxes via GlockApps spam testing.\n\n    **Prerequisites:**\n    - Must be authenticated with valid credentials\n    - Mailboxes must belong to domains owned by the organization\n\n    **Request Body:**\n    - **emails**: Array of email addresses to health check (required)\n      - Each email must be a valid email format\n      - All emails must belong to domains in the organization\n    - **subject**: Subject line for the test email (required)\n      - Used in the health check test email sent via GlockApps\n    - **textContent**: Text content for the test email (required)\n      - Body content used in the health check test email\n\n    **Process:**\n    1. Validates authentication and email ownership\n    2. Creates a background task for asynchronous health check processing\n    3. Returns task ID immediately for progress monitoring\n    4. Task processes each mailbox sequentially:\n       - Sends test email via GlockApps\n       - Monitors spam score and deliverability\n       - Records health check results\n    5. Final results include spam scores and deliverability metrics\n\n    **Task Processing:**\n    - Mailboxes are tested sequentially\n    - Each mailbox receives a test email with provided subject and content\n    - GlockApps analyzes spam scores across major providers\n    - Results are stored and associated with each mailbox\n\n    **Task Monitoring:**\n    - Use /api/tasks/{taskId} to monitor progress\n    - Or subscribe to `GET /api/tasks/{taskId}/events` (Server-Sent Events)\n    - Task results include health check outcomes for each mailbox\n\n    **Use Cases:**\n    - Monitor mailbox deliverability and spam scores\n    - Verify mailbox health before launching campaigns\n    - Regular health checks for active sending mailboxes\n    - Troubleshoot deliverability issues\n    - Ensure mailboxes are properly warmed up\n    ",
        "operationId": "MailboxHealthCheckController_checkMailboxes",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HealthCheckMailboxesDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Health check task created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Indicates successful task creation",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "description": "Success message with task details",
                      "example": "Health check task created for 3 mailbox(es)"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "taskId": {
                          "type": "string",
                          "description": "Task ID to monitor health check progress",
                          "example": "task-uuid-123e4567-e89b-12d3-a456-426614174000"
                        },
                        "mailboxCount": {
                          "type": "number",
                          "description": "Number of mailboxes being health checked",
                          "example": 3
                        }
                      }
                    }
                  },
                  "example": {
                    "success": true,
                    "message": "Health check task created for 3 mailbox(es)",
                    "data": {
                      "taskId": "task-uuid-123e4567-e89b-12d3-a456-426614174000",
                      "mailboxCount": 3
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid email addresses or missing required fields"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Mailboxes do not belong to organization"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create health check task for mailboxes",
        "tags": [
          "Mailbox Health Check"
        ]
      }
    },
    "/api/health-check/mailboxes/{email}": {
      "get": {
        "description": "\n    Retrieve all health check test results for a specific mailbox, ordered by creation date (newest first).\n\n    **Prerequisites:**\n    - Must be authenticated with valid credentials\n    - Mailbox must belong to domains owned by the organization\n\n    **Path Parameters:**\n    - **email**: Mailbox email address (e.g., \"john@example.com\")\n\n    **Response:**\n    - Array of health check results\n    - Each result includes:\n      - Test ID and status (PENDING, PROCESSING, COMPLETED, PARTIAL_COMPLETE, FAILED)\n      - Scores (overall, B2B, and B2C)\n      - Inbox placement data and summary\n      - Detailed per-seed results (which providers received in INBOX/SPAM)\n      - Authentication results (SPF, DKIM, DMARC)\n      - Sending information (IP, provider, reverse DNS)\n      - Blacklist status (links and IP)\n      - Email subject and test metadata\n      - Test creation and completion timestamps\n      - Error messages if any\n\n    **Result Ordering:**\n    - Results are sorted by creation date (newest first)\n    - Shows complete history of all health checks performed on the mailbox\n\n    **Use Cases:**\n    - View historical health check data\n    - Track mailbox deliverability trends over time\n    - Analyze spam score improvements after warmup\n    - Troubleshoot deliverability issues\n    - Monitor ongoing health check status\n    - Audit mailbox testing history\n    ",
        "operationId": "MailboxHealthCheckController_getHealthCheckResults",
        "parameters": [
          {
            "name": "email",
            "required": true,
            "in": "path",
            "description": "Mailbox email address",
            "schema": {
              "example": "john@example.com",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of health check results retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/HealthCheckResultDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid email address format"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "404": {
            "description": "Not found - Mailbox not found or does not belong to organization"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all health check results for a mailbox",
        "tags": [
          "Mailbox Health Check"
        ]
      }
    },
    "/api/health-check/mailboxes/{email}/{testId}": {
      "get": {
        "description": "\n    Fetches the latest test results from GlockApps and updates the database.\n    Returns the updated health check data immediately.\n\n    **Prerequisites:**\n    - Must be authenticated with valid credentials\n    - Health check must belong to the user's organization\n\n    **Path Parameters:**\n    - **email**: Mailbox email address (e.g., \"john@example.com\")\n    - **testId**: GlockApps test ID (e.g., \"4765974259747ca2\")\n\n    **Process:**\n    1. Validates health check exists and belongs to user\n    2. Calls GlockApps API to get latest results\n    3. Updates database with latest scores, results, and status\n    4. If GlockApps `finished=true` → Updates status from PARTIAL_COMPLETE to COMPLETED\n    5. Returns the updated health check data\n\n    **Response:**\n    - Updated health check with latest scores and data\n    - Status may change from PARTIAL_COMPLETE to COMPLETED\n    - All fields updated with latest information from GlockApps\n\n    **Status Updates:**\n    - PARTIAL_COMPLETE → COMPLETED (if GlockApps finished=true)\n    - PROCESSING/PARTIAL_COMPLETE → Updated with latest data\n    - COMPLETED → Returns existing data (no sync needed)\n    - FAILED → Returns existing data (no sync attempted)\n\n    **Use Cases:**\n    - Refresh status for PARTIAL_COMPLETE tests\n    - Get latest scores while GlockApps is still processing\n    - Check if test has fully completed\n    - Update UI with real-time data\n    - Manual sync for specific test\n    ",
        "operationId": "MailboxHealthCheckController_syncHealthCheckStatus",
        "parameters": [
          {
            "name": "email",
            "required": true,
            "in": "path",
            "description": "Mailbox email address",
            "schema": {
              "example": "john@example.com",
              "type": "string"
            }
          },
          {
            "name": "testId",
            "required": true,
            "in": "path",
            "description": "GlockApps test ID",
            "schema": {
              "example": "4765974259747ca2",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Health check synced successfully with latest GlockApps data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthCheckResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid email or testId format"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "404": {
            "description": "Not found - Health check not found or does not belong to organization"
          },
          "500": {
            "description": "Internal server error - Failed to sync with GlockApps API"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Sync health check status with GlockApps",
        "tags": [
          "Mailbox Health Check"
        ]
      }
    },
    "/api/projects": {
      "post": {
        "description": "\n    Create a new project for organizing and grouping domains.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated organization product ID\n\n    **Request Body:**\n    - **name**: Project name (required)\n\n    **Process:**\n    1. Validates product-level API key and extracts organizationProductId\n    2. Creates a new project linked to the organization's product\n    3. Returns the created project details\n\n    **What is a Project?**\n    - Projects are used to group multiple domains together\n    - Each project belongs to a specific organization product\n    - Projects help organize domain management and tracking\n    - Can be used for different campaigns, clients, or use cases\n\n    **Next Steps:**\n    - Add domains to the project via domain management endpoints\n    - Use project ID to filter and organize domain lists\n    - Track domain statistics at the project level\n    ",
        "operationId": "ProjectsController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Project created successfully",
            "schema": {
              "example": {
                "id": "550e8400-e29b-41d4-a716-446655440000",
                "name": "My Email Campaign Project",
                "productId": "prod_2abc123def456",
                "createdAt": "2024-01-15T10:30:00Z",
                "updatedAt": "2024-01-15T10:30:00Z"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid project name or missing required fields"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Organization product ID not found in auth profile"
          },
          "409": {
            "description": "Conflict - Project with the same name already exists in this product"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Create a new project",
        "tags": [
          "Projects"
        ]
      },
      "get": {
        "description": "\n    Retrieve a list of all projects for the authenticated organization product.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated organization product ID\n\n    **Process:**\n    1. Validates product-level API key and extracts organizationProductId\n    2. Retrieves all projects belonging to the organization's product\n    3. Returns array of project details\n\n    **Response:**\n    - Array of project objects with all details\n    - Projects are filtered by the organization's product ID\n    - Includes project metadata (created/updated timestamps)\n\n    **Use Cases:**\n    - Display project list in management dashboard\n    - Select projects for domain assignment\n    - Project overview and organization\n    - Audit and tracking purposes\n    ",
        "operationId": "ProjectsController_findAll",
        "parameters": [],
        "responses": {
          "200": {
            "description": "List of projects retrieved successfully",
            "schema": {
              "example": [
                {
                  "id": "550e8400-e29b-41d4-a716-446655440000",
                  "name": "Campaign Q1 2024",
                  "productId": "prod_2abc123def456",
                  "createdAt": "2024-01-15T10:30:00Z",
                  "updatedAt": "2024-01-15T10:30:00Z"
                },
                {
                  "id": "660e8400-e29b-41d4-a716-446655440001",
                  "name": "Client Newsletter",
                  "productId": "prod_2abc123def456",
                  "createdAt": "2024-01-20T14:20:00Z",
                  "updatedAt": "2024-01-20T14:20:00Z"
                }
              ]
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Organization product ID not found in auth profile"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "List all projects",
        "tags": [
          "Projects"
        ]
      }
    },
    "/api/projects/{id}": {
      "get": {
        "description": "\n    Retrieve detailed information about a specific project.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - Project must belong to the authenticated organization's product\n\n    **Path Parameters:**\n    - **id**: Project UUID (required)\n\n    **Process:**\n    1. Validates product-level API key and extracts organizationProductId\n    2. Verifies project exists and belongs to the organization's product\n    3. Returns project details\n\n    **Security:**\n    - Projects are isolated by organization product ID\n    - Cannot access projects from other organizations\n    - Returns 404 if project doesn't exist or doesn't belong to the organization\n\n    **Use Cases:**\n    - Display project details page\n    - Verify project ownership before operations\n    - Retrieve project metadata for updates\n    ",
        "operationId": "ProjectsController_findOne",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Project UUID",
            "schema": {
              "example": "550e8400-e29b-41d4-a716-446655440000",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project details retrieved successfully",
            "schema": {
              "example": {
                "id": "550e8400-e29b-41d4-a716-446655440000",
                "name": "My Email Campaign Project",
                "productId": "prod_2abc123def456",
                "createdAt": "2024-01-15T10:30:00Z",
                "updatedAt": "2024-01-15T10:30:00Z"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Organization product ID not found in auth profile"
          },
          "404": {
            "description": "Not found - Project not found or does not belong to the organization"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get a project by ID",
        "tags": [
          "Projects"
        ]
      },
      "patch": {
        "description": "\n    Update an existing project's details.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - Project must belong to the authenticated organization's product\n\n    **Path Parameters:**\n    - **id**: Project UUID (required)\n\n    **Request Body:**\n    - **name**: Updated project name (optional)\n\n    **Process:**\n    1. Validates product-level API key and extracts organizationProductId\n    2. Verifies project exists and belongs to the organization's product\n    3. Updates project fields\n    4. Returns updated project details\n\n    **Updatable Fields:**\n    - Project name\n    - Additional fields may be added in future versions\n\n    **Use Cases:**\n    - Rename projects\n    - Update project metadata\n    - Correct project information\n    ",
        "operationId": "ProjectsController_update",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Project UUID",
            "schema": {
              "example": "550e8400-e29b-41d4-a716-446655440000",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Project updated successfully",
            "schema": {
              "example": {
                "id": "550e8400-e29b-41d4-a716-446655440000",
                "name": "Updated Project Name",
                "productId": "prod_2abc123def456",
                "createdAt": "2024-01-15T10:30:00Z",
                "updatedAt": "2024-01-15T11:45:00Z"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid update data"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Organization product ID not found in auth profile"
          },
          "404": {
            "description": "Not found - Project not found or does not belong to the organization"
          },
          "409": {
            "description": "Conflict - Project with the same name already exists in this product"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Update a project",
        "tags": [
          "Projects"
        ]
      },
      "delete": {
        "description": "\n    Delete an existing project.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - Project must belong to the authenticated organization's product\n\n    **Path Parameters:**\n    - **id**: Project UUID (required)\n\n    **Process:**\n    1. Validates product-level API key and extracts organizationProductId\n    2. Verifies project exists and belongs to the organization's product\n    3. Deletes the project from the database\n    4. Returns success message\n\n    **Important Notes:**\n    - Deleting a project may affect associated domains\n    - This operation cannot be undone\n    - Ensure all domains are properly handled before deletion\n    - Consider archiving instead of deleting for audit purposes\n\n    **Use Cases:**\n    - Remove obsolete projects\n    - Clean up test projects\n    - Project lifecycle management\n    ",
        "operationId": "ProjectsController_remove",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Project UUID",
            "schema": {
              "example": "550e8400-e29b-41d4-a716-446655440000",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Project deleted successfully"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Organization product ID not found in auth profile"
          },
          "404": {
            "description": "Not found - Project not found or does not belong to the organization"
          },
          "409": {
            "description": "Conflict - A nameserver change is running on one or more of the project's domains (named in the message); nothing was deleted, try again in a few minutes. Or a domain refused its own delete for a reason listed under DELETE /domains; domains deleted before it stay deleted and the project is kept"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Delete a project",
        "tags": [
          "Projects"
        ]
      }
    },
    "/api/projects/{id}/domains": {
      "patch": {
        "description": "\n    Associate existing domains with a project. Automatically moves domains from other projects if needed.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - Project must belong to authenticated organization's product\n    - Domains must exist and belong to authenticated organization\n\n    **Path Parameters:**\n    - **id**: Project UUID (required)\n\n    **Request Body:**\n    - **domainNames**: Array of domain names to assign (required, minimum 1)\n\n    **Behavior:**\n    - **Idempotent**: Assigning already-assigned domains to the same project succeeds\n    - **Partial Success**: Individual domain failures don't fail entire operation\n    - **Automatic Reassignment**: Domains assigned to other projects will be automatically moved to the target project\n    - Returns detailed results for each domain with success/failure status\n    - Tracks previous project information for reassigned domains\n\n    **Response:**\n    - Updated project with new domain/mailbox counts\n    - Summary statistics (total, successful, failed, reassigned)\n    - Detailed per-domain results with reassignment info\n\n    **Use Cases:**\n    - Organize existing domains into project groups\n    - Reassign domains between projects for better organization\n    - Bulk assign multiple unassigned domains to a project\n    - Consolidate domains from multiple projects into one\n\n    **Error Handling:**\n    - Project not found: Returns 404\n    - Domain not found: Included in results array as failure\n    - Partial failures: Returns 200 with detailed breakdown\n    ",
        "operationId": "ProjectsController_assignDomains",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Project UUID",
            "schema": {
              "example": "550e8400-e29b-41d4-a716-446655440000",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignDomainsToProjectDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Domains assigned successfully (partial failures may exist in results)",
            "schema": {
              "example": {
                "project": {
                  "id": "550e8400-e29b-41d4-a716-446655440000",
                  "name": "My Email Campaign Project",
                  "productId": "prod_2abc123def456",
                  "domainsCount": 5,
                  "mailboxesCount": 12,
                  "createdAt": "2024-01-15T10:30:00Z",
                  "updatedAt": "2024-01-15T10:30:00Z"
                },
                "total": 4,
                "successful": 3,
                "failed": 1,
                "reassigned": 1,
                "results": [
                  {
                    "domainName": "example1.com",
                    "success": true
                  },
                  {
                    "domainName": "example2.com",
                    "success": true,
                    "previousProjectId": "660e8400-e29b-41d4-a716-446655440001",
                    "previousProjectName": "Old Project"
                  },
                  {
                    "domainName": "example3.com",
                    "success": false,
                    "error": "Domain not found or does not belong to this organization"
                  },
                  {
                    "domainName": "example4.com",
                    "success": true
                  }
                ]
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssignDomainsToProjectResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid input data (empty array, invalid domain names)"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Organization product ID not found in auth profile"
          },
          "404": {
            "description": "Not found - Project not found or does not belong to the organization"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Assign domains to a project",
        "tags": [
          "Projects"
        ]
      }
    },
    "/api/sending-identifiers": {
      "get": {
        "description": "\n    Every registered sending identifier for this product.\n\n    A sending identifier is an approved From address for the Transactional\n    (SES) product. API sends are rejected unless the from address resolves to\n    one of them.\n\n    It is **not a mailbox** — there is no inbox, no IMAP, no credentials and no\n    login behind it. It only records that this account may send as this\n    address, which is what makes a shared SES account safe: SES knows only that\n    a domain is verified, not which customer owns it.\n\n    Transactional only. Sales/Postal sending identity comes from real mailboxes\n    and is unaffected.\n\n    Each entry reports its domain's verification state and a `canSend` flag —\n    an identifier on a domain Amazon SES has not confirmed yet is registered\n    but cannot send.\n    ",
        "operationId": "SendingIdentifiersController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Sending identifiers for this product",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SendingIdentifierResponseDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "List sending identifiers",
        "tags": [
          "Sending Identifiers"
        ]
      },
      "post": {
        "description": "\n    Approve an address for sending.\n\n    A sending identifier is an approved From address for the Transactional\n    (SES) product. API sends are rejected unless the from address resolves to\n    one of them.\n\n    It is **not a mailbox** — there is no inbox, no IMAP, no credentials and no\n    login behind it. It only records that this account may send as this\n    address, which is what makes a shared SES account safe: SES knows only that\n    a domain is verified, not which customer owns it.\n\n    Transactional only. Sales/Postal sending identity comes from real mailboxes\n    and is unaffected.\n\n    **The domain does not have to be verified yet.** Amazon SES can take up to\n    72 hours to confirm a domain, and blocking registration until then would\n    send you away mid-setup. Register now; the send path enforces readiness,\n    and `canSend` tells you when it is usable.\n\n    **Requirements:**\n    - The address's domain must already be registered to your account\n    - The address must not already be registered\n\n    **Display name:** stored on the identifier and used for the `From:` header\n    of every message sent as it. A display name in the send request itself is\n    ignored.\n    ",
        "operationId": "SendingIdentifiersController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSendingIdentifierDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Sending identifier registered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendingIdentifierResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — invalid address, or not the Transactional product"
          },
          "401": {
            "description": ""
          },
          "403": {
            "description": "Forbidden — the address's domain is not registered to your account"
          },
          "409": {
            "description": "Conflict — this address is already registered"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Register a sending identifier",
        "tags": [
          "Sending Identifiers"
        ]
      }
    },
    "/api/sending-identifiers/{id}": {
      "get": {
        "description": "Fetch a single sending identifier belonging to this product.",
        "operationId": "SendingIdentifiersController_getById",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Sending identifier UUID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The sending identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendingIdentifierResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get a sending identifier",
        "tags": [
          "Sending Identifiers"
        ]
      },
      "patch": {
        "description": "\n    Only the display name is editable. Changing the address would silently\n    repoint every message already logged against this identifier, so that is a\n    delete plus a create.\n    ",
        "operationId": "SendingIdentifiersController_update",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Sending identifier UUID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSendingIdentifierDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sending identifier updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendingIdentifierResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Update a sending identifier's display name",
        "tags": [
          "Sending Identifiers"
        ]
      },
      "delete": {
        "description": "\n    Sends from this address stop immediately.\n\n    The record is soft-deleted rather than removed, so message logs that\n    reference it stay readable. The same address can be registered again\n    afterwards.\n    ",
        "operationId": "SendingIdentifiersController_remove",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Sending identifier UUID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sending identifier deleted",
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "message": "Sending identifier notifications@acme.com deleted"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Delete a sending identifier",
        "tags": [
          "Sending Identifiers"
        ]
      }
    },
    "/api/smtp-credentials": {
      "get": {
        "description": "\n    Every SMTP credential for this product, active and revoked, newest first.\n\n    An SMTP credential is a username and password your application presents\n    to the Mission Inbox SMTP relay instead of calling the send API. It is the\n    API key in another shape: anything that can send mail over SMTP -- an\n    application framework, a mail library, a Postfix relayhost -- can point\n    at the relay with these settings and keep its code unchanged.\n\n    Every credential is scoped to **one sending identifier**. A message\n    submitted with it must carry that identifier's address in the From\n    header (and in the Sender header, if one is set); anything else is\n    refused. The envelope sender your client uses in MAIL FROM is not\n    checked, because the relay sets its own return path. Messages go through\n    exactly the same checks, the same sending path and the same delivery,\n    bounce and complaint tracking as API sends.\n\n    Not a mailbox. There is no inbox, no IMAP and no login behind it.\n\n    Transactional only. Sales sends over SMTP from real mailboxes and is\n    unaffected.\n\n    The secret is never returned here. `secretHint` carries its last four\n    characters so credentials can be told apart; `lastUsedAt` and\n    `lastUsedIp` show where a credential was last accepted.\n    ",
        "operationId": "SmtpCredentialsController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "SMTP credentials for this product",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SmtpCredentialResponseDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "List SMTP credentials",
        "tags": [
          "SMTP Credentials"
        ]
      },
      "post": {
        "description": "\n    Mint a username and secret for one of your sending identifiers.\n\n    An SMTP credential is a username and password your application presents\n    to the Mission Inbox SMTP relay instead of calling the send API. It is the\n    API key in another shape: anything that can send mail over SMTP -- an\n    application framework, a mail library, a Postfix relayhost -- can point\n    at the relay with these settings and keep its code unchanged.\n\n    Every credential is scoped to **one sending identifier**. A message\n    submitted with it must carry that identifier's address in the From\n    header (and in the Sender header, if one is set); anything else is\n    refused. The envelope sender your client uses in MAIL FROM is not\n    checked, because the relay sets its own return path. Messages go through\n    exactly the same checks, the same sending path and the same delivery,\n    bounce and complaint tracking as API sends.\n\n    Not a mailbox. There is no inbox, no IMAP and no login behind it.\n\n    Transactional only. Sales sends over SMTP from real mailboxes and is\n    unaffected.\n\n    **The secret is shown once**, in this response. It is stored hashed and\n    cannot be retrieved afterwards; if it is lost, revoke the credential and\n    create another.\n\n    **Connection settings** are returned alongside it: the host, the STARTTLS\n    port and the implicit-TLS port. Authentication is PLAIN or LOGIN and is\n    only accepted over an encrypted connection.\n\n    **Limits:** each identifier may hold up to 10 active credentials, so a\n    rotation can run the old and new side by side. Each credential submits\n    at most `ratePerMinute` messages per minute; a client that exceeds it\n    receives a temporary 450 and should retry.\n    ",
        "operationId": "SmtpCredentialsController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSmtpCredentialDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "SMTP credential created; the secret appears here only",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmtpCredentialCreatedResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request — invalid payload, or not the Transactional product"
          },
          "401": {
            "description": ""
          },
          "403": {
            "description": ""
          },
          "404": {
            "description": "Not found — the sending identifier does not belong to this account"
          },
          "409": {
            "description": "Conflict — the identifier already holds the maximum number of active credentials"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Create an SMTP credential",
        "tags": [
          "SMTP Credentials"
        ]
      }
    },
    "/api/smtp-credentials/{id}": {
      "delete": {
        "description": "\n    Stop a credential from authenticating. Takes effect on the next\n    connection every relay node sees; sessions already authenticated are\n    refused at their next message.\n\n    Revoked credentials stay in the list with their last-used details, so a\n    leaked credential's history remains visible. Revoking twice is harmless.\n    ",
        "operationId": "SmtpCredentialsController_revoke",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "SMTP credential UUID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Credential revoked",
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "message": "SMTP credential mismtp_k3j9x2m8q1p7w4n6z0r5 revoked"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Revoke an SMTP credential",
        "tags": [
          "SMTP Credentials"
        ]
      }
    },
    "/api/dns-credentials": {
      "get": {
        "description": "\n    Lists your organization's active DNS provider keys, with secrets masked.\n\n    **How a key is used:** whenever a domain is added (`POST /api/domains/create`\n    or `/bulk-create`) or its records are pushed (`POST /api/domains/push-dns`\n    or `/bulk-push-dns`), Mission Inbox reads the domain's live nameservers,\n    picks the connected key for that DNS provider, and writes the domain's SPF,\n    DKIM, return path, MX and DMARC records with it. Connect the key of the\n    provider that **hosts the DNS** for your domains, which is not always the\n    registrar (a domain registered at GoDaddy but using Cloudflare nameservers\n    needs the Cloudflare key).\n\n    **Supported providers and what to send:**\n\n    | provider | apiKey | apiSecret |\n    |---|---|---|\n    | `CloudFlare` | Global API Key | Account email |\n    | `GoDaddy` | API key | API secret |\n    | `Porkbun` | API key | Secret API key |\n    | `Spaceship` | API key | API secret |\n    | `Dynadot` | API key | API secret |\n    | `Vercel` | Access token | Team ID (optional) |\n\n    Keys belong to your organization and are shared by all its products.\n    Secrets are never returned: responses show only their last 4 characters.\n",
        "operationId": "DnsCredentialsController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DnsCredentialDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "List DNS provider keys",
        "tags": [
          "DNS Provider Keys"
        ]
      },
      "post": {
        "description": "\n    Connects a DNS provider key so Mission Inbox can write your domains' email\n    DNS records automatically.\n\n    The key is checked against the provider before it is saved: a key the\n    provider refuses is rejected and nothing is stored. Domains added from now\n    on are pushed at creation. For domains you added before connecting the\n    key, call `POST /api/domains/bulk-push-dns`.\n\n    You can connect several keys, for several providers or several accounts at\n    one provider; each domain uses the key whose account holds it.\n\n    **How a key is used:** whenever a domain is added (`POST /api/domains/create`\n    or `/bulk-create`) or its records are pushed (`POST /api/domains/push-dns`\n    or `/bulk-push-dns`), Mission Inbox reads the domain's live nameservers,\n    picks the connected key for that DNS provider, and writes the domain's SPF,\n    DKIM, return path, MX and DMARC records with it. Connect the key of the\n    provider that **hosts the DNS** for your domains, which is not always the\n    registrar (a domain registered at GoDaddy but using Cloudflare nameservers\n    needs the Cloudflare key).\n\n    **Supported providers and what to send:**\n\n    | provider | apiKey | apiSecret |\n    |---|---|---|\n    | `CloudFlare` | Global API Key | Account email |\n    | `GoDaddy` | API key | API secret |\n    | `Porkbun` | API key | Secret API key |\n    | `Spaceship` | API key | API secret |\n    | `Dynadot` | API key | API secret |\n    | `Vercel` | Access token | Team ID (optional) |\n\n    Keys belong to your organization and are shared by all its products.\n    Secrets are never returned: responses show only their last 4 characters.\n",
        "operationId": "DnsCredentialsController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDnsCredentialDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Connected; secrets masked in the response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DnsCredentialDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Missing fields, unknown provider, or the provider refused the key"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden"
          },
          "502": {
            "description": "Bad gateway - The provider could not be reached to check the key; try again"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Connect a DNS provider key",
        "tags": [
          "DNS Provider Keys"
        ]
      }
    },
    "/api/dns-credentials/{id}": {
      "get": {
        "description": "One of your DNS provider keys, with secrets masked.",
        "operationId": "DnsCredentialsController_get",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "DNS provider key id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DnsCredentialDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found - No such key in your organization"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get a DNS provider key",
        "tags": [
          "DNS Provider Keys"
        ]
      },
      "put": {
        "description": "Renames, replaces the secrets of, or deactivates a key. New secrets are checked against the provider before they are saved. The provider cannot be changed: connect a new key instead. A key Mission Inbox is using to manage your nameservers is locked and answers 409.",
        "operationId": "DnsCredentialsController_update",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "DNS provider key id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDnsCredentialDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DnsCredentialDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Missing fields, unknown provider, or the provider refused the key"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found - No such key in your organization"
          },
          "409": {
            "description": "Conflict - The key is locked while Mission Inbox uses it to manage nameservers"
          },
          "502": {
            "description": "Bad gateway - The provider could not be reached to check the key; try again"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Update a DNS provider key",
        "tags": [
          "DNS Provider Keys"
        ]
      },
      "delete": {
        "description": "Removes a key. Records already written stay at the provider; domains that used this key are no longer pushed automatically. A locked key answers 409.",
        "operationId": "DnsCredentialsController_remove",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "DNS provider key id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "DNS credential deleted successfully"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found - No such key in your organization"
          },
          "409": {
            "description": "Conflict - The key is locked while Mission Inbox uses it to manage nameservers"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Remove a DNS provider key",
        "tags": [
          "DNS Provider Keys"
        ]
      }
    },
    "/api/webhooks": {
      "get": {
        "description": "\n    Every webhook endpoint configured for this product, including paused ones.\n    Each entry includes its signing secret.\n\n    Available to the Transactional product, for every event type, and to the\n    Sales product, for `domain.*` events only. Sales delivery events come\n    from Postal's own webhooks and are configured elsewhere.\n",
        "operationId": "TransactionalWebhooksController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Webhook endpoints for this product",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WebhookResponseDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "422": {
            "description": "Unprocessable Entity"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "List webhook endpoints",
        "tags": [
          "Webhooks"
        ]
      },
      "post": {
        "description": "\n    Registers an HTTPS endpoint to push delivery events to, and returns its\n    signing secret. Up to 10 endpoints per product.\n\n    The URL must be HTTPS and publicly resolvable — loopback, link-local,\n    private and internal addresses are rejected.\n\n    Available to the Transactional product, for every event type, and to the\n    Sales product, for `domain.*` events only. Sales delivery events come\n    from Postal's own webhooks and are configured elsewhere.\n\n\n    | Event | When |\n    |---|---|\n    | `domain.dns_change_required` | A change on our side means records you publish for a domain must change — see below. Transactional and Sales. |\n    | `message.sent` | Amazon SES accepted the message for delivery. |\n    | `message.delivered` | The receiving mail server accepted it. |\n    | `message.bounced` | Delivery failed. `data.bounceType` is `Permanent`, `Transient` or `Undetermined` — only `Permanent` means the address is dead. |\n    | `message.complained` | The recipient marked it as spam. |\n    | `message.rejected` | SES refused the message outright, usually for its content. |\n    | `message.delayed` | Delivery has not succeeded yet and SES is still trying. Not a final outcome. |\n    | `message.opened` | The tracking image in the message was loaded. Only sent when open tracking was on for that send. Approximate: some mail apps load images before anyone reads the message. `data.userAgent` and `data.ipAddress` say which client loaded it. |\n    | `message.clicked` | A tracked link was followed. Only sent when click tracking was on for that send. `data.url` is the address the reader was sent on to, with `data.userAgent` and `data.ipAddress`. |\n\n    Every `message.*` event is Transactional only.\n\n\n    ### What we send\n\n    `POST` with `Content-Type: application/json` and these headers:\n\n    | Header | Meaning |\n    |---|---|\n    | `X-MI-Signature` | `t=<unix>,v1=<hex>` — see below. |\n    | `X-MI-Delivery-Id` | Stable id for this event. Your deduplication key. |\n    | `X-MI-Event-Type` | Same as `type` in the body, for routing without parsing. |\n\n    ```json\n    {\n      \"id\": \"0f8c4c1e-2d3b-4a5f-9c7e-1b2a3c4d5e6f\",\n      \"type\": \"message.bounced\",\n      \"version\": 1,\n      \"test\": false,\n      \"createdAt\": \"2026-09-04T10:15:32.000Z\",\n      \"data\": {\n        \"messageId\": 918273,\n        \"sesMessageId\": \"0100019...-000000\",\n        \"rfcMessageId\": \"<abc@acme.com>\",\n        \"recipient\": \"someone@example.com\",\n        \"occurredAt\": \"2026-09-04T10:15:30.000Z\",\n        \"status\": \"HardFail\",\n        \"subject\": \"Reset your password\",\n        \"from\": \"notifications@acme.com\",\n        \"to\": \"someone@example.com\",\n        \"tag\": \"password-reset\",\n        \"bounceType\": \"Permanent\",\n        \"bounceSubType\": \"General\",\n        \"diagnosticCode\": \"smtp; 550 5.1.1 user unknown\"\n      }\n    }\n    ```\n\n    `version` is the payload version, currently 1. `test` is true only on\n    a sample from the test endpoint — never act on one.\n\n    Fields may be added to `data` without notice; nothing documented here is\n    removed or renamed without a new `version`.\n\n\n    ### `domain.dns_change_required`\n\n    Sent when a change on our side — moving a domain to another sending\n    server, or a change to the server's IP pool — means records you publish\n    for the domain must change. Sent when you publish the records\n    yourself (`data.trigger: \"platform_change\"`), and when we hold a DNS key\n    for the domain but the provider kept refusing our update through our\n    retries (`\"auto_update_failed\"`, with the refusal in `data.error`). Never sent\n    for a failed verification check or a slow DNS propagation: it means a\n    record's required value changed, not that a check failed.\n\n    When we hold a DNS key for the domain and our update succeeds, nothing is\n    sent: there is nothing for you to do. We never delete records at your DNS\n    provider; a record a change makes unnecessary, such as an old DKIM\n    selector, stays where it is, and nothing reads it. Domains whose DNS Mission Inbox runs\n    — leased domains and domains on our nameservers — never send this.\n\n    The new values are already in effect when we send this; there is no\n    advance warning. It is usually sent within minutes of the change, and at\n    most about two hours later when a DNS provider is failing and we retry.\n    `data.effectiveAt` is when we confirmed the change. One event per domain\n    per change, listing\n    every record of that domain to create, update or delete.\n    `data.changeId` identifies that one domain's change: it is the same on\n    every endpoint the event is sent to, and different for every domain.\n\n    ```json\n    {\n      \"id\": \"6a1d8f2e-3c4b-4e5f-8a9b-0c1d2e3f4a5b\",\n      \"type\": \"domain.dns_change_required\",\n      \"version\": 1,\n      \"test\": false,\n      \"createdAt\": \"2026-10-05T09:00:02.000Z\",\n      \"data\": {\n        \"changeId\": \"b3e1c2d4-5f6a-4b7c-8d9e-0f1a2b3c4d5e\",\n        \"domainId\": \"1c2d3e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f\",\n        \"domain\": \"mail.acme.com\",\n        \"reason\": \"sending_account_switched\",\n        \"trigger\": \"platform_change\",\n        \"error\": null,\n        \"records\": [\n          {\n            \"type\": \"TXT\",\n            \"name\": \"mail.acme.com\",\n            \"action\": \"update\",\n            \"previousValue\": \"v=spf1 a mx include:spf.old.example.net ~all\",\n            \"newValue\": \"v=spf1 a mx include:spf.new.example.net ~all\"\n          },\n          {\n            \"type\": \"CNAME\",\n            \"name\": \"psrp.mail.acme.com\",\n            \"action\": \"update\",\n            \"previousValue\": \"rp.old.example.net\",\n            \"newValue\": \"rp.new.example.net\"\n          }\n        ],\n        \"effectiveAt\": \"2026-10-05T09:00:00.000Z\",\n        \"impact\": \"SPF and return-path checks fail until these records are updated.\"\n      }\n    }\n    ```\n\n    `data.reason` is `sending_account_switched` or `ip_pool_changed`;\n    `dkim_scheme_changed` is reserved, for a server whose DKIM scheme\n    changes, which is not done while it has domains. Each record's `action` is `create`, `update`\n    or `delete`; `previousValue` is null on a create and `newValue` is\n    null on a delete. MX records also carry `priority`.\n\n\n    ### Verifying the signature\n\n    Every request carries `X-MI-Signature`:\n\n    ```\n    X-MI-Signature: t=1772000000,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd\n    ```\n\n    `t` is the Unix timestamp at signing and `v1` is\n    `HMAC-SHA256(secret, \"{t}.{raw body}\")` in lowercase hex. The timestamp is\n    part of the signed string, so it cannot be altered independently.\n\n    To verify:\n\n    1. Read the **raw** request body, before any JSON parsing. Re-serialising\n       parsed JSON will not reproduce the same bytes and the signature will not\n       match.\n    2. Recompute the HMAC with your endpoint's secret and compare it to `v1`\n       using a constant-time comparison.\n    3. Reject the request if `t` is more than a few minutes old, which is what\n       stops a captured request being replayed at you later.\n\n    ```js\n    const crypto = require('crypto');\n\n    function verify(rawBody, header, secret) {\n      const parts = Object.fromEntries(header.split(',').map(p => p.split('=')));\n      const age = Math.abs(Math.floor(Date.now() / 1000) - Number(parts.t));\n      if (!Number.isFinite(Number(parts.t)) || age > 300) return false;\n\n      const expected = crypto\n        .createHmac('sha256', secret)\n        .update(`${parts.t}.${rawBody}`)\n        .digest('hex');\n\n      const a = Buffer.from(expected);\n      const b = Buffer.from(parts.v1 ?? '');\n      return a.length === b.length && crypto.timingSafeEqual(a, b);\n    }\n    ```\n\n    Rotating the secret takes effect immediately — the next delivery is signed\n    with the new one, with no overlap — so deploy the new secret to your handler\n    at the same time you rotate.\n\n\n    ### Delivery semantics\n\n    **At-least-once.** You may receive the same event more than once, and you\n    must handle that. Deduplicate on the `id` field of the body (also sent as\n    the `X-MI-Delivery-Id` header), which is stable across every retry of the\n    same event to the same endpoint. If two of your endpoints receive\n    `domain.dns_change_required`, deduplicate across them on\n    `data.changeId`.\n\n    **Order is not guaranteed.** Amazon delivers its delivery events to us\n    unordered, our retries re-order any event again, and an open or a click\n    happens whenever the reader gets to it. A `message.delivered` can arrive\n    after a `message.bounced` for the same message. Treat each event as a fact about a\n    moment — `data.occurredAt` — rather than as the message's current state;\n    `data.status` carries our own projection of that state if you want it.\n\n    **Retries.** A delivery is attempted immediately, then retried after 10s,\n    30s, 2m, 10m, 30m and 1h — seven attempts over about an hour and three\n    quarters. Any 2xx is a success; anything else, including a timeout, is\n    retried. Redirects are not followed: a 3xx is a failed attempt, so\n    register the final URL. We wait 10 seconds for a response, so acknowledge first and do\n    your work asynchronously.\n\n    **Dead letters.** After the last attempt a delivery becomes `dead` and\n    nothing further is sent automatically. It stays in the log, and\n    `POST /api/webhooks/deliveries/{deliveryId}/retry` replays it with the\n    original body once your handler is fixed.\n\n    **Pausing.** A paused endpoint receives nothing, and events that occur while\n    it is paused are not queued for later. Pause is for silencing a broken\n    handler, not for buffering.\n",
        "operationId": "TransactionalWebhooksController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created endpoint, including its signing secret",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "422": {
            "description": "Unprocessable Entity"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Create a webhook endpoint",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/api/webhooks/deliveries": {
      "get": {
        "description": "\n    The delivery log: one entry per event per endpoint, newest first, with the\n    body we sent, the number of attempts, and what your endpoint replied.\n\n    Filter with `status=dead` for the dead-letter list — deliveries that\n    exhausted every retry and are waiting for you to replay them.\n\n    ### Delivery semantics\n\n    **At-least-once.** You may receive the same event more than once, and you\n    must handle that. Deduplicate on the `id` field of the body (also sent as\n    the `X-MI-Delivery-Id` header), which is stable across every retry of the\n    same event to the same endpoint. If two of your endpoints receive\n    `domain.dns_change_required`, deduplicate across them on\n    `data.changeId`.\n\n    **Order is not guaranteed.** Amazon delivers its delivery events to us\n    unordered, our retries re-order any event again, and an open or a click\n    happens whenever the reader gets to it. A `message.delivered` can arrive\n    after a `message.bounced` for the same message. Treat each event as a fact about a\n    moment — `data.occurredAt` — rather than as the message's current state;\n    `data.status` carries our own projection of that state if you want it.\n\n    **Retries.** A delivery is attempted immediately, then retried after 10s,\n    30s, 2m, 10m, 30m and 1h — seven attempts over about an hour and three\n    quarters. Any 2xx is a success; anything else, including a timeout, is\n    retried. Redirects are not followed: a 3xx is a failed attempt, so\n    register the final URL. We wait 10 seconds for a response, so acknowledge first and do\n    your work asynchronously.\n\n    **Dead letters.** After the last attempt a delivery becomes `dead` and\n    nothing further is sent automatically. It stays in the log, and\n    `POST /api/webhooks/deliveries/{deliveryId}/retry` replays it with the\n    original body once your handler is fixed.\n\n    **Pausing.** A paused endpoint receives nothing, and events that occur while\n    it is paused are not queued for later. Pause is for silencing a broken\n    handler, not for buffering.\n",
        "operationId": "TransactionalWebhooksController_listAllDeliveries",
        "parameters": [
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Only deliveries in this state. `dead` is the dead-letter list.",
            "schema": {
              "enum": [
                "pending",
                "succeeded",
                "failed",
                "dead"
              ],
              "type": "string"
            }
          },
          {
            "name": "eventType",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "message.sent",
                "message.delivered",
                "message.bounced",
                "message.complained",
                "message.rejected",
                "message.delayed",
                "message.opened",
                "message.clicked",
                "domain.dns_change_required"
              ]
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "type": "number"
            }
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 0,
              "default": 0,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deliveries, newest first, with the total matching the filter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deliveries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookDeliveryResponseDto"
                      }
                    },
                    "total": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Unprocessable Entity"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "List webhook deliveries",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/api/webhooks/deliveries/{deliveryId}": {
      "get": {
        "description": "One delivery, including the exact body that was signed and sent.",
        "operationId": "TransactionalWebhooksController_getDelivery",
        "parameters": [
          {
            "name": "deliveryId",
            "required": true,
            "in": "path",
            "description": "Delivery UUID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Unprocessable Entity"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get a webhook delivery",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/api/webhooks/deliveries/{deliveryId}/retry": {
      "post": {
        "description": "\n    Queues a settled delivery to be attempted again with the **original** body\n    — replaying reproduces the event you missed, not a fresh snapshot of a\n    message whose status has since moved on.\n\n    The retry schedule starts over from the beginning. The endpoint must not be\n    paused or deleted. A delivery that is still `pending` is rejected, since\n    an attempt is already coming.\n",
        "operationId": "TransactionalWebhooksController_retryDelivery",
        "parameters": [
          {
            "name": "deliveryId",
            "required": true,
            "in": "path",
            "description": "Delivery UUID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Queued for another attempt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Unprocessable Entity"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Replay a webhook delivery",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/api/webhooks/{id}": {
      "get": {
        "description": "Fetch one webhook endpoint belonging to this product.",
        "operationId": "TransactionalWebhooksController_getById",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Webhook endpoint UUID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Unprocessable Entity"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get a webhook endpoint",
        "tags": [
          "Webhooks"
        ]
      },
      "patch": {
        "description": "\n    Change the name, URL, subscribed events, or paused state. Omitted fields are\n    left alone. The secret is rotated through its own endpoint.\n\n    Pausing takes effect immediately; events that occur while paused are not\n    queued for later.\n",
        "operationId": "TransactionalWebhooksController_update",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Webhook endpoint UUID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Unprocessable Entity"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Update a webhook endpoint",
        "tags": [
          "Webhooks"
        ]
      },
      "delete": {
        "description": "\n    Stops delivery to this endpoint. Its delivery log is kept, so you can still\n    investigate what happened before it was removed. To stop delivery\n    temporarily instead, pause it with `PATCH` and `active: false`.\n",
        "operationId": "TransactionalWebhooksController_remove",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Webhook endpoint UUID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Unprocessable Entity"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Delete a webhook endpoint",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/api/webhooks/{id}/deliveries": {
      "get": {
        "description": "\n    The delivery log: one entry per event per endpoint, newest first, with the\n    body we sent, the number of attempts, and what your endpoint replied.\n\n    Filter with `status=dead` for the dead-letter list — deliveries that\n    exhausted every retry and are waiting for you to replay them.\n\n    ### Delivery semantics\n\n    **At-least-once.** You may receive the same event more than once, and you\n    must handle that. Deduplicate on the `id` field of the body (also sent as\n    the `X-MI-Delivery-Id` header), which is stable across every retry of the\n    same event to the same endpoint. If two of your endpoints receive\n    `domain.dns_change_required`, deduplicate across them on\n    `data.changeId`.\n\n    **Order is not guaranteed.** Amazon delivers its delivery events to us\n    unordered, our retries re-order any event again, and an open or a click\n    happens whenever the reader gets to it. A `message.delivered` can arrive\n    after a `message.bounced` for the same message. Treat each event as a fact about a\n    moment — `data.occurredAt` — rather than as the message's current state;\n    `data.status` carries our own projection of that state if you want it.\n\n    **Retries.** A delivery is attempted immediately, then retried after 10s,\n    30s, 2m, 10m, 30m and 1h — seven attempts over about an hour and three\n    quarters. Any 2xx is a success; anything else, including a timeout, is\n    retried. Redirects are not followed: a 3xx is a failed attempt, so\n    register the final URL. We wait 10 seconds for a response, so acknowledge first and do\n    your work asynchronously.\n\n    **Dead letters.** After the last attempt a delivery becomes `dead` and\n    nothing further is sent automatically. It stays in the log, and\n    `POST /api/webhooks/deliveries/{deliveryId}/retry` replays it with the\n    original body once your handler is fixed.\n\n    **Pausing.** A paused endpoint receives nothing, and events that occur while\n    it is paused are not queued for later. Pause is for silencing a broken\n    handler, not for buffering.\n",
        "operationId": "TransactionalWebhooksController_listDeliveries",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Only deliveries in this state. `dead` is the dead-letter list.",
            "schema": {
              "enum": [
                "pending",
                "succeeded",
                "failed",
                "dead"
              ],
              "type": "string"
            }
          },
          {
            "name": "eventType",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "message.sent",
                "message.delivered",
                "message.bounced",
                "message.complained",
                "message.rejected",
                "message.delayed",
                "message.opened",
                "message.clicked",
                "domain.dns_change_required"
              ]
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "type": "number"
            }
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 0,
              "default": 0,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deliveries, newest first, with the total matching the filter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deliveries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookDeliveryResponseDto"
                      }
                    },
                    "total": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Unprocessable Entity"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "List webhook deliveries",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/api/webhooks/{id}/test": {
      "post": {
        "description": "\n    Sends a sample event to this endpoint now, signed with its secret, and\n    returns the result: the status your endpoint answered with and the start\n    of its response body.\n\n    The sample has `test: true` and ids that match nothing of yours. It is\n    attempted once and never retried; a test your endpoint does not accept is\n    `failed`. It appears in the delivery log like any other delivery.\n\n    `eventType` defaults to the first type the endpoint subscribes to. A\n    paused endpoint can be tested, so you can check a handler before resuming\n    it. We wait up to 10 seconds for your endpoint. At most 10 tests per\n    minute per product.\n",
        "operationId": "TransactionalWebhooksController_sendTest",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Webhook endpoint UUID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestWebhookDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The test delivery and what your endpoint answered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "429": {
            "description": "More than 10 tests in the last minute"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Send a test event",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/api/webhooks/{id}/rotate-secret": {
      "post": {
        "description": "\n    Issues a new signing secret and returns it.\n\n    There is no overlap: the next delivery is signed with the new secret, so\n    update your handler at the same time. A grace period during which the old\n    secret still verified would leave a leaked secret usable, which defeats the\n    purpose of rotating.\n",
        "operationId": "TransactionalWebhooksController_rotateSecret",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Webhook endpoint UUID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "The endpoint with its new secret",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Unprocessable Entity"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Rotate the signing secret",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/api/email/send": {
      "post": {
        "description": "\n    Send email messages using OBM server infrastructure.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - Organization must have verified domains registered\n    - At least one recipient (to/cc/bcc) must be specified\n    - At least one body content (plain_body or html_body) must be provided\n\n    **Authentication:**\n    - Requires **product-level API key** in X-Server-API-Key header\n    - API key automatically determines the sending account to use\n    - Sending account information is embedded in the API key\n    \n    **Email Sending Process:**\n    1. Validates authentication and organization permissions\n    2. Verifies sender domain is registered and verified\n    3. Processes email content and attachments\n    4. Routes email through assigned OBM server\n    5. Returns delivery status and message ID\n\n    **Which id to use next:**\n    - `messageId` — the RFC 822 Message-ID header. Pass this to\n      `POST /api/email/status` and `POST /api/email/bulk_status`.\n    - `id` — pass this to `POST /api/email/details`.\n\n    On Transactional these are two different values: `id` is the numeric\n    message id and `messageId` is the header. On Sales they are the same\n    string. Using `messageId` for status lookups works on both.\n    \n    **Recipient Limits:**\n    - Maximum 50 recipients per field (to/cc/bcc)\n    - Total recipients across all fields should not exceed reasonable limits\n    \n    **Domain Requirements:**\n    - From address domain must be registered and verified\n    - DNS records must be properly configured\n    - Domain verification status checked before sending\n    \n    **Content Types:**\n    - Plain text emails (plain_body)\n    - HTML emails (html_body)\n    - Mixed content (both plain and HTML)\n    - File attachments with base64 encoding\n\n    **Open and click tracking (Transactional only):**\n    - `track_opens` adds a one-pixel image to the HTML part; loading it records an open\n    - `track_clicks` rewrites the http and https links in the HTML part through the tracking domain, which records the click and sends the reader straight on to the original address\n    - Leave both out to use the account defaults from the transactional settings, which are off until turned on; set either to override the default for this send, for example off on a password reset\n    - Plain-text parts are never changed, and a send with no HTML part is never tracked\n    - A single link opts out with a `data-no-track` attribute on its anchor tag\n    - Opens are approximate: some mail apps load images before anyone reads the message\n    - Mail submitted over SMTP is passed on byte for byte and is never tracked\n    \n    **Use Cases:**\n    - Transactional emails (confirmations, notifications)\n    - Marketing campaigns (with proper opt-in)\n    - System-generated messages\n    - Customer communications\n    ",
        "operationId": "EmailController_sendMessage",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendMessageDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email sent successfully",
            "schema": {
              "example": {
                "id": "27",
                "messageId": "<6c6c162e-1234-abcd-ef01-23456789abcd@example.com>",
                "message": "Email sent",
                "status": "sent",
                "time": 1705320600000
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendMessageResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Missing recipients, content, or invalid format"
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key"
          },
          "403": {
            "description": "Forbidden - Domain not verified or not authorized for organization, or (Transactional) a recipient is on the suppression list"
          },
          "422": {
            "description": "Unprocessable entity - Email validation failed or attachment issues"
          },
          "429": {
            "description": "Rate limit exceeded - Too many emails sent"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Send email message",
        "tags": [
          "Email"
        ]
      }
    },
    "/api/email/send-limit-status": {
      "get": {
        "description": "\n    Returns the current product's send limit status -- both the daily and\n    monthly caps. Only the Transactional Free plan enforces any cap today --\n    every other plan/product returns limited: false with both windows null.\n\n    **Authentication:**\n    - Requires **product-level API key** in X-Server-API-Key header\n\n    **Response:**\n    - limited: whether this plan enforces any send cap at all\n    - daily: { limit, sent, remaining, limitReached, resetsAt } -- resets at midnight UTC\n    - monthly: { limit, sent, remaining, limitReached, resetsAt } -- resets at the subscription's billing period end\n    ",
        "operationId": "EmailController_getSendLimitStatus",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Send limit status retrieved successfully",
            "schema": {
              "example": {
                "limited": true,
                "daily": {
                  "limit": 20,
                  "sent": 20,
                  "remaining": 0,
                  "limitReached": true,
                  "resetsAt": "2026-08-14T00:00:00.000Z"
                },
                "monthly": {
                  "limit": 600,
                  "sent": 340,
                  "remaining": 260,
                  "limitReached": false,
                  "resetsAt": "2026-09-01T00:00:00.000Z"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendLimitStatusDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Organization product ID could not be resolved"
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get send limit status",
        "tags": [
          "Email"
        ]
      }
    },
    "/api/email/status": {
      "post": {
        "description": "\n    Get the status of a sent email message by its message ID.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - Message ID must be valid and belong to the organization\n\n    **Authentication:**\n    - Requires **product-level API key** in X-Server-API-Key header\n    - API key automatically determines the sending account to query\n\n    **Parameters:**\n    - messageId: The RFC 822 Message-ID header value to look up — the\n      `messageId` field from the send response, **not** the numeric `id`.\n      `POST /api/email/details` is the endpoint that takes `id`.\n\n    **Response:**\n    - Returns detailed message status information\n    - Includes delivery status, timestamps, and message details\n    ",
        "operationId": "EmailController_getMessageStatus",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageStatusRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message status retrieved successfully",
            "schema": {
              "example": {
                "id": "message-id@example.com",
                "token": "abc123def456",
                "status": "sent",
                "last_delivery_attempt": 1705320600,
                "held": false,
                "rcpt_to": "recipient@example.com",
                "mail_from": "sender@example.com",
                "subject": "Test Email",
                "timestamp": 1705320600,
                "direction": "outgoing",
                "size": 1024,
                "bounce": false,
                "tag": "newsletter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageStatusResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid message ID or server ID format"
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key"
          },
          "403": {
            "description": "Forbidden - Server not authorized or not accessible"
          },
          "404": {
            "description": "Not found - No message has this Message-ID"
          },
          "422": {
            "description": "Unprocessable entity - Failed to retrieve message status"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get message status",
        "tags": [
          "Email"
        ]
      }
    },
    "/api/email/bulk_status": {
      "post": {
        "description": "\n    Get the status of multiple sent email messages by their message IDs.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - Message IDs must be valid and belong to the organization\n\n    **Authentication:**\n    - Requires **product-level API key** in X-Server-API-Key header\n    - API key automatically determines the sending account to query\n\n    **Parameters:**\n    - messageIds: Array of RFC 822 Message-ID header values to look up — the\n      `messageId` field from each send response, **not** the numeric `id`\n\n    **Response:**\n    - Returns array of message statuses in the same order as requested\n    - null values for messages not found\n    ",
        "operationId": "EmailController_getBulkMessageStatus",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkMessageStatusRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bulk message status retrieved successfully",
            "schema": {
              "example": {
                "statuses": [
                  {
                    "id": "message-id1@example.com",
                    "token": "abc123def456",
                    "status": "sent",
                    "last_delivery_attempt": 1705320600,
                    "held": false,
                    "rcpt_to": "recipient1@example.com",
                    "mail_from": "sender@example.com",
                    "subject": "Test Email 1",
                    "timestamp": 1705320600,
                    "direction": "outgoing",
                    "size": 1024,
                    "bounce": false,
                    "tag": "newsletter"
                  },
                  null,
                  {
                    "id": "message-id3@example.com",
                    "token": "def456ghi789",
                    "status": "delivered",
                    "last_delivery_attempt": 1705320700,
                    "held": false,
                    "rcpt_to": "recipient3@example.com",
                    "mail_from": "sender@example.com",
                    "subject": "Test Email 3",
                    "timestamp": 1705320700,
                    "direction": "outgoing",
                    "size": 2048,
                    "bounce": false,
                    "tag": "transactional"
                  }
                ]
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkMessageStatusResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid message IDs or server ID format"
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key"
          },
          "403": {
            "description": "Forbidden - Server not authorized or not accessible"
          },
          "422": {
            "description": "Unprocessable entity - Failed to retrieve bulk message status"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get bulk message status",
        "tags": [
          "Email"
        ]
      }
    },
    "/api/email/search": {
      "post": {
        "description": "\n    Search for email messages with various filter criteria.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - Messages must belong to the organization\n\n    **Authentication:**\n    - Requires **product-level API key** in X-Server-API-Key header\n    - API key automatically determines the sending account to query\n\n    **Filter Parameters:**\n    - from: Filter by sender email address (partial match)\n    - to: Filter by recipient email address (partial match)\n    - message_id: Filter by Message-ID header\n    - status: Filter by message status (Pending, Sent, SoftFail, HardFail, Held, Bounced, HoldCancelled)\n    - keyword: Search keyword in subject or body\n\n    **Pagination:**\n    - page: Page number (default: 1)\n    - limit: Results per page (default: 30, max: 100)\n    - order: Sort order - 'oldest-first' or 'newest-first' (default: 'newest-first')\n\n    **Response:**\n    - Returns paginated list of messages matching the search criteria\n    - Includes message details like id, token, status, from, to, subject, timestamp, etc.\n    ",
        "operationId": "EmailController_searchMessages",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchMessagesRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Messages retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "data": [
                      {
                        "id": 12345,
                        "token": "abc123def456",
                        "message_id": "message-id@example.com",
                        "status": "Sent",
                        "from": "sender@example.com",
                        "to": "recipient@example.com",
                        "subject": "Test Email Subject",
                        "timestamp": 1705320600,
                        "direction": "outgoing",
                        "size": 1024,
                        "held": false,
                        "hold_expiry": null,
                        "tag": "newsletter"
                      }
                    ],
                    "total": 150,
                    "page": 1,
                    "limit": 30,
                    "totalPages": 5
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid query parameters"
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key"
          },
          "403": {
            "description": "Forbidden - Not authorized to access messages"
          },
          "422": {
            "description": "Unprocessable entity - Failed to search messages"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Search email messages",
        "tags": [
          "Email"
        ]
      }
    },
    "/api/email/details": {
      "post": {
        "description": "\n    Returns comprehensive details about a specific message, equivalent to all the information\n    visible in the Postal web interface message details page. This endpoint provides data from\n    all UI tabs in a single response: Properties, Activity, Headers, Spam Checks, Content, and Attachments.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - Message must belong to the organization's sending account\n\n    **Authentication:**\n    - Requires **product-level API key** in X-Server-API-Key header\n    - API key automatically determines the sending account to query\n\n    **Parameters:**\n    - **id** (required): The internal ID of the message\n    - **include** (optional): Comma-separated list of sections to include.\n      Options: properties, activity, headers, spam_checks, content, attachments.\n      Default: all sections\n\n    **Response Sections:**\n\n    **Properties Section:**\n    - status - Current message status\n    - subject - Message subject line\n    - from/to - Sender and recipient addresses\n    - message_id - Email Message-ID header\n    - timestamp - When the message was created\n    - direction - \"incoming\" or \"outgoing\"\n    - size - Message size in bytes\n    - spam_status/spam_score - Spam detection results\n    - tag - Message tag for categorization\n    - bounce - Whether this is a bounce message\n    - threat/threat_details - Threat detection information\n    - received_with_ssl - Whether received over SSL\n    - raw_message_available - Whether raw message is still stored\n    - held/hold_expiry - Hold status and expiry\n    - last_delivery_attempt - Last delivery timestamp\n    - route/domain/credential - Associated objects\n\n    **Activity Section:**\n    - deliveries - Array of delivery attempts with status, details, and timestamps\n    - clicks - Array of link click events with URLs and user information\n    - loads - Array of email open/load events with user information\n\n    **Headers Section:**\n    - Complete email headers as received or generated (key-value pairs)\n\n    **Spam Checks Section:**\n    - Results from spam filtering systems with scores and details\n\n    **Content Section:**\n    - plain_body - Plain text version\n    - html_body - HTML version with tracking\n    - html_body_without_tracking - HTML version without tracking images\n\n    **Attachments Section:**\n    - index - Attachment index for downloading\n    - filename - Original filename\n    - content_type - MIME type\n    - size - File size in bytes\n    - hash - SHA1 hash of file content\n    - download_url - URL to download the attachment\n\n    **Usage Notes:**\n    - Use the include parameter to only fetch the sections you need for better performance\n    - Attachment file data is not included in the response; use the provided download URLs\n    - Sections may be empty or contain null values if data is not available\n    ",
        "operationId": "EmailController_getMessageDetails",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetMessageDetailsRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message details retrieved successfully",
            "schema": {
              "example": {
                "message": {
                  "id": 12345,
                  "token": "abc123def456",
                  "properties": {
                    "status": "Sent",
                    "subject": "Welcome to our service!",
                    "from": "welcome@yourdomain.com",
                    "to": "customer@example.com",
                    "message_id": "59656a26-efc4-49fa-add5-47c2868405aa@rp.postal.mymissioninbox.com",
                    "timestamp": 1642766400,
                    "direction": "outgoing",
                    "size": 15420,
                    "spam_status": "NotSpam",
                    "spam_score": 0.1,
                    "tag": "onboarding",
                    "bounce": false,
                    "bounce_for_id": null,
                    "threat": null,
                    "threat_details": null,
                    "received_with_ssl": true,
                    "raw_message_available": true,
                    "held": false,
                    "hold_expiry": null,
                    "last_delivery_attempt": 1642766405,
                    "route": {
                      "id": 1,
                      "name": "Default Route"
                    },
                    "domain": {
                      "id": 5,
                      "name": "yourdomain.com"
                    },
                    "credential": {
                      "id": 3,
                      "name": "API Key"
                    }
                  },
                  "activity": {
                    "deliveries": [
                      {
                        "id": 67890,
                        "status": "Sent",
                        "details": "Message delivered successfully",
                        "output": "250 2.0.0 OK: queued as 1A2B3C4D",
                        "sent_with_ssl": true,
                        "log_id": "smtp-log-123",
                        "time": 1642766405,
                        "timestamp": 1642766405
                      }
                    ],
                    "clicks": [
                      {
                        "url": "https://yourdomain.com/welcome",
                        "ip_address": "192.168.1.100",
                        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
                        "timestamp": 1642766500
                      }
                    ],
                    "loads": [
                      {
                        "ip_address": "192.168.1.100",
                        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
                        "timestamp": 1642766450
                      }
                    ]
                  },
                  "headers": {
                    "From": [
                      "welcome@yourdomain.com"
                    ],
                    "To": [
                      "customer@example.com"
                    ],
                    "Subject": [
                      "Welcome to our service!"
                    ],
                    "Date": [
                      "Fri, 21 Jan 2022 14:00:00 +0000"
                    ],
                    "Message-ID": [
                      "59656a26-efc4-49fa-add5-47c2868405aa@rp.postal.mymissioninbox.com"
                    ],
                    "MIME-Version": [
                      "1.0"
                    ],
                    "Content-Type": [
                      "multipart/alternative; boundary=\"boundary123\""
                    ]
                  },
                  "spam_checks": [
                    {
                      "name": "SpamAssassin",
                      "score": 0.1,
                      "result": "NotSpam",
                      "details": "Clean message, no spam indicators"
                    }
                  ],
                  "content": {
                    "plain_body": "Welcome to our service!\n\nThank you for signing up...",
                    "html_body": "<html><body><h1>Welcome to our service!</h1><p>Thank you for signing up...</p></body></html>",
                    "html_body_without_tracking": "<html><body><h1>Welcome to our service!</h1><p>Thank you for signing up...</p></body></html>"
                  },
                  "attachments": [
                    {
                      "index": 0,
                      "filename": "welcome-guide.pdf",
                      "content_type": "application/pdf",
                      "size": 524288,
                      "hash": "a1b2c3d4e5f6789012345678901234567890abcd",
                      "download_url": "/api/v1/messages/12345/attachments/0"
                    }
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageDetailsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid message ID format"
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key"
          },
          "403": {
            "description": "Forbidden - Message not found or not accessible"
          },
          "404": {
            "description": "Not found - Message does not exist"
          },
          "422": {
            "description": "Unprocessable entity - Failed to retrieve message details"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get comprehensive message details",
        "tags": [
          "Email"
        ]
      }
    },
    "/api/email/raw": {
      "post": {
        "description": "\n    Returns the raw EML (RFC 822) content of a message. This endpoint allows you to download\n    the complete email message in its original format, including all headers and MIME parts.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - Message must belong to the organization's sending account\n    - Raw message data must still be available (subject to retention policy)\n\n    **Authentication:**\n    - Requires **product-level API key** in X-Server-API-Key header\n    - API key automatically determines the sending account to query\n\n    **Parameters:**\n    - **id** (required): The message identifier. Supports three formats:\n      - Numeric ID (e.g., \"12345\")\n      - Token (e.g., \"abc123def456\")\n      - Message-ID header value (e.g., \"59656a26-efc4-49fa-add5-47c2868405aa@rp.postal.mymissioninbox.com\")\n\n    **Response:**\n    - Always returns JSON format\n    - **status**: \"success\" or \"error\"\n    - **raw_data**: The raw EML content as string (only on success)\n    - **error**: Error message (only on error)\n    - **id**: The message ID from the request\n\n    **Raw Data Format:**\n    - Raw EML content in RFC 822 format\n    - Includes all headers (From, To, Subject, Date, Message-ID, etc.)\n    - Contains full MIME structure with all parts\n    - Preserves original formatting and encoding\n\n    **Usage Notes:**\n    - Raw message data is subject to your server's retention policy\n    - After the retention period, raw data may be deleted while metadata remains\n    - Use this endpoint to archive messages or integrate with external systems\n    - The raw content can be saved as a .eml file for use with email clients\n    - This endpoint is useful for debugging, compliance, and archival purposes\n\n    **Common Error Codes:**\n    - MessageNotFound: No message found matching provided ID\n    - RawMessageNotAvailable: Raw message data is no longer available for this message\n\n    **Reading `status`:**\n    - `success` — `raw_data` holds the RFC 822 source.\n    - `pending` — accepted, but the raw source is still being assembled. Retry in ~30 seconds.\n    - `unavailable` — the raw source does not exist and never will. Do not retry.\n    - `error` — the request failed; `error` says why.\n\n    **Transactional always returns `unavailable`.** Messages go out through\n    Amazon SES, which does not retain them, so only their metadata is stored.\n    This is not a failure and not worth retrying — use\n    `POST /api/email/details` for everything we do keep.\n    ",
        "operationId": "EmailController_getRawMessage",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetRawMessageRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The raw source was not returned. Check `status` to tell a retryable state from a permanent one: `pending` is worth retrying, `unavailable` and `error` are not.",
            "schema": {
              "example": {
                "status": "unavailable",
                "error": "Raw message content is not available for the Transactional product. Messages are sent via Amazon SES, which does not retain them, and only their metadata is stored here. Retrying will not change this.",
                "id": "12345"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RawMessageResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid message ID format"
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key"
          },
          "403": {
            "description": "Forbidden - Message not found or not accessible"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get raw message content",
        "tags": [
          "Email"
        ]
      }
    },
    "/api/email/queue": {
      "get": {
        "description": "Lists emails accepted by `POST /api/email/send` that are waiting, being retried, or have settled, newest first. When a send cannot be delivered to the sending server at once it is queued and retried with backoff; this list shows each one's `status` (PENDING, PROCESSING, SENT, FAILED or CANCELLED), retry count and last error. Filter by `status` or `sendingAccountId`.",
        "operationId": "EmailQueueController_list",
        "parameters": [
          {
            "name": "status",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "PENDING",
                "PROCESSING",
                "SENT",
                "FAILED",
                "CANCELLED"
              ]
            }
          },
          {
            "name": "sendingAccountId",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "default": 20,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Queued emails retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "X-Server-API-Key": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "List queued emails",
        "tags": [
          "Email Queue"
        ]
      }
    },
    "/api/email/queue/{id}/retry": {
      "post": {
        "description": "Sends a queued email again now, with its retry count reset. Works for an email that is PENDING, FAILED or CANCELLED; an email already SENT or currently PROCESSING is refused with 400. No request body.",
        "operationId": "EmailQueueController_retry",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Queued email ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Email retry initiated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueuedEmailDto"
                }
              }
            }
          },
          "400": {
            "description": "Failed to retry email"
          },
          "404": {
            "description": "Queued email not found"
          }
        },
        "security": [
          {
            "X-Server-API-Key": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Retry a queued email",
        "tags": [
          "Email Queue"
        ]
      }
    },
    "/api/email/queue/{id}/cancel": {
      "post": {
        "description": "Stops a queued email from being sent or retried. An email already SENT or currently PROCESSING is refused with 400. No request body.",
        "operationId": "EmailQueueController_cancel",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Queued email ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Email cancelled successfully",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Failed to cancel email"
          }
        },
        "security": [
          {
            "X-Server-API-Key": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Cancel a queued email",
        "tags": [
          "Email Queue"
        ]
      }
    },
    "/api/analytics/overview": {
      "get": {
        "description": "\n    Returns overview statistics including emails sent comparison (current vs last month) and current totals for domains and mailboxes.\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n\n    **Response Fields:**\n    - **currentMonth** / **lastMonth**: Emails sent in each month\n      - **emailsSent**: The count, or 0 when unavailable\n      - **available**: Whether the count was actually retrieved\n    - **domains** / **unverifiedDomains**: Domain counts\n    - **mailboxes** / **inactiveMailboxes** / **warmingMailboxes** / **warmedMailboxes**: Mailbox counts\n\n    **Notes:**\n    - Statistics are calculated based on the organization associated with the API key\n    - Email counts are aggregated from the sending account's server\n    - **This endpoint degrades rather than failing.** If the sending server's stats\n      are unavailable, the affected month is returned with `available: false` and\n      `emailsSent: 0`, and the domain and mailbox counts — which do not depend on\n      the sending server — are still returned. Treat `available: false` as\n      \"unknown\", not as zero sends.\n    ",
        "operationId": "AnalyticsController_getOverview",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Overview statistics retrieved successfully",
            "schema": {
              "example": {
                "currentMonth": {
                  "emailsSent": 15420,
                  "available": true
                },
                "lastMonth": {
                  "emailsSent": 12350,
                  "available": true
                },
                "domains": 45,
                "unverifiedDomains": 3,
                "mailboxes": 128,
                "inactiveMailboxes": 12,
                "warmingMailboxes": 8,
                "warmedMailboxes": 45
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OverviewResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Server not authorized for this organization"
          },
          "422": {
            "description": "Unprocessable entity - Unable to retrieve overview statistics"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get dashboard overview statistics",
        "tags": [
          "Analytics"
        ]
      }
    },
    "/api/analytics/sending-activity": {
      "get": {
        "description": "\n    Time series of sends and what became of them, aggregated from this product's\n    own send history and the delivery events Amazon SES reported back.\n\n    **Why this exists alongside `/activity-graph`:** that endpoint keeps\n    Postal's shape, which has no `delivered` counter — the headline number for\n    transactional email — and carries two counters (`incoming`, `held`) that\n    are structurally always zero for SES. This one reports what actually applies.\n\n    **Counting unit is the message.** SES reports delivery outcomes per\n    *recipient*, so mixing those with per-message sends would yield rates above\n    100%. Each outcome here counts distinct messages having at least one event of\n    that type — so a message to three recipients that delivers to two and bounces\n    for one appears in both `delivered` and `bounced`. That is deliberate:\n    collapsing it to a single outcome would hide partial failures.\n\n    **Buckets are by event time; rates are over the whole range.** A message sent\n    at 23:59 and delivered at 00:01 falls in different buckets, which is correct\n    for a timeline but makes a per-bucket delivery rate meaningless.\n\n    **Buckets with no activity are omitted** rather than zero-filled — the client\n    knows the range and granularity and can fill gaps to suit its chart.\n\n    **The rates are operationally important.** Amazon suspends sending for the\n    entire account above roughly 5% hard bounces or 0.1% complaints, and the SES\n    account is shared across all customers, so these are the per-customer figures\n    to watch.\n    ",
        "operationId": "AnalyticsController_getSendingActivity",
        "parameters": [
          {
            "name": "granularity",
            "required": true,
            "in": "query",
            "description": "Time granularity for data points",
            "schema": {
              "example": "daily",
              "type": "string",
              "enum": [
                "hourly",
                "daily",
                "monthly",
                "yearly"
              ]
            }
          },
          {
            "name": "startDate",
            "required": true,
            "in": "query",
            "description": "Start of the range, ISO 8601. Inclusive.",
            "schema": {
              "example": "2026-09-01T00:00:00Z",
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "required": true,
            "in": "query",
            "description": "End of the range, ISO 8601. Inclusive.",
            "schema": {
              "example": "2026-09-30T23:59:59Z",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sending activity for the requested range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendingActivityResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid granularity or dates, startDate after endDate, or no organization product on the request"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "422": {
            "description": "Unprocessable entity - not the Transactional product; use /activity-graph instead"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Sending volume and delivery outcomes over time (Transactional only)",
        "tags": [
          "Analytics"
        ]
      }
    },
    "/api/analytics/engagement": {
      "get": {
        "description": "\n    Time series of engagement, from this product's own open pixel and click\n    redirect. Amazon SES reports nothing here: its own tracking is switched off\n    on our configuration set, which is what keeps recipients' links on a Mission\n    Inbox domain instead of `awstrack.me`.\n\n    **Only measures what was tracked.** A send with `track_opens` or\n    `track_clicks` off carries no pixel and no rewritten links, so it can\n    never appear here. Plain-text-only sends never do either. A quiet response\n    usually means tracking is off for the product — see\n    `GET /transactional/settings`.\n\n    **Every figure is a cohort of messages, grouped by when they were sent.** A\n    bucket answers one question: of the messages sent then, how many were ever\n    opened and how many ever had a link clicked. So a message opened a week\n    after it was sent is counted in the bucket it was SENT in, not the day it\n    was read.\n\n    That is deliberate, and it is what makes the rates mean anything. Grouping\n    opens by when the open happened, against sends in the same window, gives\n    rates over 100% as soon as somebody opens last week's receipt — the two\n    halves of the fraction would be counting different sets of messages. Here a\n    message is counted at most once either way, so neither rate can exceed 100%.\n\n    **Counting unit is the message, never the event.** Stored open and click\n    rows keep one per client per hour, so summing events would undercount\n    exactly the customers with the most engagement, and silently. These figures come from\n    first-contact timestamps on the message itself and are exact at any volume.\n\n    **Rates are over messages sent**, matching the delivery rate on\n    `/sending-activity`, which is also over sent. A bounced message drags\n    the rate down a little; the bounce figure that explains it is on that\n    endpoint.\n\n    **Opens are approximate by nature.** Some mail apps fetch images before a\n    human reads anything and others never fetch them at all, so treat the open\n    figure as a floor with noise in it. Clicks are a deliberate act and are the\n    firmer number.\n\n    **Buckets with no activity are omitted** rather than zero-filled.\n    ",
        "operationId": "AnalyticsController_getEngagement",
        "parameters": [
          {
            "name": "granularity",
            "required": true,
            "in": "query",
            "description": "Time granularity for data points",
            "schema": {
              "example": "daily",
              "type": "string",
              "enum": [
                "hourly",
                "daily",
                "monthly",
                "yearly"
              ]
            }
          },
          {
            "name": "startDate",
            "required": true,
            "in": "query",
            "description": "Start of the range, ISO 8601. Inclusive.",
            "schema": {
              "example": "2026-09-01T00:00:00Z",
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "required": true,
            "in": "query",
            "description": "End of the range, ISO 8601. Inclusive.",
            "schema": {
              "example": "2026-09-30T23:59:59Z",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Engagement for the requested range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EngagementResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid granularity or dates, startDate after endDate, or no organization product on the request"
          },
          "401": {
            "description": "Unauthorized - missing or invalid authentication"
          },
          "403": {
            "description": "Forbidden - product API key required"
          },
          "422": {
            "description": "Unprocessable entity - not the Transactional product"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Opens and clicks over time (Transactional only)",
        "tags": [
          "Analytics"
        ]
      }
    },
    "/api/analytics/activity-graph": {
      "get": {
        "description": "\n    Returns time-series activity data for plotting email activity graphs. This endpoint provides detailed statistics about incoming and outgoing messages over a specified time range at different granularities (hourly, daily, monthly, or yearly).\n\n    **Prerequisites:**\n    - Must use a **product-level API key** for authentication\n    - API key must have an associated sending account\n\n    **Query Parameters:**\n    - **granularity** (required): Time granularity for data points: \"hourly\", \"daily\", \"monthly\", or \"yearly\"\n    - **startDate** (required): Start date/time in ISO 8601 format (e.g., \"2025-01-01T00:00:00Z\")\n    - **endDate** (required): End date/time in ISO 8601 format (e.g., \"2025-01-31T23:59:59Z\")\n    - **counters** (optional): Which counters to include. Defaults to [\"incoming\", \"outgoing\"]. Valid options: \"incoming\", \"outgoing\", \"bounces\", \"spam\", \"held\"\n\n    **Response Fields:**\n    - **startDate**: The start date of the range in ISO 8601 format\n    - **endDate**: The end date of the range in ISO 8601 format\n    - **granularity**: The time granularity used for data points\n    - **dataPoints**: Array of data points, each containing a timestamp and counter values\n    - **summary**: Aggregated totals for the entire date range\n\n    **Maximum date ranges by granularity:**\n    - **Hourly**: 7 days (168 data points)\n    - **Daily**: 90 days (90 data points)\n    - **Monthly**: 24 months (24 data points)\n    - **Yearly**: 10 years (10 data points)\n\n    **Notes:**\n    - Statistics are retrieved only for the server associated with the API key used for authentication\n    - Data points are returned in chronological order (oldest first)\n    - Each data point represents aggregated statistics for that time period\n    - The summary object provides totals across all data points for easy reference\n    - This endpoint is designed for plotting email activity graphs in dashboards and analytics tools\n    ",
        "operationId": "AnalyticsController_getActivityGraph",
        "parameters": [
          {
            "name": "granularity",
            "required": true,
            "in": "query",
            "description": "Time granularity for data points: hourly, daily, monthly, or yearly",
            "schema": {
              "example": "daily",
              "type": "string",
              "enum": [
                "hourly",
                "daily",
                "monthly",
                "yearly"
              ]
            }
          },
          {
            "name": "startDate",
            "required": true,
            "in": "query",
            "description": "Start date/time in ISO 8601 format",
            "schema": {
              "example": "2025-01-01T00:00:00Z",
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "required": true,
            "in": "query",
            "description": "End date/time in ISO 8601 format",
            "schema": {
              "example": "2025-01-31T23:59:59Z",
              "type": "string"
            }
          },
          {
            "name": "counters",
            "required": false,
            "in": "query",
            "description": "Which counters to include. Defaults to [\"incoming\", \"outgoing\"]",
            "schema": {
              "example": [
                "incoming",
                "outgoing",
                "bounces"
              ],
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "incoming",
                  "outgoing",
                  "bounces",
                  "spam",
                  "held"
                ]
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Activity graph data retrieved successfully",
            "schema": {
              "example": {
                "startDate": "2025-01-01T00:00:00Z",
                "endDate": "2025-01-31T23:59:59Z",
                "granularity": "daily",
                "dataPoints": [
                  {
                    "timestamp": "2025-01-01T00:00:00Z",
                    "incoming": 582,
                    "outgoing": 1467,
                    "bounces": 35
                  },
                  {
                    "timestamp": "2025-01-02T00:00:00Z",
                    "incoming": 621,
                    "outgoing": 1523,
                    "bounces": 42
                  },
                  {
                    "timestamp": "2025-01-03T00:00:00Z",
                    "incoming": 598,
                    "outgoing": 1489,
                    "bounces": 38
                  }
                ],
                "summary": {
                  "totalIncoming": 18246,
                  "totalOutgoing": 45789,
                  "totalBounces": 1052
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityGraphResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid parameters (missing required fields, invalid granularity, invalid date format, date range too large, or invalid counters)"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Server not authorized for this organization"
          },
          "422": {
            "description": "Unprocessable entity - Unable to retrieve activity graph data"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Get activity graph data",
        "tags": [
          "Analytics"
        ]
      }
    },
    "/api/analytics/sending-identity-stats": {
      "get": {
        "description": "\n    One row per registered sending identity, with what it sent over the range\n    and what became of it.\n\n    **Every registered row is returned, including ones that sent nothing.** The\n    page can render its list straight from this response rather than fetching\n    the list separately and zipping the two together, filling the gaps itself.\n\n    **The range defaults to the last 30 days.** `startDate` and `endDate`\n    are independent: give only `startDate` to report from then until now, or\n    only `endDate` to report the 30 days before it. The range actually used\n    comes back in `range`.\n\n    **Counting unit is the message,** matching `/analytics/sending-activity`\n    so the two reconcile. `sent` counts messages; each outcome counts\n    *distinct messages* that saw at least one event of that type, because SES\n    reports outcomes per recipient and mixing the two would yield rates above\n    100%. A message to three recipients that delivers to two and bounces for one\n    is counted in both `delivered` and `bounced` — collapsing it to a\n    single outcome would hide partial failures.\n\n    **Sends and outcomes are filtered on different clocks.** A send counts if it\n    was *sent* in the range; an outcome counts if it *occurred* in the range. A\n    message sent just before the window and delivered just inside it contributes\n    a delivery and no send, so a rate over a short or very recent range can read\n    oddly. Over a range long relative to delivery latency this is immaterial.\n\n    **Suppressed sends are excluded from `sent`** — they never reached SES and\n    can never produce an outcome, so counting them would deflate every rate.\n    They are reported separately in `suppressed`, so a sender whose volume is\n    being suppressed does not simply look quiet.\n\n    **The rates are operationally important.** Amazon suspends sending for the\n    whole account above roughly 5% hard bounces or 0.1% complaints, and the SES\n    account is shared across all customers — so these per-sender figures are how\n    you find which sender is putting everyone at risk.\n\n    Rates are `null`, not `0`, when nothing was sent: a sender that has not\n    sent has not failed.\n\n    **`totals` can exceed the sum of the rows.** Volume attributed to an\n    identity deleted during the range still counts toward the account total but\n    has no row of its own, since the page does not list deleted identities.\n    ",
        "operationId": "AnalyticsController_getSendingIdentityStats",
        "parameters": [
          {
            "name": "startDate",
            "required": false,
            "in": "query",
            "description": "Start of the range, ISO 8601. Inclusive. Defaults to 30 days before `endDate`.",
            "schema": {
              "example": "2026-08-06T00:00:00Z",
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "required": false,
            "in": "query",
            "description": "End of the range, ISO 8601. Inclusive. Defaults to now.",
            "schema": {
              "example": "2026-09-05T23:59:59Z",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Per-identity statistics for the requested range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendingIdentityStatsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid dates, startDate after endDate, or no organization product on the request"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "422": {
            "description": "Unprocessable entity - not the Transactional product"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Sending volume and deliverability per sending identity (Transactional only)",
        "tags": [
          "Analytics"
        ]
      }
    },
    "/api/analytics/domain-stats": {
      "get": {
        "description": "\n    One row per registered domain, aggregating every sending identity on it.\n\n    **Every registered row is returned, including ones that sent nothing.** The\n    page can render its list straight from this response rather than fetching\n    the list separately and zipping the two together, filling the gaps itself.\n\n    **The range defaults to the last 30 days.** `startDate` and `endDate`\n    are independent: give only `startDate` to report from then until now, or\n    only `endDate` to report the 30 days before it. The range actually used\n    comes back in `range`.\n\n    **Counting unit is the message,** matching `/analytics/sending-activity`\n    so the two reconcile. `sent` counts messages; each outcome counts\n    *distinct messages* that saw at least one event of that type, because SES\n    reports outcomes per recipient and mixing the two would yield rates above\n    100%. A message to three recipients that delivers to two and bounces for one\n    is counted in both `delivered` and `bounced` — collapsing it to a\n    single outcome would hide partial failures.\n\n    **Sends and outcomes are filtered on different clocks.** A send counts if it\n    was *sent* in the range; an outcome counts if it *occurred* in the range. A\n    message sent just before the window and delivered just inside it contributes\n    a delivery and no send, so a rate over a short or very recent range can read\n    oddly. Over a range long relative to delivery latency this is immaterial.\n\n    **Suppressed sends are excluded from `sent`** — they never reached SES and\n    can never produce an outcome, so counting them would deflate every rate.\n    They are reported separately in `suppressed`, so a sender whose volume is\n    being suppressed does not simply look quiet.\n\n    **The rates are operationally important.** Amazon suspends sending for the\n    whole account above roughly 5% hard bounces or 0.1% complaints, and the SES\n    account is shared across all customers — so these per-sender figures are how\n    you find which sender is putting everyone at risk.\n\n    Rates are `null`, not `0`, when nothing was sent: a sender that has not\n    sent has not failed.\n\n    **Deleted identities still count toward their domain.** The domain did send\n    that mail, and excluding it would make the domain rows disagree with the\n    account total for no reason a reader could see.\n\n    **Sends are attributed through the identity that made them.** Deleting a\n    domain nulls that link on its messages, so a deleted domain's history is not\n    reachable here — there is no row for it either, so nothing goes missing from\n    the response.\n    ",
        "operationId": "AnalyticsController_getDomainStats",
        "parameters": [
          {
            "name": "startDate",
            "required": false,
            "in": "query",
            "description": "Start of the range, ISO 8601. Inclusive. Defaults to 30 days before `endDate`.",
            "schema": {
              "example": "2026-08-06T00:00:00Z",
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "required": false,
            "in": "query",
            "description": "End of the range, ISO 8601. Inclusive. Defaults to now.",
            "schema": {
              "example": "2026-09-05T23:59:59Z",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Per-domain statistics for the requested range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainStatsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid dates, startDate after endDate, or no organization product on the request"
          },
          "401": {
            "description": "Unauthorized - Invalid authentication"
          },
          "403": {
            "description": "Forbidden - Insufficient permissions"
          },
          "422": {
            "description": "Unprocessable entity - not the Transactional product"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Sending volume and deliverability per domain (Transactional only)",
        "tags": [
          "Analytics"
        ]
      }
    },
    "/api/marketplace/domains": {
      "get": {
        "description": "\n    The customer-facing catalogue.\n    \n    Only domains in the `marketplace` state are ever returned. Everything\n    else the account holds — untriaged domains, domains dismissed as a client's\n    own, other customers' leased stock — is invisible here.\n\n    **What each domain reports:** name, TLD, age, registration date, days\n    warmed so far, monthly price and how many pre-warmed mailboxes come with\n    it. Nothing about registrar status, nameservers or Mission Inbox's own\n    infrastructure — that is a separate admin-only projection.\n\n    **`warmedDays` keeps climbing while a domain is listed.** Warmup does not\n    stop when a domain goes on sale; it stops when someone buys it. A domain\n    that has sat here for a month is a more warmed domain than it was.\n\n    **Sorting** defaults to `age` descending — oldest first, which is what\n    most buyers are here for.\n    \n    **Authentication Required:**\n    - Product-level API key, or a Clerk JWT for the organization\n\n    Any authenticated customer may browse — a catalogue only some customers can\n    see is not a catalogue.\n",
        "operationId": "MarketplaceCatalogueController_browse",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number",
            "schema": {
              "minimum": 1,
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Items per page",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "type": "number"
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "Substring match on the domain name",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tld",
            "required": false,
            "in": "query",
            "description": "Top-level domain, without the dot — e.g. 'com'",
            "schema": {
              "example": "com",
              "type": "string"
            }
          },
          {
            "name": "minAgeYears",
            "required": false,
            "in": "query",
            "description": "Only domains at least this many years old",
            "schema": {
              "example": 10,
              "type": "number"
            }
          },
          {
            "name": "sortBy",
            "required": false,
            "in": "query",
            "description": "Sort field. 'age' is oldest first, which is what most buyers want.",
            "schema": {
              "default": "age",
              "type": "string",
              "enum": [
                "age",
                "domain",
                "listedAt"
              ]
            }
          },
          {
            "name": "sortDirection",
            "required": false,
            "in": "query",
            "schema": {
              "default": "desc",
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated available domains",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogueDomainListDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Browse domains for sale",
        "tags": [
          "Domain Marketplace"
        ]
      }
    },
    "/api/marketplace/domains/facets": {
      "get": {
        "description": "\n    The TLDs actually present in the catalogue with their counts, the total\n    available, and the lease terms (price, included mailboxes).\n\n    Exists so a catalogue page can render its filters and pricing without\n    fetching every domain to derive them, and so the price has exactly one\n    source — a copy hardcoded in the app is how a catalogue ends up\n    disagreeing with an invoice.\n    \n    **Authentication Required:**\n    - Product-level API key, or a Clerk JWT for the organization\n\n    Any authenticated customer may browse — a catalogue only some customers can\n    see is not a catalogue.\n",
        "operationId": "MarketplaceCatalogueController_facets",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Filter counts and lease terms",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogueFacetsDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Catalogue filters and terms",
        "tags": [
          "Domain Marketplace"
        ]
      }
    },
    "/api/marketplace/domains/{domain}": {
      "get": {
        "description": "\n    The same projection as browse, for a single domain.\n    \n    Only domains in the `marketplace` state are ever returned. Everything\n    else the account holds — untriaged domains, domains dismissed as a client's\n    own, other customers' leased stock — is invisible here.\n\n    A domain that exists but is not listed answers **404**, identically to one\n    that does not exist at all. Whether Mission Inbox holds a given domain is\n    not a customer's business, and a distinct \"exists but unavailable\" reply\n    would turn this route into a probe for the rest of the account.\n    \n    **Authentication Required:**\n    - Product-level API key, or a Clerk JWT for the organization\n\n    Any authenticated customer may browse — a catalogue only some customers can\n    see is not a catalogue.\n",
        "operationId": "MarketplaceCatalogueController_detail",
        "parameters": [
          {
            "name": "domain",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The domain",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogueDomainDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not available"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "One domain for sale",
        "tags": [
          "Domain Marketplace"
        ]
      }
    },
    "/api/marketplace/eligibility": {
      "get": {
        "description": "\n    Answers the catalogue page's two questions in one call: should the buy\n    button work, and how many of the account's lease slots are used.\n\n    **Blocked reasons** are returned as a stable code alongside the sentence,\n    so the app can pick an action — an upgrade prompt, a billing link, a\n    disabled button — without matching on prose:\n\n    | `reason` | Meaning |\n    |---|---|\n    | `purchasing_disabled` | Selling is switched off globally |\n    | `wrong_product` | Not the Sales product — leasing is Postal-only |\n    | `no_subscription` | Nothing to bill the monthly charge to |\n    | `subscription_inactive` | Subscription exists but is not active |\n    | `subscription_ending` | Cancellation already scheduled |\n    | `plan_not_eligible` | Plan tier does not include domain leasing |\n    | `sending_disabled` | Sending is suspended, so a domain could not send |\n    | `cap_reached` | Already at the concurrent lease limit |\n\n    Only the first applicable reason is returned, most fundamental first.\n\n    **`requested`** is how many domains the caller intends to buy at once,\n    defaulting to 1. The cart passes its size so `cap_reached` accounts for\n    the whole cart — otherwise the app would compare against `remaining`\n    itself, which is a second copy of the cap rule living where nobody\n    maintains it. `remaining` is unaffected by it: that is a property of the\n    account, not of the question being asked.\n    \n    **Authentication Required:**\n    - Product-level API key, or a Clerk JWT for the organization\n",
        "operationId": "MarketplacePurchaseController_getEligibility",
        "parameters": [
          {
            "name": "requested",
            "required": false,
            "in": "query",
            "description": "How many domains the caller intends to buy at once. Defaults to 1.",
            "schema": {
              "default": 1,
              "example": 3,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Eligibility and current lease counts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseEligibilityDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication"
          },
          "403": {
            "description": "The request is not scoped to an organization product"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Whether this account can lease a domain",
        "tags": [
          "Domain Marketplace"
        ]
      }
    },
    "/api/marketplace/leases": {
      "get": {
        "description": "\n    Every lease the account holds or has held, newest first — including ones\n    still provisioning, scheduled to end, and already ended.\n\n    `provisionStage` tracks setup progress while `status` is\n    `provisioning`. `needsAttention` means setup stopped and support needs\n    to look at it; the underlying error is deliberately not returned, because\n    it carries infrastructure detail.\n    \n    **Authentication Required:**\n    - Product-level API key, or a Clerk JWT for the organization\n",
        "operationId": "MarketplacePurchaseController_listLeases",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Leases held by this account",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DomainLeaseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication"
          },
          "403": {
            "description": "The request is not scoped to an organization product"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "List this account's domain leases",
        "tags": [
          "Domain Marketplace"
        ]
      }
    },
    "/api/marketplace/checkout": {
      "post": {
        "description": "\n    Claims every domain in the list for this account in **one transaction**,\n    and takes them all out of the catalogue together.\n\n    **All or nothing applies to the reservation.** If any one domain is no\n    longer available, nothing is bought and the response names the ones that\n    failed, each with a stable `reason` so the app can highlight those rows:\n\n    - `not_listed` — sold or unlisted between the page load and the checkout\n    - `just_taken` — another buyer committed first, mid-request\n    - `already_yours` — this account already holds it, usually a\n      double-clicked checkout\n    - `payment_failed` — the card was refused, so the whole cart was\n      released. The odd one out: every row carries it, because it is not\n      about the domains at all.\n\n    An empty `unavailable` array on a 409 means the cart was refused but the\n    cause could not be attributed to a domain; reload the catalogue rather\n    than reading it as nothing being wrong.\n\n    **Buying takes a payment, immediately.** A lease bills in advance, like a\n    base fee, so the recurring invoice covers the *next* period and this\n    charge covers the rest of the current one: `monthly × remaining days ÷\n    period days`, per domain, against the account's real billing period. One\n    charge for the whole cart, one Stripe invoice, and it is\n    **non-refundable** — cancelling tomorrow keeps the domain until the end\n    of the period already paid for.\n\n    `chargedNowCents` on the response is what was actually taken and is\n    authoritative; the `proratedCentsPerDomain` on the eligibility route is\n    an estimate computed before checkout and the two differ if a period\n    boundary passes in between.\n\n    A **503** means the charge could not be confirmed either way. Do not\n    retry blindly: the domains stay reserved while the charge is settled in\n    the background, and a second checkout would be a second cart. Re-read\n    `GET /marketplace/leases` first.\n\n    **It does not apply to fulfilment.** Reservation is atomic; provisioning is\n    not. The domains come back `provisioning` and are moved onto the\n    account's Postal server **one at a time**, so the last domain in a cart\n    becomes usable last, and one of them can still get stuck while its\n    neighbours finish. Poll `GET /marketplace/leases` for per-domain\n    progress.\n\n    Serial rather than parallel on purpose: the events that drive billing carry\n    absolute counts read at the moment they fire, so running the pipelines\n    concurrently would let them all report the same pre-transfer figure.\n\n    **The cap covers the whole cart.** Three domains will not fit into two free\n    slots, and that refusal is a 409 here rather than the single purchase\n    route's 403 — for a cart it is an ordinary \"not right now\", not a statement\n    about the account. Pass `?requested=` to the eligibility route to ask the\n    same question before showing a checkout button.\n\n    **Prices are fixed per domain at purchase**, and the returned total is\n    summed from the rows actually written rather than multiplied out from the\n    catalogue price.\n    \n    **Authentication Required:**\n    - Product-level API key, or a Clerk JWT for the organization\n",
        "operationId": "MarketplacePurchaseController_checkout",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckoutCartDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Every domain reserved; provisioning follows, one at a time",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckoutResultDto"
                }
              }
            }
          },
          "400": {
            "description": "The list was empty, held a duplicate, or contained something that is not a bare domain name"
          },
          "401": {
            "description": "Missing or invalid authentication"
          },
          "403": {
            "description": "This account is not allowed to buy — see `reason` on the eligibility route"
          },
          "409": {
            "description": "Nothing was bought — a domain is unavailable, or the cart does not fit under the lease cap",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CartUnavailableBodyDto"
                }
              }
            }
          },
          "503": {
            "description": "The payment could not be confirmed either way. The domains stay reserved while it is settled in the background — re-read the leases before retrying, or a retry becomes a second cart"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Buy a cart of domains, all or nothing",
        "tags": [
          "Domain Marketplace"
        ]
      }
    },
    "/api/marketplace/domains/{domain}/cancel": {
      "post": {
        "description": "\n    A purchase renews every billing period and needs no action to keep it.\n    This is how a customer stops one.\n\n    **Scheduled, never immediate.** The customer has paid through the current\n    period, so the domain keeps working and stays theirs until it ends — the\n    lease's `endsAt` is the subscription's own period end, so the domain and\n    the invoice stop together. Taking it back on the click would be selling a\n    month and delivering less of it.\n\n    Reversible up to that date via `resume`. After it, the domain is\n    reclaimed and re-enters Mission Inbox's inventory.\n\n    The domain still counts against the three-domain cap until it actually\n    ends, because the customer still has it.\n  ",
        "operationId": "MarketplacePurchaseController_cancel",
        "parameters": [
          {
            "name": "domain",
            "required": true,
            "in": "path",
            "description": "A domain this account has purchased",
            "schema": {
              "example": "coastsidetech.com",
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainLeaseDto"
                }
              }
            }
          },
          "400": {
            "description": "The billing period end could not be read, so no cancellation date can be set"
          },
          "401": {
            "description": "Missing or invalid authentication"
          },
          "403": {
            "description": "This request is not scoped to an organization product"
          },
          "404": {
            "description": "This account has no live purchase of that domain"
          },
          "409": {
            "description": "Already scheduled to end, or still being set up"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Stop a purchased domain renewing",
        "tags": [
          "Domain Marketplace"
        ]
      }
    },
    "/api/marketplace/domains/{domain}/resume": {
      "post": {
        "description": "\n    Keeps the domain, and resumes renewing it. Valid up to the cancellation\n    date; after that the domain has gone back to Mission Inbox and has to be\n    bought again if it is still available.\n\n    **Only a cancellation the customer made.** A purchase ending because the\n    subscription behind it is going away cannot be resumed here — the\n    subscription is the thing to fix, and the lease follows it automatically\n    once it is healthy again.\n  ",
        "operationId": "MarketplacePurchaseController_resume",
        "parameters": [
          {
            "name": "domain",
            "required": true,
            "in": "path",
            "description": "A domain this account has scheduled to cancel",
            "schema": {
              "example": "coastsidetech.com",
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainLeaseDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication"
          },
          "403": {
            "description": "This request is not scoped to an organization product"
          },
          "404": {
            "description": "This account has no live purchase of that domain"
          },
          "409": {
            "description": "Not scheduled to end, or ending because the subscription is"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Withdraw a scheduled cancellation",
        "tags": [
          "Domain Marketplace"
        ]
      }
    },
    "/api/marketplace/access": {
      "get": {
        "description": "\n    Whether this account may see the marketplace **at all** — one boolean,\n    read by the app before it renders the navigation item or the page.\n\n    This is the rollout gate, and it is not the same question as\n    `GET /marketplace/eligibility`. Eligibility describes an account that\n    can see the marketplace and explains whether it may buy (plan, subscription,\n    lease cap, selling open or closed). This route decides whether the feature\n    exists for them in the first place.\n\n    **False means gone, not greyed out.** Every other `/marketplace` route\n    returns 404 for the same account, so a hidden marketplace cannot be reached\n    by typing the URL.\n\n    **True when** the account is on the Sales product and the marketplace has\n    been rolled out to it.\n\n    **No reason is returned**, on purpose: an account the feature is withheld\n    from should not be told it exists and is coming.\n\n    **Authentication Required:**\n    - Product-level API key, or a Clerk JWT for the organization\n\n    This route is deliberately *not* behind the visibility gate — it is the\n    thing that reports the gate.\n  ",
        "operationId": "MarketplaceAccessController_getAccess",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Whether the marketplace is available to this account",
            "schema": {
              "example": {
                "visible": true
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceAccessDto"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication"
          },
          "403": {
            "description": "The API key is not product-scoped"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "X-Server-API-Key": []
          }
        ],
        "summary": "Is the Domain Marketplace available to this account",
        "tags": [
          "Domain Marketplace"
        ]
      }
    }
  },
  "info": {
    "title": "Mission Inbox v4 API",
    "description": "\n        **Mission Inbox v4 API**\n        A comprehensive email sending platform using OBM Engine.\n\n        ## Support\n        For technical support: devs@missioninbox.com\n        ",
    "version": "1.0.0",
    "contact": {
      "name": "OBM API Support",
      "url": "https://docs.obmengine.ai",
      "email": "devs@missioninbox.com"
    }
  },
  "tags": [],
  "servers": [
    {
      "url": "https://api.v4.missioninbox.com",
      "description": "Production Server"
    },
    {
      "url": "https://api-v4-staging.missioninbox.com",
      "description": "Staging Server"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "type": "http"
      },
      "X-Server-API-Key": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Server-API-Key",
        "description": "Organization API key for email operations (found in user profile)"
      }
    },
    "schemas": {
      "ServerStatusDto": {
        "type": "object",
        "properties": {
          "incoming": {
            "type": "number",
            "description": "Number of incoming messages in the last 60 seconds",
            "example": 10
          },
          "outgoing": {
            "type": "number",
            "description": "Number of outgoing messages in the last 60 seconds",
            "example": 21
          },
          "rate": {
            "type": "number",
            "description": "Message throughput rate per minute (rounded to 1 decimal place)",
            "example": 9.1
          },
          "held": {
            "type": "number",
            "description": "Number of messages currently held",
            "example": 3
          },
          "queued": {
            "type": "number",
            "description": "Number of messages currently in the queue ready to send",
            "example": 10
          },
          "bounceRate": {
            "type": "number",
            "description": "Bounce rate as a percentage over the last 30 days (rounded to 1 decimal place)",
            "example": 4.4
          },
          "storage": {
            "type": "number",
            "description": "Total storage occupied by message content in MB (rounded to 1 decimal place)",
            "example": 30.8
          }
        },
        "required": [
          "incoming",
          "outgoing",
          "rate",
          "held",
          "queued",
          "bounceRate",
          "storage"
        ]
      },
      "IpAddressDto": {
        "type": "object",
        "properties": {
          "ipv4": {
            "type": "object",
            "description": "IPv4 address",
            "example": "192.168.0.1",
            "nullable": true
          },
          "ipv6": {
            "type": "object",
            "description": "IPv6 address",
            "example": null,
            "nullable": true
          },
          "hostname": {
            "type": "string",
            "description": "Hostname",
            "example": "server1.example.com"
          },
          "priority": {
            "type": "number",
            "description": "Priority",
            "example": 10
          }
        },
        "required": [
          "ipv4",
          "ipv6",
          "hostname",
          "priority"
        ]
      },
      "IpAddressesResponseDto": {
        "type": "object",
        "properties": {
          "ipAddresses": {
            "description": "List of IP addresses",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IpAddressDto"
            }
          }
        },
        "required": [
          "ipAddresses"
        ]
      },
      "CreateSuppressionDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "The address to stop sending to. Stored exactly as given; matching is case-insensitive.",
            "example": "user@example.com"
          },
          "reason": {
            "type": "string",
            "description": "Why the address is being suppressed. Shown as the reason in the list and the export.",
            "example": "Unsubscribed via support",
            "maxLength": 255
          }
        },
        "required": [
          "email"
        ]
      },
      "SuppressionDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Unique identifier for the suppression entry",
            "example": 123
          },
          "email": {
            "type": "string",
            "description": "The suppressed email address",
            "example": "user@example.com"
          },
          "reason": {
            "type": "string",
            "description": "Reason for suppression. For the Transactional product this is one of \"Hard bounce\", \"Spam complaint\", or the note given when the address was added manually.",
            "example": "too many hard fails"
          },
          "createdAt": {
            "type": "string",
            "description": "ISO 8601 timestamp when the suppression was added",
            "example": "2025-01-15T10:30:00Z"
          },
          "expireAt": {
            "type": "object",
            "description": "ISO 8601 timestamp when the suppression will expire. Null for the Transactional product, whose suppressions do not expire.",
            "example": "2025-02-14T10:30:00Z",
            "nullable": true
          },
          "source": {
            "type": "string",
            "description": "Where the entry came from (Transactional only): \"manual\" for one added through the portal or API, \"ses_event\" for one recorded from an Amazon SES bounce or complaint, \"ses_sync\" for one reconciled from the suppression list Amazon SES holds for this account.",
            "enum": [
              "manual",
              "ses_event",
              "ses_sync"
            ],
            "example": "manual"
          },
          "removable": {
            "type": "boolean",
            "description": "Whether the customer can remove this entry (Transactional only). False for hard bounces: the address is also on the global suppression list Amazon maintains, which cannot be edited, so removing it here would only produce a second bounce. Absent for Sales, where every entry is removable.",
            "example": true
          }
        },
        "required": [
          "id",
          "email",
          "reason",
          "createdAt",
          "expireAt"
        ]
      },
      "SuppressionsDeleteResponseDto": {
        "type": "object",
        "properties": {
          "deleted": {
            "type": "boolean",
            "description": "Confirms the deletion was processed",
            "example": true
          },
          "count": {
            "type": "number",
            "description": "Number of suppression entries actually deleted",
            "example": 3
          }
        },
        "required": [
          "deleted",
          "count"
        ]
      },
      "DeleteSuppressionsDto": {
        "type": "object",
        "properties": {
          "ids": {
            "description": "Array of suppression IDs to delete",
            "example": [
              123,
              124,
              125
            ],
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        },
        "required": [
          "ids"
        ]
      },
      "DomainStatisticsDto": {
        "type": "object",
        "properties": {
          "totalDomains": {
            "type": "number",
            "description": "Total number of domains",
            "example": 100
          },
          "verifiedDomains": {
            "type": "number",
            "description": "Number of fully verified domains (SPF, DKIM, and Return Path are OK)",
            "example": 75
          },
          "warmupRunningDomains": {
            "type": "number",
            "description": "Number of domains with warmup running",
            "example": 30
          }
        },
        "required": [
          "totalDomains",
          "verifiedDomains",
          "warmupRunningDomains"
        ]
      },
      "RegisterDomainDto": {
        "type": "object",
        "properties": {
          "tracking_subdomain": {
            "type": "object",
            "description": "A label under this domain, such as \"links\", or the whole hostname, \"links.yourdomain.com\". It cannot be the domain itself, cannot be www, and cannot be a name that already carries this domain's mail records. It can be changed but never removed, so links in mail already sent keep working.",
            "example": "links"
          },
          "open_tracking": {
            "type": "object",
            "description": "true or false to decide open tracking for this domain, or null to follow the account default. Leave the field out to change nothing.",
            "example": true,
            "nullable": true
          },
          "click_tracking": {
            "type": "object",
            "description": "true or false to decide click tracking for this domain, or null to follow the account default. Leave the field out to change nothing.",
            "example": true,
            "nullable": true
          },
          "domainName": {
            "type": "string",
            "description": "Domain name to register",
            "example": "example.com"
          },
          "projectId": {
            "type": "string",
            "description": "Project ID to associate the domain with",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          }
        },
        "required": [
          "domainName"
        ]
      },
      "EmailDnsStatusDto": {
        "type": "object",
        "properties": {
          "pushed": {
            "type": "boolean",
            "description": "Whether DNS records were pushed",
            "example": true
          },
          "successCount": {
            "type": "number",
            "description": "Number of records successfully pushed",
            "example": 5
          },
          "failureCount": {
            "type": "number",
            "description": "Number of records that failed to push",
            "example": 0
          },
          "pushError": {
            "type": "string",
            "description": "Error message if DNS push failed",
            "example": null
          },
          "verified": {
            "type": "boolean",
            "description": "Whether verification was triggered",
            "example": true
          },
          "verificationError": {
            "type": "string",
            "description": "Error message if verification failed",
            "example": null
          },
          "statuses": {
            "type": "object",
            "description": "DNS verification statuses",
            "example": {
              "spf": "ok",
              "dkim": "ok",
              "mx": "ok",
              "rp": "ok",
              "dmarc": "ok"
            }
          }
        },
        "required": [
          "pushed",
          "verified"
        ]
      },
      "CreateDomainResponseDto": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "Domain UUID from postal server",
            "example": "47519fb0-ead8-4a56-94dd-09f095af8be5"
          },
          "domainName": {
            "type": "string",
            "description": "Domain name",
            "example": "example.com"
          },
          "verified": {
            "type": "boolean",
            "description": "Whether the domain is verified",
            "example": true
          },
          "verificationToken": {
            "type": "string",
            "description": "Verification token",
            "example": "1lXizMhoGtBLtyYSw8TZKJMAQtt0PQWF"
          },
          "dnsVerificationString": {
            "type": "string",
            "description": "DNS verification string",
            "example": "postal-verification 1lXizMhoGtBLtyYSw8TZKJMAQtt0PQWF"
          },
          "spfHost": {
            "type": "string",
            "description": "SPF DNS record hostname",
            "example": "example.com"
          },
          "spfValue": {
            "type": "string",
            "description": "SPF DNS record value",
            "example": "v=spf1 ip4:192.0.2.1 ip4:192.0.2.2 ip6:2605:a140:2256:1142::1 ~all"
          },
          "dkimHost": {
            "type": "string",
            "description": "DKIM DNS record hostname",
            "example": "postal-GyjDIn._domainkey.example.com"
          },
          "dkimValue": {
            "type": "string",
            "description": "DKIM DNS record value",
            "example": "v=DKIM1; t=s; h=sha256; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4rUDR..."
          },
          "rpHost": {
            "type": "string",
            "description": "Return path DNS record hostname",
            "example": "psrp.example.com"
          },
          "rpValue": {
            "type": "string",
            "description": "Return path DNS record value",
            "example": "rp.postal.example.com"
          },
          "mxHost": {
            "type": "string",
            "description": "MX DNS record hostname",
            "example": "example.com"
          },
          "mxValue": {
            "type": "string",
            "description": "MX DNS record value",
            "example": "missioninbox.outboxment.com"
          },
          "mxPriority": {
            "type": "number",
            "description": "MX DNS record priority",
            "example": 10
          },
          "dmarcHost": {
            "type": "string",
            "description": "DMARC DNS record hostname",
            "example": "_dmarc.example.com"
          },
          "dmarcValue": {
            "type": "string",
            "description": "DMARC DNS record value",
            "example": "v=DMARC1; p=quarantine; rua=mailto:abuse@example.com; ruf=mailto:abuse@example.com; sp=quarantine; adkim=r; aspf=r; fo=1; ri=864000;"
          },
          "hasDnsManager": {
            "type": "boolean",
            "description": "Whether DNS manager is available for this domain",
            "example": true
          },
          "emailDns": {
            "description": "Email DNS status (if DNS manager is available)",
            "allOf": [
              {
                "$ref": "#/components/schemas/EmailDnsStatusDto"
              }
            ]
          },
          "nameserverMoveStarted": {
            "type": "boolean",
            "description": "True when the domain is being moved onto its own nameservers, which serve its records, so nothing needs adding at the registrar",
            "example": true
          },
          "adminPassword": {
            "type": "string",
            "description": "Generated password for the domain admin/abuse/postmaster mailboxes. Returned once at creation; not exposed in domain list/get responses.",
            "example": "aB3!xY7@kLm9$pQ2"
          }
        },
        "required": [
          "uuid",
          "domainName",
          "verified",
          "spfHost",
          "spfValue",
          "dkimHost",
          "dkimValue",
          "rpHost",
          "rpValue",
          "mxHost",
          "mxValue",
          "mxPriority",
          "dmarcHost",
          "dmarcValue",
          "hasDnsManager"
        ]
      },
      "BulkRegisterDomainsDto": {
        "type": "object",
        "properties": {
          "domains": {
            "description": "Array of domain registration items",
            "example": [
              {
                "domainName": "example1.com",
                "projectName": "ACME project"
              },
              {
                "domainName": "example2.com",
                "projectName": "ACMF project"
              }
            ],
            "items": {
              "type": "array"
            },
            "type": "array"
          }
        },
        "required": [
          "domains"
        ]
      },
      "TaskCreateResponseDto": {
        "type": "object",
        "properties": {
          "taskId": {
            "type": "string",
            "description": "ID of the created task"
          },
          "message": {
            "type": "string",
            "description": "Message confirming task creation"
          }
        },
        "required": [
          "taskId",
          "message"
        ]
      },
      "BulkVerifyDomainsDto": {
        "type": "object",
        "properties": {
          "domainNames": {
            "description": "Array of domain names to verify",
            "example": [
              "example1.com",
              "example2.com",
              "example3.com"
            ],
            "items": {
              "type": "array"
            },
            "type": "array"
          }
        },
        "required": [
          "domainNames"
        ]
      },
      "BulkDeleteDomainsDto": {
        "type": "object",
        "properties": {
          "domainNames": {
            "description": "Array of domain names to delete",
            "example": [
              "example1.com",
              "example2.com",
              "example3.com"
            ],
            "items": {
              "type": "array"
            },
            "type": "array"
          }
        },
        "required": [
          "domainNames"
        ]
      },
      "VerifyDomainDto": {
        "type": "object",
        "properties": {
          "domainName": {
            "type": "string",
            "description": "Domain name to verify",
            "example": "example.com"
          }
        },
        "required": [
          "domainName"
        ]
      },
      "DnsCheckDetailDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "DNS check status",
            "enum": [
              "OK",
              "Invalid",
              "Missing",
              "ERROR"
            ],
            "example": "Missing"
          },
          "error": {
            "type": "object",
            "description": "Error message if verification failed",
            "example": "No SPF record exists for this domain"
          }
        },
        "required": [
          "status"
        ]
      },
      "DnsChecksDto": {
        "type": "object",
        "properties": {
          "spf": {
            "description": "SPF record verification -- omitted for Transactional/SES domains, which never publish an SPF record",
            "allOf": [
              {
                "$ref": "#/components/schemas/DnsCheckDetailDto"
              }
            ]
          },
          "dkim": {
            "description": "DKIM record verification",
            "allOf": [
              {
                "$ref": "#/components/schemas/DnsCheckDetailDto"
              }
            ]
          },
          "return_path": {
            "description": "Return path record verification -- omitted when the sending account has optionalReturnPathCheck enabled",
            "allOf": [
              {
                "$ref": "#/components/schemas/DnsCheckDetailDto"
              }
            ]
          },
          "mx": {
            "description": "MX record verification",
            "allOf": [
              {
                "$ref": "#/components/schemas/DnsCheckDetailDto"
              }
            ]
          },
          "dmarc": {
            "description": "DMARC record verification",
            "allOf": [
              {
                "$ref": "#/components/schemas/DnsCheckDetailDto"
              }
            ]
          }
        },
        "required": [
          "dkim"
        ]
      },
      "DomainVerificationResponseDto": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Verification result message",
            "example": "We couldn't verify your domain. Please double check you've added the TXT record correctly."
          },
          "dnsVerificationString": {
            "type": "string",
            "description": "DNS verification string to add as TXT record",
            "example": "postal-verification 89bFf857H3ajLBXBbqyMIc70mf0oyT9M"
          },
          "dnsChecks": {
            "description": "Detailed DNS checks for each record type",
            "allOf": [
              {
                "$ref": "#/components/schemas/DnsChecksDto"
              }
            ]
          },
          "code": {
            "type": "string",
            "description": "Error code if verification failed",
            "example": "VerificationFailed"
          },
          "fullyVerified": {
            "type": "boolean",
            "description": "Whether all required DNS records resolve correctly. For Transactional this does NOT mean the domain can send yet — see verificationState.",
            "example": false
          },
          "verificationState": {
            "type": "string",
            "description": "Where the domain sits in the verification pipeline. Transactional/SES domains pass through 'awaiting_ses' after their DNS resolves: Amazon SES re-checks the same records from its own resolvers before it will accept a send, which usually takes minutes and may take up to 72 hours.",
            "enum": [
              "dns_pending",
              "awaiting_ses",
              "verified",
              "ses_failed"
            ]
          },
          "sesVerificationStatus": {
            "type": "string",
            "description": "Amazon SES's own verification status, mirrored from GetEmailIdentity. Null for Sales/Postal domains and for Transactional domains SES has not been asked about yet.",
            "enum": [
              "NOT_STARTED",
              "PENDING",
              "SUCCESS",
              "FAILED",
              "TEMPORARY_FAILURE"
            ],
            "nullable": true
          },
          "sesVerificationCheckedAt": {
            "type": "object",
            "description": "When Amazon SES was last polled for this domain",
            "nullable": true
          }
        },
        "required": [
          "message",
          "dnsChecks",
          "fullyVerified"
        ]
      },
      "PushDnsRecordsDto": {
        "type": "object",
        "properties": {
          "domainName": {
            "type": "string",
            "description": "Domain name to push DNS records for",
            "example": "example.com"
          }
        },
        "required": [
          "domainName"
        ]
      },
      "DnsRecordDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "DNS record type",
            "example": "TXT"
          },
          "name": {
            "type": "string",
            "description": "Full DNS record name",
            "example": "example.com"
          },
          "shortName": {
            "type": "string",
            "description": "Short DNS record name",
            "example": "bounce"
          },
          "value": {
            "type": "string",
            "description": "DNS record value",
            "example": "v=spf1 include:spf.cobalt.obmengine.com ~all"
          },
          "priority": {
            "type": "number",
            "description": "DNS record priority (for MX records)",
            "example": 10
          },
          "purpose": {
            "type": "string",
            "description": "DNS record purpose",
            "enum": [
              "spf",
              "dkim",
              "return_path",
              "mx",
              "dmarc"
            ]
          }
        },
        "required": [
          "type",
          "name",
          "value",
          "purpose"
        ]
      },
      "DnsRecordPushResultDto": {
        "type": "object",
        "properties": {
          "record": {
            "description": "DNS record that was pushed",
            "allOf": [
              {
                "$ref": "#/components/schemas/DnsRecordDto"
              }
            ]
          },
          "success": {
            "type": "boolean",
            "description": "Whether the push was successful",
            "example": true
          },
          "error": {
            "type": "string",
            "description": "Error message if push failed",
            "example": null
          }
        },
        "required": [
          "record",
          "success"
        ]
      },
      "PushDnsRecordsResponseDto": {
        "type": "object",
        "properties": {
          "domainName": {
            "type": "string",
            "description": "Domain name",
            "example": "example.com"
          },
          "message": {
            "type": "string",
            "description": "Overall message about the operation",
            "example": "DNS records push initiated for example.com"
          },
          "dnsRecords": {
            "description": "List of DNS records to be pushed",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DnsRecordDto"
            }
          },
          "results": {
            "description": "Results of pushing each DNS record",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DnsRecordPushResultDto"
            }
          }
        },
        "required": [
          "domainName",
          "message",
          "dnsRecords"
        ]
      },
      "BulkPushDnsRecordsDto": {
        "type": "object",
        "properties": {
          "domainNames": {
            "description": "Array of domain names to push DNS records for",
            "example": [
              "example1.com",
              "example2.com"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "domainNames"
        ]
      },
      "RepushDomainDto": {
        "type": "object",
        "properties": {
          "domainName": {
            "type": "string",
            "description": "Domain name to force-repush",
            "example": "example.com"
          }
        },
        "required": [
          "domainName"
        ]
      },
      "RepushEmailDnsStatusDto": {
        "type": "object",
        "properties": {
          "pushed": {
            "type": "boolean",
            "example": true
          },
          "successCount": {
            "type": "number",
            "example": 4
          },
          "failureCount": {
            "type": "number",
            "example": 0
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "pushed"
        ]
      },
      "RepushDomainResponseDto": {
        "type": "object",
        "properties": {
          "domainName": {
            "type": "string",
            "example": "example.com"
          },
          "customDmarcApplied": {
            "type": "boolean",
            "example": true,
            "description": "Whether a custom DMARC record was applied from org product config"
          },
          "dmarcRecord": {
            "type": "string",
            "example": "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com,mailto:abuse@example.com;"
          },
          "inboundRouteRecreated": {
            "type": "boolean",
            "example": true,
            "description": "Whether the Postal inbound wildcard route was re-created"
          },
          "hasDnsManager": {
            "type": "boolean",
            "example": true
          },
          "emailDns": {
            "$ref": "#/components/schemas/RepushEmailDnsStatusDto"
          }
        },
        "required": [
          "domainName",
          "customDmarcApplied",
          "dmarcRecord",
          "inboundRouteRecreated",
          "hasDnsManager"
        ]
      },
      "BulkRepushDomainsDto": {
        "type": "object",
        "properties": {
          "domainNames": {
            "description": "List of domain names to force-repush",
            "example": [
              "example.com",
              "another.com"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "domainNames"
        ]
      },
      "DomainDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Domain UUID"
          },
          "domainName": {
            "type": "string",
            "description": "Domain name"
          },
          "leased": {
            "type": "boolean",
            "description": "Leased from the Mission Inbox domain marketplace rather than owned by the customer. Mission Inbox holds the registration and manages the DNS, so a leased domain cannot be deleted and its records cannot be cleared — both are refused by the API, not only hidden in the UI. Adding subdomains is unaffected.",
            "example": false
          },
          "leasedAt": {
            "type": "object",
            "description": "When the lease started. Null for owned domains.",
            "nullable": true
          },
          "verified": {
            "type": "boolean",
            "description": "Whether the required DNS records resolve correctly. For Transactional domains this is not the same as being able to send — Amazon SES has to confirm the same records itself first; see verificationState."
          },
          "verificationState": {
            "type": "string",
            "description": "Where the domain sits in the verification pipeline. Sales domains only ever report 'dns_pending' or 'verified'. Transactional domains also pass through 'awaiting_ses' — DNS is correct and Amazon SES is still confirming it, which usually takes minutes and may take up to 72 hours.",
            "enum": [
              "dns_pending",
              "awaiting_ses",
              "verified",
              "ses_failed"
            ]
          },
          "verificationMessage": {
            "type": "string",
            "description": "Customer-facing explanation of verificationState, including what (if anything) they need to do about it."
          },
          "sesVerificationStatus": {
            "type": "string",
            "description": "Amazon SES's own verification status. Null for Sales domains, and for Transactional domains SES has not been polled about yet.",
            "enum": [
              "NOT_STARTED",
              "PENDING",
              "SUCCESS",
              "FAILED",
              "TEMPORARY_FAILURE"
            ],
            "nullable": true
          },
          "sesVerificationCheckedAt": {
            "type": "object",
            "description": "When Amazon SES was last polled about this domain",
            "nullable": true
          },
          "spfStatus": {
            "type": "string",
            "description": "SPF DNS status",
            "enum": [
              "OK",
              "Invalid",
              "Missing",
              "ERROR",
              "pending",
              null
            ]
          },
          "dkimStatus": {
            "type": "string",
            "description": "DKIM DNS status",
            "enum": [
              "OK",
              "Invalid",
              "Missing",
              "ERROR",
              "pending",
              null
            ]
          },
          "returnPathStatus": {
            "type": "string",
            "description": "Return Path DNS status",
            "enum": [
              "OK",
              "Invalid",
              "Missing",
              "ERROR",
              "pending",
              null
            ]
          },
          "mxStatus": {
            "type": "string",
            "description": "MX DNS status",
            "enum": [
              "OK",
              "Invalid",
              "Missing",
              "ERROR",
              "pending",
              null
            ]
          },
          "dmarcStatus": {
            "type": "string",
            "description": "DMARC DNS status",
            "enum": [
              "OK",
              "Invalid",
              "Missing",
              "ERROR",
              "pending",
              null
            ]
          },
          "projectId": {
            "type": "string",
            "description": "Project ID"
          },
          "projectName": {
            "type": "string",
            "description": "Project name"
          },
          "warmupStartDate": {
            "format": "date-time",
            "type": "string",
            "description": "Warmup start date (null if not active)"
          },
          "warmedDays": {
            "type": "number",
            "description": "Days warmed (cumulative)"
          },
          "totalWarmedDays": {
            "type": "number",
            "description": "Total warmed days (cumulative + current session)"
          },
          "isWarmupActive": {
            "type": "boolean",
            "description": "Whether warmup is currently active"
          },
          "emailSent": {
            "type": "number",
            "description": "Emails sent"
          },
          "mailboxCount": {
            "type": "number",
            "description": "Number of mailboxes"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Domain created date"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Domain updated date"
          },
          "customMxEnabled": {
            "type": "boolean",
            "description": "Whether custom MX routing is enabled for this domain"
          },
          "messagesToday": {
            "type": "number",
            "description": "Number of messages sent today (legacy field)"
          },
          "messagesMonth": {
            "type": "number",
            "description": "Number of messages sent this month (legacy field)"
          },
          "blacklistProviders": {
            "description": "DNSBL providers this domain is currently listed on (e.g. [\"DBL\", \"SURBL\"])",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "blacklistProvider": {
            "type": "object",
            "description": "Which blocklist(s) the domain is listed on, or null if clean",
            "nullable": true,
            "example": "DBL"
          },
          "blacklistCheckedAt": {
            "type": "object",
            "description": "Last time the domain was checked against DBL/SURBL",
            "nullable": true
          },
          "blacklistedAt": {
            "type": "object",
            "description": "When the domain was first flagged as listed",
            "nullable": true
          },
          "delistedBy": {
            "type": "object",
            "description": "Admin who delisted the domain, if any",
            "nullable": true
          },
          "delistedAt": {
            "type": "object",
            "description": "When the domain was delisted, if any",
            "nullable": true
          },
          "dnsProvider": {
            "type": "object",
            "description": "DNS provider derived from the name servers, e.g. \"Cloudflare\". Null when never collected or the lookup found nothing",
            "example": "Cloudflare",
            "nullable": true
          },
          "domainAgeDays": {
            "type": "object",
            "description": "Whole days since the domain was registered, or null when the registration date is unknown",
            "example": 83,
            "nullable": true
          }
        },
        "required": [
          "id",
          "domainName",
          "leased",
          "verified",
          "verificationState",
          "verificationMessage",
          "spfStatus",
          "dkimStatus",
          "returnPathStatus"
        ]
      },
      "DomainAdminMailboxDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Mailbox email address",
            "example": "admin@example.com"
          },
          "role": {
            "type": "string",
            "description": "Mailbox role (local part): admin, abuse or postmaster",
            "example": "admin"
          }
        },
        "required": [
          "email",
          "role"
        ]
      },
      "DomainAdminMailboxesResponseDto": {
        "type": "object",
        "properties": {
          "domainName": {
            "type": "string",
            "description": "Domain name",
            "example": "example.com"
          },
          "password": {
            "type": "object",
            "description": "Shared password for the admin/abuse/postmaster mailboxes. Null if the domain has not been provisioned with an admin password yet.",
            "example": "aB3!xY7@kLm9$pQ2",
            "nullable": true
          },
          "mailboxes": {
            "description": "The admin mailboxes for this domain",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DomainAdminMailboxDto"
            }
          }
        },
        "required": [
          "domainName",
          "password",
          "mailboxes"
        ]
      },
      "DomainRegistrationInfoDto": {
        "type": "object",
        "properties": {
          "dnsProvider": {
            "type": "object",
            "description": "DNS provider derived from the name servers",
            "example": "Cloudflare",
            "nullable": true
          },
          "nameServers": {
            "description": "Authoritative name servers",
            "example": [
              "drew.ns.cloudflare.com",
              "gina.ns.cloudflare.com"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "registrar": {
            "type": "object",
            "description": "Registrar of record",
            "example": "GoDaddy.com, LLC",
            "nullable": true
          },
          "registeredAt": {
            "type": "object",
            "description": "Domain creation/registration date — the closest public proxy for when the domain was purchased",
            "example": "2019-04-12T00:00:00.000Z",
            "nullable": true
          },
          "expiresAt": {
            "type": "object",
            "description": "Registry expiry date, when the TLD publishes it",
            "example": "2027-04-12T00:00:00.000Z",
            "nullable": true
          },
          "ageDays": {
            "type": "object",
            "description": "Whole days since registeredAt (domain age), or null when the registration date is unknown",
            "example": 2340,
            "nullable": true
          },
          "collectedAt": {
            "type": "object",
            "description": "When this metadata was collected; null if never collected",
            "nullable": true
          }
        },
        "required": [
          "dnsProvider",
          "nameServers",
          "registrar",
          "registeredAt",
          "expiresAt",
          "ageDays",
          "collectedAt"
        ]
      },
      "TrackingDomainRecordDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "example": "CNAME"
          },
          "name": {
            "type": "string",
            "example": "track.yourdomain.com"
          },
          "value": {
            "type": "string",
            "example": "click.missionses.org"
          }
        },
        "required": [
          "type",
          "name",
          "value"
        ]
      },
      "TrackingDomainCheckDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "OK once the record is right. Missing means nothing is published yet, Invalid means something else is, and ERROR means the lookup itself did not answer.",
            "example": "Missing"
          },
          "checkedAt": {
            "type": "object",
            "example": "2026-09-08T12:00:00.000Z",
            "nullable": true
          },
          "error": {
            "type": "object",
            "description": "What is wrong and what to change, or null when nothing is.",
            "example": "No CNAME record found at track.yourdomain.com.",
            "nullable": true
          }
        },
        "required": [
          "status"
        ]
      },
      "TrackingDomainTlsDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "pending while the certificate is being obtained, ready once it is, failed when the certificate authority refused, manual where certificates are not issued.",
            "example": "pending"
          },
          "checkedAt": {
            "type": "object",
            "example": "2026-09-08T12:00:00.000Z",
            "nullable": true
          },
          "error": {
            "type": "object",
            "nullable": true
          }
        },
        "required": [
          "status"
        ]
      },
      "RetiredTrackingHostnameDto": {
        "type": "object",
        "properties": {
          "hostname": {
            "type": "string",
            "example": "links.yourdomain.com"
          },
          "retiredAt": {
            "type": "string",
            "description": "When it stopped being the hostname new mail is sent on.",
            "example": "2026-09-08T12:00:00.000Z"
          }
        },
        "required": [
          "hostname",
          "retiredAt"
        ]
      },
      "DomainTrackingDto": {
        "type": "object",
        "properties": {
          "hostname": {
            "type": "object",
            "description": "Null when this domain has no tracking hostname of its own.",
            "example": "links.yourdomain.com",
            "nullable": true
          },
          "status": {
            "type": "object",
            "description": "pending_dns while it waits for the record, provisioning_tls while the certificate is obtained, active once it is proven to serve tracking, failing if it stops. Null when none is configured. Only an active hostname is used on a send.",
            "example": "pending_dns",
            "nullable": true
          },
          "record": {
            "description": "The one record to publish. Null when none is configured.",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/TrackingDomainRecordDto"
              }
            ]
          },
          "cnameTarget": {
            "type": "string",
            "description": "The name every tracking hostname points at. Publish a CNAME, set to DNS only, never proxied.",
            "example": "click.missionses.org"
          },
          "dns": {
            "$ref": "#/components/schemas/TrackingDomainCheckDto"
          },
          "tls": {
            "$ref": "#/components/schemas/TrackingDomainTlsDto"
          },
          "activatedAt": {
            "type": "object",
            "example": "2026-09-08T12:05:00.000Z",
            "nullable": true
          },
          "canPushDns": {
            "type": "boolean",
            "description": "True when this domain is managed by a DNS provider you have connected, so the record can be published for you.",
            "example": false
          },
          "openTracking": {
            "type": "object",
            "description": "This domain's own answer on open tracking, or null when it follows the account default.",
            "example": true,
            "nullable": true
          },
          "clickTracking": {
            "type": "object",
            "description": "This domain's own answer on click tracking, or null when it follows the account default.",
            "example": null,
            "nullable": true
          },
          "accountOpenTracking": {
            "type": "boolean",
            "description": "The account default a domain follows while its own answer is null. Changing it moves every domain still following it.",
            "example": false
          },
          "accountClickTracking": {
            "type": "boolean",
            "example": false
          },
          "effectiveOpenTracking": {
            "type": "boolean",
            "description": "What a send on this domain actually does, with the two above already resolved. A send can still override either with track_opens and track_clicks.",
            "example": true
          },
          "effectiveClickTracking": {
            "type": "boolean",
            "example": false
          },
          "retiredHostnames": {
            "description": "Hostnames this domain used to send on and is still serving, so links in mail already sent keep working. They keep working only while their CNAME stays published: a certificate cannot be renewed for a name that no longer points at us.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RetiredTrackingHostnameDto"
            }
          }
        },
        "required": [
          "cnameTarget",
          "dns",
          "tls",
          "canPushDns",
          "accountOpenTracking",
          "accountClickTracking",
          "effectiveOpenTracking",
          "effectiveClickTracking",
          "retiredHostnames"
        ]
      },
      "DnsRecordsResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Domain ID",
            "example": "6a84bf23-825d-464f-8aa2-4ee218ecde93"
          },
          "name": {
            "type": "string",
            "description": "Domain name",
            "example": "guten.accesslended.co"
          },
          "projectId": {
            "type": "string",
            "description": "Project ID",
            "example": "b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a"
          },
          "projectName": {
            "type": "string",
            "description": "Project name",
            "example": "MI transaction"
          },
          "spfStatus": {
            "type": "string",
            "description": "SPF status",
            "example": "Missing",
            "enum": [
              "OK",
              "Invalid",
              "Missing",
              "ERROR",
              "pending"
            ]
          },
          "dkimStatus": {
            "type": "string",
            "description": "DKIM status (aggregate): \"OK\" only when both the s1 and s2 selectors are correctly published",
            "example": "Missing",
            "enum": [
              "OK",
              "Invalid",
              "Missing",
              "ERROR",
              "pending"
            ]
          },
          "dkimS1Status": {
            "type": "string",
            "description": "DKIM s1 selector status",
            "example": "Missing",
            "enum": [
              "OK",
              "Invalid",
              "Missing",
              "ERROR",
              "pending"
            ]
          },
          "dkimS1Error": {
            "type": "object",
            "description": "DKIM s1 selector error message"
          },
          "dkimS2Status": {
            "type": "string",
            "description": "DKIM s2 selector status",
            "example": "Missing",
            "enum": [
              "OK",
              "Invalid",
              "Missing",
              "ERROR",
              "pending"
            ]
          },
          "dkimS2Error": {
            "type": "object",
            "description": "DKIM s2 selector error message"
          },
          "rpStatus": {
            "type": "string",
            "description": "Return path status",
            "example": "Missing",
            "enum": [
              "OK",
              "Invalid",
              "Missing",
              "ERROR",
              "pending"
            ]
          },
          "mxStatus": {
            "type": "string",
            "description": "MX status",
            "example": "Missing",
            "enum": [
              "OK",
              "Invalid",
              "Missing",
              "ERROR",
              "pending"
            ]
          },
          "dmarcStatus": {
            "type": "string",
            "description": "DMARC status",
            "example": "OK",
            "enum": [
              "OK",
              "Invalid",
              "Missing",
              "ERROR",
              "pending"
            ]
          },
          "verificationState": {
            "type": "string",
            "description": "Where the domain sits in the verification pipeline. Transactional/SES domains pass through 'awaiting_ses' once their DNS resolves: Amazon SES re-checks the same records from its own resolvers before it will accept a send, which usually takes minutes and may take up to 72 hours.",
            "enum": [
              "dns_pending",
              "awaiting_ses",
              "verified",
              "ses_failed"
            ]
          },
          "verificationMessage": {
            "type": "string",
            "description": "Customer-facing explanation of verificationState"
          },
          "sesVerificationStatus": {
            "type": "string",
            "description": "Amazon SES's own verification status; null for Sales domains",
            "enum": [
              "NOT_STARTED",
              "PENDING",
              "SUCCESS",
              "FAILED",
              "TEMPORARY_FAILURE"
            ],
            "nullable": true
          },
          "sesVerificationCheckedAt": {
            "type": "object",
            "description": "When Amazon SES was last polled about this domain",
            "nullable": true
          },
          "warmupStartDate": {
            "format": "date-time",
            "type": "string",
            "description": "Warmup start date (null if not active)",
            "example": "2025-12-23T00:00:00Z"
          },
          "warmedDays": {
            "type": "number",
            "description": "Days warmed (cumulative)",
            "example": 0
          },
          "totalWarmedDays": {
            "type": "number",
            "description": "Total warmed days (cumulative + current session)",
            "example": 0
          },
          "isWarmupActive": {
            "type": "boolean",
            "description": "Whether warmup is currently active",
            "example": false
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Created at",
            "example": "2025-12-23T05:50:35.579Z"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Updated at",
            "example": "2025-12-23T06:09:37.150Z"
          },
          "customMxEnabled": {
            "type": "boolean",
            "description": "Whether custom MX routing is enabled for this domain",
            "example": false
          },
          "blacklistProviders": {
            "description": "Everything currently reporting this domain as listed. Empty when the domain is clean. Shown to the customer, so entries may be provider codes (DBL, SURBL) or a free-text reason from a manual block",
            "example": [
              "DBL"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "blacklistProvider": {
            "type": "object",
            "description": "The same list pre-joined for display, or null if clean",
            "example": "DBL",
            "nullable": true
          },
          "dnsRecords": {
            "description": "DNS records the customer needs to publish on their own domain (spf, dkim_s1, dkim_s2, mx, dmarc, and return_path unless the sending account has optionalReturnPathCheck enabled)",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DnsRecordDto"
            }
          },
          "platformRecords": {
            "description": "Platform-side records (\"_target\" purposes) that Postal expects at its own CNAME/SPF-include targets, on the platform's own zone -- never shown to the customer, pushed there on the backend instead",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DnsRecordDto"
            }
          },
          "registrationInfo": {
            "description": "Public registration metadata collected at creation time. Present for Transactional domains only; omitted for Sales domains",
            "allOf": [
              {
                "$ref": "#/components/schemas/DomainRegistrationInfoDto"
              }
            ]
          },
          "tracking": {
            "description": "This domain's own tracking: the hostname and how far along it is, the two switches at every level, and the hostnames it has retired. Present for Transactional domains only; omitted for Sales domains",
            "allOf": [
              {
                "$ref": "#/components/schemas/DomainTrackingDto"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "spfStatus",
          "dkimStatus",
          "rpStatus",
          "mxStatus",
          "dmarcStatus",
          "verificationState",
          "verificationMessage",
          "warmedDays",
          "totalWarmedDays",
          "isWarmupActive",
          "createdAt",
          "updatedAt",
          "dnsRecords",
          "platformRecords"
        ]
      },
      "UpdateDomainDto": {
        "type": "object",
        "properties": {
          "tracking_subdomain": {
            "type": "object",
            "description": "A label under this domain, such as \"links\", or the whole hostname, \"links.yourdomain.com\". It cannot be the domain itself, cannot be www, and cannot be a name that already carries this domain's mail records. It can be changed but never removed, so links in mail already sent keep working.",
            "example": "links"
          },
          "open_tracking": {
            "type": "object",
            "description": "true or false to decide open tracking for this domain, or null to follow the account default. Leave the field out to change nothing.",
            "example": true,
            "nullable": true
          },
          "click_tracking": {
            "type": "object",
            "description": "true or false to decide click tracking for this domain, or null to follow the account default. Leave the field out to change nothing.",
            "example": true,
            "nullable": true
          }
        }
      },
      "CleanDnsRecordResultDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "mi-abc123._domainkey.hong.fastmissioninbox.com"
          },
          "type": {
            "type": "string",
            "example": "TXT"
          },
          "deleted": {
            "type": "boolean",
            "example": true
          },
          "error": {
            "type": "string",
            "example": null
          }
        },
        "required": [
          "name",
          "type",
          "deleted"
        ]
      },
      "CleanDnsRecordsResponseDto": {
        "type": "object",
        "properties": {
          "domainName": {
            "type": "string",
            "example": "hong.fastmissioninbox.com"
          },
          "provider": {
            "type": "string",
            "example": "cloudflare"
          },
          "message": {
            "type": "string",
            "example": "Cleaned 4 MissionInbox DNS record(s) for hong.fastmissioninbox.com via cloudflare."
          },
          "deletedCount": {
            "type": "number",
            "example": 4
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CleanDnsRecordResultDto"
            }
          }
        },
        "required": [
          "domainName",
          "provider",
          "message",
          "deletedCount",
          "results"
        ]
      },
      "TrackingDomainResponseDto": {
        "type": "object",
        "properties": {
          "hostname": {
            "type": "object",
            "description": "Null when no tracking hostname is configured.",
            "example": "track.yourdomain.com",
            "nullable": true
          },
          "status": {
            "type": "object",
            "description": "pending_dns while it waits for the record, provisioning_tls while the certificate is obtained, active once it is proven to serve tracking, failing if it stops. Null when none is configured. Only an active hostname is used on a send.",
            "example": "pending_dns",
            "nullable": true
          },
          "record": {
            "description": "The one record to publish. Null when none is configured.",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/TrackingDomainRecordDto"
              }
            ]
          },
          "cnameTarget": {
            "type": "string",
            "description": "The name every tracking hostname points at. Publish a CNAME, set to DNS only, never proxied.",
            "example": "click.missionses.org"
          },
          "dns": {
            "$ref": "#/components/schemas/TrackingDomainCheckDto"
          },
          "tls": {
            "$ref": "#/components/schemas/TrackingDomainTlsDto"
          },
          "activatedAt": {
            "type": "object",
            "example": "2026-09-08T12:05:00.000Z",
            "nullable": true
          },
          "canPushDns": {
            "type": "boolean",
            "description": "True when the domain this hostname sits under is managed by a DNS provider you have connected, so the record can be published for you.",
            "example": false
          }
        },
        "required": [
          "cnameTarget",
          "dns",
          "tls",
          "canPushDns"
        ]
      },
      "SetTrackingDomainDto": {
        "type": "object",
        "properties": {
          "hostname": {
            "type": "string",
            "description": "A subdomain of a domain you already send from, such as track.yourdomain.com. It cannot be the domain itself, cannot be www, and cannot be a name that already carries your mail records.",
            "example": "track.yourdomain.com"
          }
        },
        "required": [
          "hostname"
        ]
      },
      "TrackingDomainPushDnsResponseDto": {
        "type": "object",
        "properties": {
          "pushed": {
            "type": "boolean",
            "example": true
          },
          "provider": {
            "type": "object",
            "example": "cloudflare",
            "nullable": true
          },
          "error": {
            "type": "object",
            "example": "No DNS provider is connected for this domain.",
            "nullable": true
          },
          "trackingDomain": {
            "$ref": "#/components/schemas/TrackingDomainResponseDto"
          }
        },
        "required": [
          "pushed",
          "trackingDomain"
        ]
      },
      "TransactionalSettingsResponseDto": {
        "type": "object",
        "properties": {
          "trackOpens": {
            "type": "boolean",
            "example": false
          },
          "trackClicks": {
            "type": "boolean",
            "example": false
          },
          "updatedAt": {
            "type": "string",
            "example": "2026-09-03T21:00:00.000Z"
          }
        },
        "required": [
          "trackOpens",
          "trackClicks",
          "updatedAt"
        ]
      },
      "UpdateTransactionalSettingsDto": {
        "type": "object",
        "properties": {
          "trackOpens": {
            "type": "boolean",
            "description": "Add an open-tracking image to HTML sends by default. A request can override it with `track_opens`.",
            "example": false
          },
          "trackClicks": {
            "type": "boolean",
            "description": "Rewrite the links in HTML sends through the tracking domain by default. A request can override it with `track_clicks`.",
            "example": false
          }
        }
      },
      "TaskResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Task ID"
          },
          "type": {
            "type": "string",
            "enum": [
              "BULK_DOMAIN_CREATE",
              "BULK_DOMAIN_VERIFY",
              "BULK_DOMAIN_DELETE",
              "BULK_MAILBOX_CREATE",
              "BULK_MAILBOX_DELETE",
              "BULK_DNS_PUSH",
              "BULK_WARMUP_TOGGLE",
              "BULK_DOMAIN_WARMUP_TOGGLE",
              "EMAIL_TEST_SEND",
              "EMAIL_HEALTH_CHECK",
              "MAILBOX_HEALTH_CHECK",
              "ORGANIZATION_CACHE_SYNC",
              "ADMIN_BULK_DOMAIN_POSTAL_SYNC",
              "ADMIN_BULK_DNS_PUSH",
              "ADMIN_BULK_DOMAIN_VERIFY",
              "ADMIN_BULK_MOVE_MAILBOXES_TO_WARMUP",
              "ROUTE_SYNC",
              "BULK_CONNECT_INSTANTLY",
              "BULK_CONNECT_SMARTLEAD",
              "BULK_CONNECT_EMAILBISON",
              "WARMY_SYNC_CHECK",
              "WARMY_CACHE_SYNC",
              "BULK_WARMY_RECONNECT",
              "BULK_WARMY_DELETE",
              "BULK_WARMY_RELINK",
              "ADMIN_BULK_WARMUP_PROVIDER_MIGRATE",
              "DOMAIN_WARMY_CACHE_SYNC",
              "ADMIN_BULK_DOMAIN_WARMY_MAILBOX_DELETE",
              "ADMIN_BULK_DOMAIN_WARMY_MAILBOX_RECONNECT",
              "ADMIN_BULK_FIX_ORPHANED_DOMAIN_WARMUP",
              "ADMIN_BULK_MIGRATE_DOMAIN_WARMUP_TO_IPWARMUP",
              "ADMIN_CLEANUP_CANCELLED_SUBSCRIPTION",
              "ADMIN_BULK_WARMUP_MAILBOX_RECONNECT",
              "ADMIN_BULK_DOMAIN_WARMUP_IPWARMUP_SYNC",
              "BULK_DOMAIN_REPUSH",
              "REGISTER_SWITCHED_DOMAINS",
              "ADMIN_DNS_CREDENTIAL_BACKFILL",
              "NAMESERVER_DELEGATION_CHAIN",
              "NAMESERVER_DELEGATION_STUCK_SWEEP",
              "ADMIN_CUBE_MAILBOX_TRANSFER",
              "DOMAIN_REGISTRATION_INFO_COLLECT",
              "ADMIN_CUBE_TRANSFER_SYNC",
              "NAMESERVER_MOVE_BACK",
              "ADMIN_DOMAIN_WARMUP_PROVIDER_MIGRATE",
              "NAMESERVER_PREMOVE_CHECK",
              "DNS_CHANGE_SCAN",
              "ADMIN_DNS_SNAPSHOT_BACKFILL"
            ],
            "description": "Type of task"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "PROCESSING",
              "COMPLETED",
              "FAILED",
              "CANCELLED"
            ],
            "description": "Current status of the task"
          },
          "progress": {
            "type": "number",
            "description": "Progress percentage (0-100)",
            "minimum": 0,
            "maximum": 100
          },
          "payload": {
            "type": "object",
            "description": "Task payload/parameters"
          },
          "result": {
            "type": "object",
            "description": "Task result data"
          },
          "errors": {
            "description": "Error messages if task failed",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "processingStartedAt": {
            "format": "date-time",
            "type": "string",
            "description": "When task processing started"
          },
          "completedAt": {
            "format": "date-time",
            "type": "string",
            "description": "When task was completed"
          },
          "retryCount": {
            "type": "number",
            "description": "Current retry count"
          },
          "maxRetries": {
            "type": "number",
            "description": "Maximum retry attempts"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "When task was created"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "description": "When task was last updated"
          }
        },
        "required": [
          "id",
          "type",
          "status",
          "progress",
          "retryCount",
          "maxRetries",
          "createdAt",
          "updatedAt"
        ]
      },
      "TaskListResponseDto": {
        "type": "object",
        "properties": {
          "tasks": {
            "description": "List of tasks",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaskResponseDto"
            }
          },
          "total": {
            "type": "number",
            "description": "Total number of tasks matching the query",
            "example": 100
          },
          "page": {
            "type": "number",
            "description": "Current page number",
            "example": 1
          },
          "limit": {
            "type": "number",
            "description": "Number of items per page",
            "example": 20
          },
          "totalPages": {
            "type": "number",
            "description": "Total number of pages",
            "example": 5
          }
        },
        "required": [
          "tasks",
          "total",
          "page",
          "limit",
          "totalPages"
        ]
      },
      "TaskOutputDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Output line ID"
          },
          "taskId": {
            "type": "string",
            "description": "Task ID this line belongs to"
          },
          "subName": {
            "type": "string",
            "description": "Optional sub-step / item label"
          },
          "level": {
            "type": "string",
            "enum": [
              "INFO",
              "WARNING",
              "ERROR",
              "DEBUG"
            ],
            "description": "Log level"
          },
          "message": {
            "type": "string",
            "description": "Log message"
          },
          "metadata": {
            "type": "object",
            "description": "Optional structured metadata"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "When the line was emitted"
          }
        },
        "required": [
          "id",
          "taskId",
          "level",
          "message",
          "createdAt"
        ]
      },
      "TaskOutputsResponseDto": {
        "type": "object",
        "properties": {
          "outputs": {
            "description": "Execution log lines (chronological)",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaskOutputDto"
            }
          }
        },
        "required": [
          "outputs"
        ]
      },
      "TaskStatsResponseDto": {
        "type": "object",
        "properties": {
          "totalTasks": {
            "type": "number",
            "description": "Total number of tasks",
            "example": 42
          },
          "pendingTasks": {
            "type": "number",
            "description": "Number of pending tasks",
            "example": 5
          },
          "processingTasks": {
            "type": "number",
            "description": "Number of currently processing tasks",
            "example": 2
          },
          "completedTasks": {
            "type": "number",
            "description": "Number of completed tasks",
            "example": 30
          },
          "failedTasks": {
            "type": "number",
            "description": "Number of failed tasks",
            "example": 3
          },
          "cancelledTasks": {
            "type": "number",
            "description": "Number of cancelled tasks",
            "example": 2
          }
        },
        "required": [
          "totalTasks",
          "pendingTasks",
          "processingTasks",
          "completedTasks",
          "failedTasks",
          "cancelledTasks"
        ]
      },
      "BulkToggleWarmupDto": {
        "type": "object",
        "properties": {
          "emails": {
            "description": "Array of mailbox email addresses",
            "example": [
              "john@example.com",
              "jane@example.com"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean",
            "description": "Enable or disable warmup",
            "example": true
          }
        },
        "required": [
          "emails",
          "enabled"
        ]
      },
      "BulkToggleWarmupResponseDto": {
        "type": "object",
        "properties": {
          "taskId": {
            "type": "string",
            "description": "Task ID for tracking progress",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          },
          "totalMailboxes": {
            "type": "number",
            "description": "Total number of mailboxes to process",
            "example": 50
          },
          "message": {
            "type": "string",
            "description": "Status message",
            "example": "Bulk warmup processing started"
          }
        },
        "required": [
          "taskId",
          "totalMailboxes",
          "message"
        ]
      },
      "ToggleWarmupDto": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Enable or disable warmup for the mailbox",
            "example": true
          }
        },
        "required": [
          "enabled"
        ]
      },
      "ToggleWarmupResponseDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "Success status",
            "example": true
          },
          "message": {
            "type": "string",
            "description": "Response message",
            "example": "Warmup enabled successfully"
          },
          "mailboxId": {
            "type": "string",
            "description": "Mailbox ID (email)",
            "example": "john@example.com"
          },
          "enabled": {
            "type": "boolean",
            "description": "Current warmup status",
            "example": true
          },
          "syncStatus": {
            "type": "string",
            "description": "Sync status",
            "enum": [
              "synced",
              "pending",
              "error",
              "none"
            ],
            "example": "synced"
          },
          "lastSyncedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Last synced timestamp",
            "example": "2024-01-15T10:30:00Z"
          },
          "stateChanged": {
            "type": "boolean",
            "description": "Whether the warmup state actually changed (vs already in desired state)",
            "example": true
          }
        },
        "required": [
          "success",
          "message",
          "mailboxId",
          "enabled",
          "syncStatus",
          "lastSyncedAt"
        ]
      },
      "MailboxWarmupStatusDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Mailbox email address",
            "example": "john@example.com"
          },
          "warmupStartDate": {
            "format": "date-time",
            "type": "string",
            "description": "Warmup start date (null if not active)",
            "example": "2024-01-15T00:00:00Z"
          },
          "warmedDays": {
            "type": "number",
            "description": "Number of days warmed (cumulative)",
            "example": 14
          },
          "totalWarmedDays": {
            "type": "number",
            "description": "Total warmed days (cumulative + current session)",
            "example": 17
          },
          "isWarmupActive": {
            "type": "boolean",
            "description": "Whether warmup is currently active",
            "example": true
          }
        },
        "required": [
          "email",
          "warmedDays",
          "totalWarmedDays",
          "isWarmupActive"
        ]
      },
      "EmailBisonWarmupInfoDto": {
        "type": "object",
        "properties": {
          "senderEmailId": {
            "type": "number",
            "description": "Sender email ID inside Mission Inbox's Premium warm-up workspace",
            "example": 25063
          },
          "syncStatus": {
            "type": "string",
            "description": "Sync status with Premium warm-up",
            "enum": [
              "synced",
              "pending",
              "error",
              "none"
            ],
            "example": "synced"
          },
          "lastSyncedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Last sync timestamp",
            "example": "2026-09-10T10:30:00Z"
          },
          "syncErrorMessage": {
            "type": "string",
            "description": "Sync error message if any"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Created at timestamp",
            "example": "2026-09-10T10:30:00Z"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Updated at timestamp",
            "example": "2026-09-10T10:30:00Z"
          }
        },
        "required": [
          "senderEmailId",
          "syncStatus",
          "createdAt",
          "updatedAt"
        ]
      },
      "EmailBisonWarmupStatsDto": {
        "type": "object",
        "properties": {
          "warmupEmailsSent": {
            "type": "number",
            "description": "Warmup emails sent in the window",
            "example": 120
          },
          "warmupRepliesReceived": {
            "type": "number",
            "description": "Warmup replies received in the window",
            "example": 98
          },
          "warmupEmailsSavedFromSpam": {
            "type": "number",
            "description": "Warmup emails rescued from the spam folder",
            "example": 7
          },
          "warmupScore": {
            "type": "number",
            "description": "Warmup health score",
            "example": 92
          },
          "warmupBouncesReceivedCount": {
            "type": "number",
            "description": "Warmup bounces received",
            "example": 0
          },
          "warmupBouncesCausedCount": {
            "type": "number",
            "description": "Warmup bounces caused",
            "example": 0
          },
          "warmupDisabledForBouncingCount": {
            "type": "number",
            "description": "Times warmup was auto-disabled for bouncing",
            "example": 0
          },
          "startDate": {
            "type": "string",
            "description": "Start of the stats window (inclusive, YYYY-MM-DD)",
            "example": "2026-09-01"
          },
          "endDate": {
            "type": "string",
            "description": "End of the stats window (inclusive, YYYY-MM-DD)",
            "example": "2026-09-10"
          }
        },
        "required": [
          "warmupEmailsSent",
          "warmupRepliesReceived",
          "warmupEmailsSavedFromSpam",
          "warmupScore",
          "warmupBouncesReceivedCount",
          "warmupBouncesCausedCount",
          "warmupDisabledForBouncingCount",
          "startDate",
          "endDate"
        ]
      },
      "WarmupEventDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Event ID",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          },
          "action": {
            "type": "string",
            "description": "Action performed",
            "enum": [
              "enable",
              "disable"
            ],
            "example": "enable"
          },
          "status": {
            "type": "string",
            "description": "Event status",
            "enum": [
              "success",
              "failed"
            ],
            "example": "success"
          },
          "errorMessage": {
            "type": "string",
            "description": "Error message if failed",
            "example": "Connection timeout"
          },
          "performedByUserId": {
            "type": "string",
            "description": "User ID who performed the action",
            "example": "user_123"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Event timestamp",
            "example": "2024-01-15T10:30:00Z"
          }
        },
        "required": [
          "id",
          "action",
          "status",
          "createdAt"
        ]
      },
      "GetMailboxWarmupStatusResponseDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "Success status",
            "example": true
          },
          "mailbox": {
            "description": "Mailbox warmup status",
            "allOf": [
              {
                "$ref": "#/components/schemas/MailboxWarmupStatusDto"
              }
            ]
          },
          "emailBisonWarmup": {
            "description": "Premium warm-up link information",
            "allOf": [
              {
                "$ref": "#/components/schemas/EmailBisonWarmupInfoDto"
              }
            ]
          },
          "emailBisonWarmupStats": {
            "description": "Premium warm-up stats for the last 10 days. Omitted when the mailbox is not enrolled in Premium warm-up, or when the stats call failed.",
            "allOf": [
              {
                "$ref": "#/components/schemas/EmailBisonWarmupStatsDto"
              }
            ]
          },
          "eventHistory": {
            "description": "Warmup event history",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WarmupEventDto"
            }
          }
        },
        "required": [
          "success",
          "mailbox",
          "eventHistory"
        ]
      },
      "BulkToggleDomainWarmupDto": {
        "type": "object",
        "properties": {
          "domainNames": {
            "description": "Array of domain names",
            "example": [
              "example.com",
              "example2.com"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean",
            "description": "Enable or disable warmup for all mailboxes in these domains",
            "example": true
          },
          "unitCount": {
            "type": "number",
            "description": "Number of warmup units to allocate per domain. Only used when enabled: true and no warmup mailboxes exist yet for a domain. 1 unit = 2 mailboxes.",
            "example": 1,
            "minimum": 1,
            "default": 1
          }
        },
        "required": [
          "domainNames",
          "enabled"
        ]
      },
      "BulkToggleDomainWarmupResponseDto": {
        "type": "object",
        "properties": {
          "taskId": {
            "type": "string",
            "description": "Task ID for tracking progress",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          },
          "totalDomains": {
            "type": "number",
            "description": "Total number of domains to process",
            "example": 10
          },
          "message": {
            "type": "string",
            "description": "Status message",
            "example": "Bulk domain warmup processing started for 10 domains"
          }
        },
        "required": [
          "taskId",
          "totalDomains",
          "message"
        ]
      },
      "DomainWarmupMailboxDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Warmup mailbox email address",
            "example": "john.doe@example.com"
          },
          "firstName": {
            "type": "string",
            "description": "First name",
            "example": "John"
          },
          "lastName": {
            "type": "string",
            "description": "Last name",
            "example": "Doe"
          },
          "mailboxNumber": {
            "type": "number",
            "description": "Mailbox number (1 or 2)",
            "example": 1
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Created at timestamp",
            "example": "2025-12-23T05:50:35.579Z"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Updated at timestamp",
            "example": "2025-12-23T06:09:37.150Z"
          }
        },
        "required": [
          "email",
          "firstName",
          "lastName",
          "mailboxNumber",
          "createdAt",
          "updatedAt"
        ]
      },
      "GetDomainWarmupStatusResponseDto": {
        "type": "object",
        "properties": {
          "domainId": {
            "type": "string",
            "description": "Domain ID",
            "example": "6a84bf23-825d-464f-8aa2-4ee218ecde93"
          },
          "domainName": {
            "type": "string",
            "description": "Domain name",
            "example": "example.com"
          },
          "isVerified": {
            "type": "boolean",
            "description": "Whether domain is verified (SPF, DKIM, MX, RP, DMARC all OK)",
            "example": true
          },
          "spfStatus": {
            "type": "string",
            "description": "SPF status",
            "example": "OK"
          },
          "dkimStatus": {
            "type": "string",
            "description": "DKIM status",
            "example": "OK"
          },
          "mxStatus": {
            "type": "string",
            "description": "MX status",
            "example": "OK"
          },
          "rpStatus": {
            "type": "string",
            "description": "Return Path status",
            "example": "OK"
          },
          "dmarcStatus": {
            "type": "string",
            "description": "DMARC status",
            "example": "OK"
          },
          "warmupStartDate": {
            "format": "date-time",
            "type": "string",
            "description": "Warmup start date (null if not active)",
            "example": "2025-12-18T00:00:00Z"
          },
          "warmedDays": {
            "type": "number",
            "description": "Number of days warmed (cumulative)",
            "example": 5
          },
          "totalWarmedDays": {
            "type": "number",
            "description": "Total warmed days (cumulative + current session)",
            "example": 8
          },
          "isWarmupActive": {
            "type": "boolean",
            "description": "Whether warmup is currently active",
            "example": true
          },
          "customMxEnabled": {
            "type": "boolean",
            "description": "Whether custom MX routing is enabled for this domain",
            "example": false
          },
          "emailSent": {
            "type": "number",
            "description": "Total emails sent from all mailboxes in domain",
            "example": 450
          },
          "mailboxCount": {
            "type": "number",
            "description": "Number of regular mailboxes in domain",
            "example": 5
          },
          "warmupMailboxes": {
            "description": "Domain warmup mailboxes (for warmup only)",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DomainWarmupMailboxDto"
            }
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Domain created at timestamp",
            "example": "2025-12-20T10:15:22.123Z"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Domain updated at timestamp",
            "example": "2025-12-23T08:30:45.456Z"
          }
        },
        "required": [
          "domainId",
          "domainName",
          "isVerified",
          "spfStatus",
          "dkimStatus",
          "mxStatus",
          "rpStatus",
          "dmarcStatus",
          "warmedDays",
          "totalWarmedDays",
          "isWarmupActive",
          "customMxEnabled",
          "emailSent",
          "mailboxCount",
          "warmupMailboxes",
          "createdAt",
          "updatedAt"
        ]
      },
      "ToggleDomainWarmupDto": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Enable or disable warmup for the mailbox",
            "example": true
          },
          "unitCount": {
            "type": "number",
            "description": "Number of warmup units to allocate per domain. Only used when enabled: true and no warmup mailboxes exist yet for the domain. 1 unit = 2 mailboxes.",
            "example": 1,
            "minimum": 1,
            "default": 1
          }
        },
        "required": [
          "enabled"
        ]
      },
      "UpdateDomainWarmupUnitsDto": {
        "type": "object",
        "properties": {
          "unitCount": {
            "type": "number",
            "description": "Number of warmup units to allocate for this domain. 1 unit = 2 mailboxes. Must differ from the current unit count.",
            "example": 2,
            "minimum": 1
          }
        },
        "required": [
          "unitCount"
        ]
      },
      "UpdateDomainWarmupUnitsResponseDto": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "example": "Domain warmup updated successfully for example.com. 4 warmup mailbox(es) activated."
          },
          "mailboxesCount": {
            "type": "number",
            "example": 4,
            "description": "New total mailbox count"
          },
          "oldUnitCount": {
            "type": "number",
            "example": 1,
            "description": "Previous unit count"
          },
          "newUnitCount": {
            "type": "number",
            "example": 2,
            "description": "New unit count"
          },
          "billingEventFired": {
            "type": "boolean",
            "example": true,
            "description": "Whether a billing event was fired (units increased)"
          }
        },
        "required": [
          "message",
          "mailboxesCount",
          "oldUnitCount",
          "newUnitCount",
          "billingEventFired"
        ]
      },
      "CreateMailboxDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Email address for the mailbox (domain will be extracted from email)",
            "example": "john.doe@example.com"
          },
          "fullName": {
            "type": "string",
            "description": "Full name of the mailbox owner",
            "example": "John Doe"
          },
          "password": {
            "type": "string",
            "description": "Password for the mailbox",
            "example": "SecurePassword123!"
          },
          "replyTo": {
            "type": "string",
            "description": "Forward replies to this address. Replies still land in the mailbox; outgoing mail carries no Reply-To header.",
            "example": "reply@example.com"
          }
        },
        "required": [
          "email",
          "fullName"
        ]
      },
      "HealthCheckResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Health check ID",
            "example": "6a84bf23-825d-464f-8aa2-4ee218ecde93"
          },
          "testId": {
            "type": "string",
            "description": "GlockApps test ID",
            "example": "2026-07-03-17:31:51:896t"
          },
          "provider": {
            "type": "string",
            "description": "Vendor that produced this check ('mailreach' legacy | 'glockapps')",
            "example": "glockapps"
          },
          "status": {
            "type": "string",
            "description": "Health check status",
            "example": "COMPLETED",
            "enum": [
              "PENDING",
              "PROCESSING",
              "COMPLETED",
              "PARTIAL_COMPLETE",
              "FAILED"
            ]
          },
          "inboxRate": {
            "type": "number",
            "description": "Inbox placement rate (%) — headline metric",
            "example": 84.6
          },
          "spamRate": {
            "type": "number",
            "description": "Spam placement rate (%)",
            "example": 15.4
          },
          "otherRate": {
            "type": "number",
            "description": "Other/tabs placement rate (%)",
            "example": 0
          },
          "notDeliveredRate": {
            "type": "number",
            "description": "Not-delivered rate (%)",
            "example": 0
          },
          "inboxPlacement": {
            "type": "string",
            "description": "Headline placement",
            "example": "INBOX"
          },
          "summary": {
            "type": "object",
            "description": "Placement summary",
            "example": {
              "INBOX": 11,
              "SPAM": 2
            }
          },
          "testType": {
            "type": "string",
            "description": "Test type",
            "example": "ManualTest"
          },
          "errorMessage": {
            "type": "string",
            "description": "Error message if test failed",
            "example": "Failed to send emails"
          },
          "autoTriggered": {
            "type": "boolean",
            "description": "Whether this health check was automatically triggered by a schedule",
            "example": false
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Test creation timestamp",
            "example": "2026-07-03T05:50:35.579Z"
          },
          "completedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Test completion timestamp",
            "example": "2026-07-03T06:00:00.000Z"
          }
        },
        "required": [
          "id",
          "testId",
          "status",
          "autoTriggered",
          "createdAt"
        ]
      },
      "MailboxIntegrationDto": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "Instantly",
              "Emailbison",
              "SmartLead"
            ],
            "example": "Instantly"
          },
          "connectedAt": {
            "format": "date-time",
            "type": "string",
            "example": "2026-04-01T10:00:00.000Z"
          },
          "disconnectedAt": {
            "format": "date-time",
            "type": "string",
            "example": null
          }
        },
        "required": [
          "provider",
          "connectedAt"
        ]
      },
      "MailboxResponseDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Email address (primary key)",
            "example": "john.doe@example.com"
          },
          "fullName": {
            "type": "string",
            "description": "Full name",
            "example": "John Doe"
          },
          "password": {
            "type": "string",
            "description": "Password for the mailbox",
            "example": "SecurePassword123!"
          },
          "sent": {
            "type": "number",
            "description": "Number of emails sent",
            "example": 100
          },
          "warmupStartDate": {
            "format": "date-time",
            "type": "string",
            "description": "Warmup start date (null if not active)",
            "example": "2025-12-23T00:00:00Z"
          },
          "warmedDays": {
            "type": "number",
            "description": "Number of days warmed (cumulative)",
            "example": 14
          },
          "totalWarmedDays": {
            "type": "number",
            "description": "Total warmed days (cumulative + current session)",
            "example": 17
          },
          "isWarmupActive": {
            "type": "boolean",
            "description": "Whether warmup is currently active",
            "example": true
          },
          "domainId": {
            "type": "string",
            "description": "Domain ID",
            "example": "6a84bf23-825d-464f-8aa2-4ee218ecde93"
          },
          "domainName": {
            "type": "string",
            "description": "Domain name",
            "example": "example.com"
          },
          "domainBlacklistProviders": {
            "description": "Everything currently reporting this mailbox's DOMAIN as listed. Empty when clean. The block is domain-level, not per-mailbox: every mailbox on the domain stops sending together",
            "example": [
              "DBL"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "domainBlacklistProvider": {
            "type": "object",
            "description": "The same list pre-joined for display, or null if clean",
            "example": "DBL",
            "nullable": true
          },
          "projectId": {
            "type": "string",
            "description": "Project ID",
            "example": "b0b7ef65-0bb1-46e3-b6b8-0098daf1f51a"
          },
          "projectName": {
            "type": "string",
            "description": "Project name",
            "example": "Q1 Campaign"
          },
          "replyTo": {
            "type": "string",
            "description": "Address replies are forwarded to",
            "example": "reply@example.com"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Created at",
            "example": "2025-12-23T05:50:35.579Z"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Updated at",
            "example": "2025-12-23T06:09:37.150Z"
          },
          "latestHealthCheck": {
            "description": "Latest health check result",
            "allOf": [
              {
                "$ref": "#/components/schemas/HealthCheckResponseDto"
              }
            ]
          },
          "integrations": {
            "description": "Active integrations for this mailbox",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MailboxIntegrationDto"
            }
          },
          "rampUpCapReachedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Last time this mailbox hit its ramp-up daily cap on the relay server (null if never)",
            "example": "2026-07-27T10:00:00.000Z"
          },
          "rampUpCapReachedDay": {
            "type": "number",
            "description": "Mailbox's ramp-up day (1-indexed) when the cap was last hit",
            "example": 3
          },
          "rampUpCapReachedCap": {
            "type": "number",
            "description": "Daily send cap that was in effect when last hit",
            "example": 5
          },
          "rampUpNextResetAt": {
            "format": "date-time",
            "type": "string",
            "description": "When the mailbox can send again after last hitting its ramp-up cap (null if never capped)",
            "example": "2026-07-28T14:00:00.000Z"
          }
        },
        "required": [
          "email",
          "fullName",
          "sent",
          "warmedDays",
          "totalWarmedDays",
          "isWarmupActive",
          "domainId",
          "domainName",
          "createdAt",
          "updatedAt",
          "integrations"
        ]
      },
      "BulkCreateMailboxesDto": {
        "type": "object",
        "properties": {
          "mailboxes": {
            "description": "Array of mailbox creation items",
            "example": [
              {
                "email": "john.doe@example.com",
                "fullName": "John Doe",
                "password": "SecurePassword123!",
                "replyTo": "reply@example.com"
              },
              {
                "email": "jane.smith@example.com",
                "fullName": "Jane Smith"
              }
            ],
            "items": {
              "type": "array"
            },
            "type": "array"
          }
        },
        "required": [
          "mailboxes"
        ]
      },
      "BulkDeleteMailboxesDto": {
        "type": "object",
        "properties": {
          "emails": {
            "description": "Array of email addresses to delete",
            "example": [
              "user1@example.com",
              "user2@example.com",
              "user3@example.com"
            ],
            "items": {
              "type": "array"
            },
            "type": "array"
          }
        },
        "required": [
          "emails"
        ]
      },
      "BulkConnectInstantlyDto": {
        "type": "object",
        "properties": {
          "credentialId": {
            "type": "string",
            "format": "uuid",
            "description": "Integration credential (from GET /api/integration-credentials/my) to push with. Defaults to the first active credential for the provider."
          },
          "emails": {
            "example": [
              "john@example.com",
              "jane@example.com"
            ],
            "description": "Mailbox emails to connect to the customer Instantly account",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "emails"
        ]
      },
      "BulkConnectSmartleadDto": {
        "type": "object",
        "properties": {
          "credentialId": {
            "type": "string",
            "format": "uuid",
            "description": "Integration credential (from GET /api/integration-credentials/my) to push with. Defaults to the first active credential for the provider."
          },
          "emails": {
            "example": [
              "john@example.com",
              "jane@example.com"
            ],
            "description": "Mailbox emails to connect to the customer Smartlead account",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "emails"
        ]
      },
      "BulkConnectEmailBisonDto": {
        "type": "object",
        "properties": {
          "credentialId": {
            "type": "string",
            "format": "uuid",
            "description": "Integration credential (from GET /api/integration-credentials/my) to push with. Defaults to the first active credential for the provider."
          },
          "emails": {
            "example": [
              "john@example.com",
              "jane@example.com"
            ],
            "description": "Mailbox emails to connect to the customer EmailBison account",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "emails"
        ]
      },
      "SepCredentialSelectionDto": {
        "type": "object",
        "properties": {
          "credentialId": {
            "type": "string",
            "format": "uuid",
            "description": "Integration credential (from GET /api/integration-credentials/my) to push with. Defaults to the first active credential for the provider."
          }
        }
      },
      "MailboxStatisticsDto": {
        "type": "object",
        "properties": {
          "totalMailboxes": {
            "type": "number",
            "description": "Total number of mailboxes",
            "example": 250
          },
          "readyForOutreach": {
            "type": "number",
            "description": "Number of mailboxes ready for outreach (warmedDays > 14)",
            "example": 180
          },
          "warmupRunning": {
            "type": "number",
            "description": "Number of mailboxes with warmup running (warmupStartDate is not null)",
            "example": 50
          },
          "notUsed": {
            "type": "number",
            "description": "Number of mailboxes not used (sent = 0)",
            "example": 75
          },
          "connectedToSep": {
            "type": "number",
            "description": "Number of mailboxes connected to a sending tool (Instantly, Smartlead or EmailBison), each counted once",
            "example": 40
          }
        },
        "required": [
          "totalMailboxes",
          "readyForOutreach",
          "warmupRunning",
          "notUsed",
          "connectedToSep"
        ]
      },
      "SepEndpointDto": {
        "type": "object",
        "properties": {
          "smtpHost": {
            "type": "object",
            "example": "staging.outboxment.com",
            "nullable": true
          },
          "smtpPort": {
            "type": "object",
            "example": 465,
            "nullable": true
          },
          "smtpUsername": {
            "type": "object",
            "example": "john.doe@example.com",
            "nullable": true
          },
          "imapHost": {
            "type": "object",
            "example": "staging.outboxment.com",
            "nullable": true
          },
          "imapPort": {
            "type": "object",
            "example": 993,
            "nullable": true
          },
          "imapUsername": {
            "type": "object",
            "example": "john.doe@example.com",
            "nullable": true
          }
        },
        "required": [
          "smtpHost",
          "smtpPort",
          "smtpUsername",
          "imapHost",
          "imapPort",
          "imapUsername"
        ]
      },
      "SepConnectionDto": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "Instantly",
              "Emailbison",
              "SmartLead",
              "PlusVibe"
            ],
            "example": "Instantly"
          },
          "connectedAt": {
            "type": "object",
            "example": "2026-09-01T10:00:00.000Z",
            "nullable": true
          },
          "disconnectedAt": {
            "type": "object",
            "description": "Set when we have disconnected the mailbox from this provider",
            "example": null,
            "nullable": true
          },
          "externalId": {
            "type": "object",
            "description": "The provider's own account id, when we store one",
            "example": null,
            "nullable": true
          },
          "expected": {
            "description": "The endpoint a connect run puts on the account: the product cube host with the fixed ports every SEP connector uses. For Instantly this is authoritative right after a connect, since every connect rebuilds the account with exactly these values",
            "allOf": [
              {
                "$ref": "#/components/schemas/SepEndpointDto"
              }
            ]
          },
          "endpointNote": {
            "type": "string",
            "description": "Why there is no provider-side endpoint to compare against. The same for every provider, and stated rather than implied so a caller does not read the absence as agreement",
            "example": "No SEP reports an account's SMTP/IMAP endpoint, so it cannot be read back for comparison."
          },
          "remoteDetails": {
            "type": "object",
            "description": "The provider's full account payload, credential-shaped fields redacted. Present so a field the provider renamed or stopped returning is still visible rather than silently blank",
            "example": {
              "email": "john.doe@example.com",
              "provider_code": 1
            },
            "nullable": true
          },
          "remoteStatus": {
            "type": "string",
            "enum": [
              "ok",
              "not_found",
              "unsupported",
              "error"
            ],
            "example": "ok"
          },
          "remoteMessage": {
            "type": "object",
            "description": "Human-readable reason when status is not \"ok\"",
            "example": null,
            "nullable": true
          }
        },
        "required": [
          "provider",
          "connectedAt",
          "disconnectedAt",
          "externalId",
          "expected",
          "endpointNote",
          "remoteDetails",
          "remoteStatus",
          "remoteMessage"
        ]
      },
      "UpdateMailboxDto": {
        "type": "object",
        "properties": {
          "fullName": {
            "type": "string",
            "description": "Full name of the mailbox owner",
            "example": "John Doe"
          },
          "password": {
            "type": "string",
            "description": "Password for the mailbox",
            "example": "NewSecurePassword123!"
          },
          "sent": {
            "type": "number",
            "description": "Number of emails sent",
            "example": 100
          },
          "warmedDays": {
            "type": "number",
            "description": "Number of days warmed",
            "example": 14
          },
          "replyTo": {
            "type": "string",
            "description": "Forward replies to this address. An empty string or null stops forwarding. Replies still land in the mailbox; outgoing mail carries no Reply-To header.",
            "example": "reply@example.com"
          }
        }
      },
      "EmailTemplateDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Stable index into the built-in template list",
            "example": 0
          },
          "subject": {
            "type": "string",
            "description": "Email subject line",
            "example": "Conference room"
          },
          "textContent": {
            "type": "string",
            "description": "Plain-text email body",
            "example": "Hey Sam,\n\nIs the big conference room booked for Thursday's review?"
          }
        },
        "required": [
          "id",
          "subject",
          "textContent"
        ]
      },
      "HealthCheckMailboxesDto": {
        "type": "object",
        "properties": {
          "emails": {
            "description": "Array of email addresses to perform health checks on",
            "example": [
              "john@example.com",
              "jane@example.com"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "subject": {
            "type": "string",
            "description": "Subject line for the health check test email",
            "example": "Test Email - Health Check"
          },
          "textContent": {
            "type": "string",
            "description": "Text content for the health check test email",
            "example": "This is a test email to check mailbox health and deliverability."
          }
        },
        "required": [
          "emails",
          "subject",
          "textContent"
        ]
      },
      "HealthCheckResultDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Health check ID",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          },
          "email": {
            "type": "string",
            "description": "Mailbox email address",
            "example": "john@example.com"
          },
          "testId": {
            "type": "string",
            "description": "GlockApps test ID",
            "example": "2026-07-03-17:31:51:896t"
          },
          "provider": {
            "type": "string",
            "description": "Which vendor produced this check",
            "enum": [
              "mailreach",
              "glockapps"
            ],
            "example": "glockapps"
          },
          "status": {
            "type": "string",
            "description": "Test status",
            "enum": [
              "PENDING",
              "PROCESSING",
              "COMPLETED",
              "PARTIAL_COMPLETE",
              "FAILED"
            ],
            "example": "COMPLETED"
          },
          "inboxRate": {
            "type": "number",
            "description": "Inbox placement rate (%) across the scoped seeds",
            "example": 84.6
          },
          "spamRate": {
            "type": "number",
            "description": "Spam placement rate (%)",
            "example": 15.4
          },
          "otherRate": {
            "type": "number",
            "description": "Other/tabs placement rate (%)",
            "example": 0
          },
          "notDeliveredRate": {
            "type": "number",
            "description": "Not-delivered rate (%)",
            "example": 0
          },
          "glockapps": {
            "type": "object",
            "description": "NORMALIZED, fully-typed detail the UI renders against (rates, per-seed placement, auth, filter-engine scores, blocklists, flags)."
          },
          "glockappsResult": {
            "type": "object",
            "description": "Full RAW GlockApps test result (verbatim vendor payload). Escape hatch for anything not surfaced in `glockapps`; note values may be strings.",
            "additionalProperties": true
          },
          "inboxPlacement": {
            "type": "string",
            "description": "Headline placement",
            "example": "INBOX"
          },
          "summary": {
            "type": "object",
            "description": "Placement summary with counts",
            "example": {
              "INBOX": 11,
              "SPAM": 2,
              "OTHER": 0,
              "NOT_DELIVERED": 0
            }
          },
          "testType": {
            "type": "string",
            "description": "Test type",
            "example": "ManualTest"
          },
          "errorMessage": {
            "type": "string",
            "description": "Error message if test failed",
            "example": null
          },
          "createdBy": {
            "type": "string",
            "description": "User who initiated the test",
            "example": "user@example.com"
          },
          "taskId": {
            "type": "string",
            "description": "Task ID if run as background task",
            "example": "task-uuid-123e4567-e89b-12d3-a456-426614174000"
          },
          "autoTriggered": {
            "type": "boolean",
            "description": "Whether this health check was automatically triggered by a schedule",
            "example": false
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Test creation timestamp",
            "example": "2026-07-03T05:50:35.579Z"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Last update timestamp",
            "example": "2026-07-03T06:09:37.150Z"
          },
          "completedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Test completion timestamp",
            "example": "2026-07-03T06:09:37.150Z"
          }
        },
        "required": [
          "id",
          "email",
          "testId",
          "provider",
          "status",
          "autoTriggered",
          "createdAt",
          "updatedAt"
        ]
      },
      "CreateProjectDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Project name",
            "example": "My Email Campaign Project"
          }
        },
        "required": [
          "name"
        ]
      },
      "ProjectResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Project ID",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "name": {
            "type": "string",
            "description": "Project name",
            "example": "My Email Campaign Project"
          },
          "productId": {
            "type": "string",
            "description": "Organization Product ID",
            "example": "prod_2abc123def456"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "Project creation timestamp",
            "example": "2024-01-15T10:30:00Z"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "description": "Project last update timestamp",
            "example": "2024-01-15T10:30:00Z"
          },
          "domainsCount": {
            "type": "number",
            "description": "Number of domains associated with this project",
            "example": 5
          },
          "mailboxesCount": {
            "type": "number",
            "description": "Number of mailboxes associated with this project",
            "example": 25
          }
        },
        "required": [
          "id",
          "name",
          "productId",
          "createdAt",
          "updatedAt",
          "domainsCount",
          "mailboxesCount"
        ]
      },
      "UpdateProjectDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Project name",
            "example": "Updated Project Name"
          }
        }
      },
      "AssignDomainsToProjectDto": {
        "type": "object",
        "properties": {
          "domainNames": {
            "description": "Array of domain names to assign to the project",
            "example": [
              "example1.com",
              "example2.com"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "domainNames"
        ]
      },
      "DomainAssignmentResult": {
        "type": "object",
        "properties": {
          "domainName": {
            "type": "string",
            "description": "Domain name",
            "example": "example.com"
          },
          "success": {
            "type": "boolean",
            "description": "Whether assignment was successful",
            "example": true
          },
          "error": {
            "type": "string",
            "description": "Error message if failed",
            "example": "Domain already assigned to project \"Marketing Campaign\""
          },
          "previousProjectId": {
            "type": "string",
            "description": "Previous project ID if reassigned",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "previousProjectName": {
            "type": "string",
            "description": "Previous project name if reassigned",
            "example": "Old Project"
          }
        },
        "required": [
          "domainName",
          "success"
        ]
      },
      "AssignDomainsToProjectResponseDto": {
        "type": "object",
        "properties": {
          "project": {
            "description": "Updated project details with new counts",
            "allOf": [
              {
                "$ref": "#/components/schemas/ProjectResponseDto"
              }
            ]
          },
          "total": {
            "type": "number",
            "description": "Total number of domains processed",
            "example": 5
          },
          "successful": {
            "type": "number",
            "description": "Number of domains successfully assigned",
            "example": 4
          },
          "failed": {
            "type": "number",
            "description": "Number of domains that failed to assign",
            "example": 1
          },
          "reassigned": {
            "type": "number",
            "description": "Number of domains reassigned from other projects",
            "example": 2
          },
          "results": {
            "description": "Detailed results for each domain",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DomainAssignmentResult"
            }
          }
        },
        "required": [
          "project",
          "total",
          "successful",
          "failed",
          "reassigned",
          "results"
        ]
      },
      "SendingIdentifierResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Sending identifier UUID"
          },
          "emailAddress": {
            "type": "string",
            "example": "notifications@acme.com"
          },
          "displayName": {
            "type": "object",
            "description": "Display name used in the From header, or null to send the bare address",
            "example": "Acme Notifications",
            "nullable": true
          },
          "domainName": {
            "type": "string",
            "description": "Domain this identifier belongs to"
          },
          "domainVerificationState": {
            "type": "string",
            "description": "The owning domain's verification state. An identifier on a domain that is not yet 'verified' is registered but cannot send.",
            "enum": [
              "dns_pending",
              "awaiting_ses",
              "verified",
              "ses_failed"
            ]
          },
          "canSend": {
            "type": "boolean",
            "description": "Whether a send from this identifier would be accepted right now — its domain is verified with Amazon SES and not blacklisted."
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "emailAddress",
          "displayName",
          "domainName",
          "domainVerificationState",
          "canSend",
          "createdAt",
          "updatedAt"
        ]
      },
      "CreateSendingIdentifierDto": {
        "type": "object",
        "properties": {
          "emailAddress": {
            "type": "string",
            "description": "The From address to approve for sending. Its domain must already be registered to your account; the domain does not have to be verified yet.",
            "example": "notifications@acme.com"
          },
          "displayName": {
            "type": "string",
            "description": "Display name used in the From header of every message sent as this identifier. A display name supplied on the send request itself is ignored in favour of this one.",
            "example": "Acme Notifications",
            "maxLength": 255
          }
        },
        "required": [
          "emailAddress"
        ]
      },
      "UpdateSendingIdentifierDto": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": "string",
            "description": "Display name used in the From header. Pass an empty string to clear it.",
            "example": "Acme Notifications",
            "maxLength": 255
          }
        }
      },
      "SmtpCredentialResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Credential UUID"
          },
          "username": {
            "type": "string",
            "description": "The SMTP username. Public; the secret is the password.",
            "example": "mismtp_k3j9x2m8q1p7w4n6z0r5"
          },
          "secretHint": {
            "type": "string",
            "description": "The last four characters of the secret, to tell credentials apart.",
            "example": "x9Qa"
          },
          "label": {
            "type": "object",
            "nullable": true,
            "example": "billing service"
          },
          "sendingIdentifierId": {
            "type": "string",
            "description": "The sending identifier this credential sends as"
          },
          "emailAddress": {
            "type": "string",
            "example": "receipts@acme.com"
          },
          "ratePerMinute": {
            "type": "number",
            "description": "Messages per minute this credential may submit.",
            "example": 300
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "revoked"
            ]
          },
          "lastUsedAt": {
            "type": "object",
            "nullable": true
          },
          "lastUsedIp": {
            "type": "object",
            "nullable": true,
            "example": "203.0.113.7"
          },
          "revokedAt": {
            "type": "object",
            "nullable": true
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "username",
          "secretHint",
          "label",
          "sendingIdentifierId",
          "emailAddress",
          "ratePerMinute",
          "status",
          "lastUsedAt",
          "lastUsedIp",
          "revokedAt",
          "createdAt"
        ]
      },
      "CreateSmtpCredentialDto": {
        "type": "object",
        "properties": {
          "sendingIdentifierId": {
            "type": "string",
            "description": "The sending identifier this credential may send as. Every message submitted with the credential must carry this address in its From header; the envelope sender is not checked.",
            "example": "4b7d2b1e-1f7a-4c1e-9c3a-0d9e8c1a2b3c"
          },
          "label": {
            "type": "string",
            "description": "A label to tell credentials apart, such as the application or service that will use it.",
            "example": "billing service",
            "maxLength": 100
          }
        },
        "required": [
          "sendingIdentifierId"
        ]
      },
      "SmtpConnectionDetailsDto": {
        "type": "object",
        "properties": {
          "host": {
            "type": "string",
            "example": "smtp.missioninbox.com"
          },
          "starttlsPort": {
            "type": "number",
            "description": "Port for STARTTLS: connect in plain text, then upgrade.",
            "example": 2587
          },
          "tlsPort": {
            "type": "number",
            "description": "Port for implicit TLS: the connection is encrypted from the first byte.",
            "example": 2465
          }
        },
        "required": [
          "host",
          "starttlsPort",
          "tlsPort"
        ]
      },
      "SmtpCredentialCreatedResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Credential UUID"
          },
          "username": {
            "type": "string",
            "description": "The SMTP username. Public; the secret is the password.",
            "example": "mismtp_k3j9x2m8q1p7w4n6z0r5"
          },
          "secretHint": {
            "type": "string",
            "description": "The last four characters of the secret, to tell credentials apart.",
            "example": "x9Qa"
          },
          "label": {
            "type": "object",
            "nullable": true,
            "example": "billing service"
          },
          "sendingIdentifierId": {
            "type": "string",
            "description": "The sending identifier this credential sends as"
          },
          "emailAddress": {
            "type": "string",
            "example": "receipts@acme.com"
          },
          "ratePerMinute": {
            "type": "number",
            "description": "Messages per minute this credential may submit.",
            "example": 300
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "revoked"
            ]
          },
          "lastUsedAt": {
            "type": "object",
            "nullable": true
          },
          "lastUsedIp": {
            "type": "object",
            "nullable": true,
            "example": "203.0.113.7"
          },
          "revokedAt": {
            "type": "object",
            "nullable": true
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "secret": {
            "type": "string",
            "description": "The SMTP password. Shown once, in this response only; it is stored hashed and cannot be retrieved again. Store it now.",
            "example": "vJ3mQ9x..."
          },
          "smtp": {
            "$ref": "#/components/schemas/SmtpConnectionDetailsDto"
          }
        },
        "required": [
          "id",
          "username",
          "secretHint",
          "label",
          "sendingIdentifierId",
          "emailAddress",
          "ratePerMinute",
          "status",
          "lastUsedAt",
          "lastUsedIp",
          "revokedAt",
          "createdAt",
          "secret",
          "smtp"
        ]
      },
      "DnsCredentialDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "name": {
            "type": "string",
            "example": "Production Cloudflare"
          },
          "provider": {
            "type": "string",
            "enum": [
              "CloudFlare",
              "GoDaddy",
              "Porkbun",
              "Spaceship",
              "Dynadot",
              "Vercel"
            ],
            "example": "CloudFlare"
          },
          "apiKey": {
            "type": "string",
            "description": "Masked: only the last 4 characters are shown",
            "example": "••••••••5cfd"
          },
          "apiSecret": {
            "type": "string",
            "description": "Masked: only the last 4 characters are shown",
            "example": "••••••••.com"
          },
          "isActive": {
            "type": "boolean",
            "example": true
          },
          "nameserverLocked": {
            "type": "boolean",
            "description": "True while Mission Inbox uses this key to manage nameservers for your domains. A locked key cannot be edited or deleted (409).",
            "example": false
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "example": "2026-10-21T10:30:00.000Z"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "example": "2026-10-21T10:30:00.000Z"
          }
        },
        "required": [
          "id",
          "name",
          "provider",
          "apiKey",
          "apiSecret",
          "isActive",
          "nameserverLocked",
          "createdAt",
          "updatedAt"
        ]
      },
      "CreateDnsCredentialDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "A name for this key, for your own reference",
            "example": "Production Cloudflare",
            "minLength": 2,
            "maxLength": 100
          },
          "provider": {
            "type": "string",
            "enum": [
              "CloudFlare",
              "GoDaddy",
              "Porkbun",
              "Spaceship",
              "Dynadot",
              "Vercel"
            ],
            "example": "CloudFlare"
          },
          "apiKey": {
            "type": "string",
            "description": "The provider API key. CloudFlare: the Global API Key (API Tokens are not supported). Vercel: an access token.",
            "example": "c2547eb745079dac9320b638f5e225cf483cc5cfdda41"
          },
          "apiSecret": {
            "type": "string",
            "description": "GoDaddy, Porkbun, Spaceship, Dynadot: the API secret. CloudFlare: the account email. Vercel: the Team ID, or leave empty for a personal account. Required for every provider but Vercel.",
            "example": "ops@example.com"
          }
        },
        "required": [
          "name",
          "provider",
          "apiKey"
        ]
      },
      "UpdateDnsCredentialDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 100
          },
          "apiKey": {
            "type": "string",
            "description": "The provider API key. CloudFlare: the Global API Key (API Tokens are not supported). Vercel: an access token."
          },
          "apiSecret": {
            "type": "string",
            "description": "GoDaddy, Porkbun, Spaceship, Dynadot: the API secret. CloudFlare: the account email. Vercel: the Team ID, or leave empty for a personal account. Required for every provider but Vercel."
          },
          "isActive": {
            "type": "boolean",
            "description": "Set false to stop using this key without deleting it"
          }
        }
      },
      "WebhookResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "example": "Production bounce handler"
          },
          "url": {
            "type": "string",
            "example": "https://hooks.acme.com/mission-inbox"
          },
          "eventTypes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "message.sent",
                "message.delivered",
                "message.bounced",
                "message.complained",
                "message.rejected",
                "message.delayed",
                "message.opened",
                "message.clicked",
                "domain.dns_change_required"
              ]
            }
          },
          "secret": {
            "type": "string",
            "description": "The signing secret. Returned on every read because you need it to verify the signature; treat it like a password.",
            "example": "miwhsec_9f2c…"
          },
          "active": {
            "type": "boolean",
            "description": "False while paused."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "url",
          "eventTypes",
          "secret",
          "active",
          "createdAt",
          "updatedAt"
        ]
      },
      "WebhookDeliveryResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "webhookId": {
            "type": "string",
            "format": "uuid",
            "description": "The endpoint this was sent to."
          },
          "eventType": {
            "type": "string",
            "enum": [
              "message.sent",
              "message.delivered",
              "message.bounced",
              "message.complained",
              "message.rejected",
              "message.delayed",
              "message.opened",
              "message.clicked",
              "domain.dns_change_required"
            ]
          },
          "test": {
            "type": "boolean",
            "description": "True for a sample sent from the test endpoint. Tests get one attempt and are never retried."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "succeeded",
              "failed",
              "dead"
            ],
            "description": "`pending` — more attempts to come. `succeeded` — your endpoint answered 2xx. `failed` — abandoned because the endpoint was paused or deleted, or a test your endpoint did not accept. `dead` — every retry was used up; nothing further will be attempted unless you replay it."
          },
          "attempts": {
            "type": "number",
            "description": "Attempts made so far.",
            "example": 3
          },
          "nextAttemptAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the next retry is due. Null once settled.",
            "nullable": true
          },
          "lastAttemptAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "responseStatus": {
            "type": "object",
            "description": "HTTP status your endpoint returned. Null if we got no response.",
            "example": 502,
            "nullable": true
          },
          "responseBody": {
            "type": "object",
            "description": "The start of your endpoint's response body, truncated.",
            "nullable": true
          },
          "error": {
            "type": "object",
            "description": "Why the attempt failed when there was no response at all — DNS, TLS, connection refused, or our 10 second timeout.",
            "example": "The operation was aborted due to timeout",
            "nullable": true
          },
          "payload": {
            "type": "object",
            "description": "The body we sent, exactly as signed.",
            "additionalProperties": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "webhookId",
          "eventType",
          "test",
          "status",
          "attempts",
          "payload",
          "createdAt"
        ]
      },
      "CreateWebhookDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Your label for this endpoint. Shown in the dashboard only.",
            "example": "Production bounce handler",
            "maxLength": 255
          },
          "url": {
            "type": "string",
            "description": "HTTPS URL we POST to. Must be publicly resolvable — loopback, link-local and private addresses are rejected.",
            "example": "https://hooks.acme.com/mission-inbox"
          },
          "eventTypes": {
            "type": "array",
            "description": "Which events to receive. At least one. Types added to the API later are not sent to an existing endpoint until you add them here. Transactional can subscribe to every type; Sales to `domain.*` only.",
            "example": [
              "message.delivered",
              "message.bounced",
              "message.complained"
            ],
            "items": {
              "type": "string",
              "enum": [
                "message.sent",
                "message.delivered",
                "message.bounced",
                "message.complained",
                "message.rejected",
                "message.delayed",
                "message.opened",
                "message.clicked",
                "domain.dns_change_required"
              ]
            }
          },
          "active": {
            "type": "boolean",
            "description": "Create the endpoint paused. Useful for configuring it before your handler is deployed.",
            "default": true
          }
        },
        "required": [
          "name",
          "url",
          "eventTypes"
        ]
      },
      "UpdateWebhookDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "url": {
            "type": "string",
            "example": "https://hooks.acme.com/mission-inbox/v2"
          },
          "eventTypes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "message.sent",
                "message.delivered",
                "message.bounced",
                "message.complained",
                "message.rejected",
                "message.delayed",
                "message.opened",
                "message.clicked",
                "domain.dns_change_required"
              ]
            }
          },
          "active": {
            "type": "boolean",
            "description": "Pause or resume. A paused endpoint keeps its configuration, its secret and its delivery history, and receives nothing."
          }
        }
      },
      "TestWebhookDto": {
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string",
            "description": "Which event to send a sample of. Defaults to the first type the endpoint subscribes to. Any type your product can subscribe to is allowed, subscribed or not.",
            "enum": [
              "message.sent",
              "message.delivered",
              "message.bounced",
              "message.complained",
              "message.rejected",
              "message.delayed",
              "message.opened",
              "message.clicked",
              "domain.dns_change_required"
            ],
            "example": "domain.dns_change_required"
          }
        }
      },
      "AttachmentDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the attachment"
          },
          "content_type": {
            "type": "string",
            "description": "MIME type of the attachment"
          },
          "data": {
            "type": "string",
            "description": "Base64 encoded attachment data"
          }
        },
        "required": [
          "name",
          "content_type",
          "data"
        ]
      },
      "SendMessageDto": {
        "type": "object",
        "properties": {
          "to": {
            "description": "To recipients (max 50). Each entry is an address string — either a bare address (\"user@example.com\") or display-name form (\"Name <user@example.com>\").",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cc": {
            "description": "CC recipients (max 50). Address strings — see `to`.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "bcc": {
            "description": "BCC recipients (max 50). Address strings — see `to`.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "from": {
            "type": "string",
            "description": "From email address"
          },
          "sender": {
            "type": "string",
            "description": "Sender header email address"
          },
          "subject": {
            "type": "string",
            "description": "Email subject"
          },
          "tag": {
            "type": "string",
            "description": "Email tag for categorization"
          },
          "reply_to": {
            "type": "string",
            "description": "Reply-to address. When omitted, no Reply-To header is added and replies go to `from`.",
            "example": "notifications@yourdomain.com"
          },
          "plain_body": {
            "type": "string",
            "description": "Plain text email body"
          },
          "html_body": {
            "type": "string",
            "description": "HTML email body"
          },
          "attachments": {
            "description": "Email attachments",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AttachmentDto"
            }
          },
          "headers": {
            "type": "object",
            "description": "Additional email headers"
          },
          "bounce": {
            "type": "boolean",
            "description": "Indicates if this is a bounce message"
          },
          "message_id": {
            "type": "string",
            "description": "Custom message ID for tracking. If not provided, one will be generated automatically.",
            "example": "custom-message-id-12345"
          },
          "mail_from": {
            "type": "string",
            "description": "SMTP envelope sender (MAIL FROM). Defaults to `from` if not set. Use this to set a custom bounce address.",
            "example": "bounce@yourdomain.com"
          },
          "track_opens": {
            "type": "boolean",
            "description": "Transactional only. Add an open-tracking image to the HTML part of this send. Overrides the account default from the transactional settings; leave it out to use the default.",
            "example": false
          },
          "track_clicks": {
            "type": "boolean",
            "description": "Transactional only. Rewrite the links in the HTML part of this send through the tracking domain so clicks are recorded. Overrides the account default from the transactional settings; leave it out to use the default.",
            "example": false
          }
        },
        "required": [
          "from"
        ]
      },
      "SendMessageResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Identifier for this message within its own product. Transactional returns the numeric message id, which is what `POST /api/email/details` takes; Sales returns the RFC 822 Message-ID. Use `messageId` for status lookups — it means the same thing on both products.",
            "example": "27"
          },
          "messageId": {
            "type": "object",
            "description": "The RFC 822 Message-ID header of the sent message. This is the value `POST /api/email/status` and `POST /api/email/bulk_status` expect.\n\nNull only when the send was queued rather than delivered to the mail server: no message has been composed yet, so no Message-ID exists. Poll `POST /api/email/details` with `id` once it has been processed.",
            "example": "<6c6c162e-1234-abcd-ef01-23456789abcd@example.com>",
            "nullable": true
          },
          "message": {
            "type": "string",
            "description": "Response message"
          },
          "status": {
            "type": "string",
            "description": "Status of the email send operation"
          },
          "time": {
            "type": "number",
            "description": "Timestamp of the operation"
          }
        },
        "required": [
          "id",
          "messageId",
          "message",
          "status",
          "time"
        ]
      },
      "SendCapStatusDto": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "number",
            "description": "The cap for this window.",
            "example": 20
          },
          "sent": {
            "type": "number",
            "description": "Messages sent within the current window."
          },
          "remaining": {
            "type": "number",
            "description": "Sends left in the current window."
          },
          "limitReached": {
            "type": "boolean",
            "description": "Whether this window's cap has been reached."
          },
          "resetsAt": {
            "type": "string",
            "description": "ISO timestamp of when this window resets.",
            "example": "2026-08-14T00:00:00.000Z"
          }
        },
        "required": [
          "limit",
          "sent",
          "remaining",
          "limitReached",
          "resetsAt"
        ]
      },
      "SendLimitStatusDto": {
        "type": "object",
        "properties": {
          "limited": {
            "type": "boolean",
            "description": "Whether this product's plan enforces any send cap at all. False for Sales and for Transactional's Pro plan."
          },
          "daily": {
            "description": "Daily cap status (resets at midnight UTC), or null when limited is false.",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/SendCapStatusDto"
              }
            ]
          },
          "monthly": {
            "description": "Monthly cap status (resets at the subscription's billing period end), or null when limited is false.",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/SendCapStatusDto"
              }
            ]
          }
        },
        "required": [
          "limited",
          "daily",
          "monthly"
        ]
      },
      "MessageStatusRequestDto": {
        "type": "object",
        "properties": {
          "messageId": {
            "type": "string",
            "description": "The RFC 822 Message-ID to look up — the `messageId` field returned by `POST /api/email/send`, not the numeric `id`. On Transactional those are two different fields; `id` addresses `POST /api/email/details`.",
            "example": "<message-id@example.com>"
          }
        },
        "required": [
          "messageId"
        ]
      },
      "MessageStatusResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Message ID",
            "example": "message-id@example.com"
          },
          "token": {
            "type": "object",
            "description": "Message token. Null for a Transactional message that was blocked by the suppression list and never reached Amazon SES.",
            "example": "abc123def456",
            "nullable": true
          },
          "status": {
            "type": "string",
            "description": "Message status",
            "example": "sent"
          },
          "status_detail": {
            "type": "object",
            "description": "Why the message carries its status, when the status alone would not say (Transactional only). Set on a Suppressed message.",
            "example": "Blocked: bob@example.com is on your suppression list (Hard bounce, 2026-09-01).",
            "nullable": true
          },
          "last_delivery_attempt": {
            "type": "number",
            "description": "Last event timestamp",
            "example": 1234567890
          },
          "held": {
            "type": "boolean",
            "description": "Held status",
            "example": false
          },
          "rcpt_to": {
            "type": "string",
            "description": "Rcpt to address",
            "example": "recipient@example.com"
          },
          "mail_from": {
            "type": "string",
            "description": "Mail from address",
            "example": "sender@example.com"
          },
          "subject": {
            "type": "string",
            "description": "Subject line",
            "example": "Test Email"
          },
          "timestamp": {
            "type": "number",
            "description": "Message timestamp",
            "example": 1234567890
          },
          "direction": {
            "type": "string",
            "description": "Direction of message",
            "example": "outgoing"
          },
          "size": {
            "type": "number",
            "description": "Message size in bytes",
            "example": 1024
          },
          "bounce": {
            "type": "boolean",
            "description": "Message bounce status",
            "example": false
          },
          "bounce_for_id": {
            "type": "string",
            "description": "Bounce for ID if applicable",
            "example": null
          },
          "tag": {
            "type": "string",
            "description": "Message tag",
            "example": "newsletter"
          }
        },
        "required": [
          "id",
          "token",
          "status",
          "last_delivery_attempt",
          "held",
          "rcpt_to",
          "mail_from",
          "subject",
          "timestamp",
          "direction",
          "size",
          "bounce"
        ]
      },
      "BulkMessageStatusRequestDto": {
        "type": "object",
        "properties": {
          "messageIds": {
            "description": "RFC 822 Message-IDs to look up — the `messageId` field returned by `POST /api/email/send`, not the numeric `id`. Statuses come back positionally aligned with this array, with `null` for any id that matched nothing.",
            "example": [
              "<message-id1@example.com>",
              "<message-id2@example.com>"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "messageIds"
        ]
      },
      "BulkMessageStatusResponseDto": {
        "type": "object",
        "properties": {
          "statuses": {
            "description": "Array of message statuses, null for not found messages",
            "nullable": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageStatusResponseDto"
            }
          }
        },
        "required": [
          "statuses"
        ]
      },
      "SearchMessagesRequestDto": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "description": "Filter by sender email address (partial match)",
            "example": "sender@example.com"
          },
          "sending_identifier_id": {
            "type": "string",
            "description": "Filter by the sending identifier a message was sent as (Transactional only). Exact match on the identifier UUID — unlike `from`, this keeps grouping stable across display-name changes and re-registrations.",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "to": {
            "type": "string",
            "description": "Filter by recipient email address (partial match)",
            "example": "recipient@example.com"
          },
          "message_id": {
            "type": "string",
            "description": "Filter by Message-ID header",
            "example": "message-id@example.com"
          },
          "status": {
            "type": "string",
            "description": "Filter by message status",
            "enum": [
              "Pending",
              "Sent",
              "SoftFail",
              "HardFail",
              "Held",
              "Bounced",
              "HoldCancelled",
              "Delivered",
              "Complained",
              "Suppressed"
            ],
            "example": "Sent"
          },
          "direction": {
            "type": "string",
            "description": "Filter by message direction",
            "enum": [
              "all",
              "incoming",
              "outgoing"
            ],
            "default": "all",
            "example": "outgoing"
          },
          "keyword": {
            "type": "string",
            "description": "Search keyword in subject or body",
            "example": "invoice"
          },
          "page": {
            "type": "number",
            "description": "Page number for pagination",
            "default": 1,
            "minimum": 1,
            "example": 1
          },
          "limit": {
            "type": "number",
            "description": "Number of results per page",
            "default": 30,
            "minimum": 1,
            "maximum": 100,
            "example": 30
          },
          "order": {
            "type": "string",
            "description": "Sort order for results",
            "enum": [
              "oldest-first",
              "newest-first"
            ],
            "default": "newest-first",
            "example": "newest-first"
          }
        }
      },
      "GetMessageDetailsRequestDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The internal ID of the message",
            "example": "12345"
          },
          "include": {
            "type": "array",
            "description": "Comma-separated list of sections to include. Default: all sections",
            "example": "properties,activity,content",
            "items": {
              "type": "string",
              "enum": [
                "properties",
                "activity",
                "headers",
                "spam_checks",
                "content",
                "attachments"
              ]
            }
          }
        },
        "required": [
          "id"
        ]
      },
      "MessageRouteDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Route ID",
            "example": 1
          },
          "name": {
            "type": "string",
            "description": "Route name",
            "example": "Default Route"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "MessageDomainDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Domain ID",
            "example": 5
          },
          "name": {
            "type": "string",
            "description": "Domain name",
            "example": "yourdomain.com"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "MessageCredentialDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Credential ID",
            "example": 3
          },
          "name": {
            "type": "string",
            "description": "Credential name",
            "example": "API Key"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "MessagePropertiesDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Current message status",
            "example": "Sent"
          },
          "status_detail": {
            "type": "object",
            "description": "Why the message carries its status, when the status alone would not say (Transactional only). Set on a Suppressed message, naming the blocked recipient and the reason it is on the suppression list.",
            "example": "Blocked: bob@example.com is on your suppression list (Hard bounce, 2026-09-01).",
            "nullable": true
          },
          "subject": {
            "type": "string",
            "description": "Message subject line",
            "example": "Welcome to our service!"
          },
          "from": {
            "type": "string",
            "description": "Sender email address",
            "example": "welcome@yourdomain.com"
          },
          "to": {
            "type": "string",
            "description": "Recipient email address",
            "example": "customer@example.com"
          },
          "message_id": {
            "type": "string",
            "description": "Email Message-ID header",
            "example": "59656a26-efc4-49fa-add5-47c2868405aa@rp.postal.mymissioninbox.com"
          },
          "timestamp": {
            "type": "number",
            "description": "Timestamp when the message was created (Unix timestamp)",
            "example": 1642766400
          },
          "direction": {
            "type": "string",
            "description": "Message direction",
            "example": "outgoing",
            "enum": [
              "incoming",
              "outgoing"
            ]
          },
          "size": {
            "type": "number",
            "description": "Message size in bytes",
            "example": 15420
          },
          "spam_status": {
            "type": "string",
            "description": "Spam status",
            "example": "NotSpam"
          },
          "spam_score": {
            "type": "number",
            "description": "Spam score",
            "example": 0.1
          },
          "tag": {
            "type": "string",
            "description": "Message tag for categorization",
            "example": "onboarding"
          },
          "bounce": {
            "type": "boolean",
            "description": "Whether this is a bounce message",
            "example": false
          },
          "bounce_for_id": {
            "type": "object",
            "description": "If this is a bounce, the ID of the original message",
            "example": null
          },
          "threat": {
            "type": "object",
            "description": "Threat type if detected",
            "example": null
          },
          "threat_details": {
            "type": "object",
            "description": "Threat details if detected",
            "example": null
          },
          "received_with_ssl": {
            "type": "boolean",
            "description": "Whether the message was received over SSL",
            "example": true
          },
          "raw_message_available": {
            "type": "boolean",
            "description": "Whether the raw message is still available",
            "example": true
          },
          "held": {
            "type": "boolean",
            "description": "Whether the message is currently held",
            "example": false
          },
          "hold_expiry": {
            "type": "object",
            "description": "When the hold expires (if held)",
            "example": null
          },
          "last_delivery_attempt": {
            "type": "number",
            "description": "Timestamp of last delivery attempt",
            "example": 1642766405
          },
          "route": {
            "description": "Associated route information",
            "allOf": [
              {
                "$ref": "#/components/schemas/MessageRouteDto"
              }
            ]
          },
          "domain": {
            "description": "Associated domain information",
            "allOf": [
              {
                "$ref": "#/components/schemas/MessageDomainDto"
              }
            ]
          },
          "credential": {
            "description": "Associated credential information",
            "allOf": [
              {
                "$ref": "#/components/schemas/MessageCredentialDto"
              }
            ]
          }
        },
        "required": [
          "status",
          "subject",
          "from",
          "to",
          "message_id",
          "timestamp",
          "direction",
          "size",
          "bounce",
          "received_with_ssl",
          "raw_message_available",
          "held"
        ]
      },
      "MessageDeliveryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Delivery attempt ID",
            "example": 67890
          },
          "status": {
            "type": "string",
            "description": "Delivery status",
            "example": "Sent"
          },
          "details": {
            "type": "string",
            "description": "Delivery details",
            "example": "Message delivered successfully"
          },
          "output": {
            "type": "string",
            "description": "SMTP output",
            "example": "250 2.0.0 OK: queued as 1A2B3C4D"
          },
          "sent_with_ssl": {
            "type": "boolean",
            "description": "Whether sent with SSL",
            "example": true
          },
          "log_id": {
            "type": "string",
            "description": "Log ID for this delivery",
            "example": "smtp-log-123"
          },
          "time": {
            "type": "number",
            "description": "How long the delivery attempt took, in seconds — a duration, not a point in time, despite the name (the frontend renders it as \"Delivery time: 1m 4s\"). Postal measures this per attempt; Amazon SES reports no equivalent, so it is omitted for Transactional messages rather than filled with something that is not a duration.",
            "example": 1.24
          },
          "timestamp": {
            "type": "number",
            "description": "Delivery timestamp",
            "example": 1642766405
          },
          "recipient": {
            "type": "string",
            "description": "Transactional only: the recipient this event concerns. Amazon SES reports delivery outcomes per recipient, so one message to several recipients produces one entry each. Absent on message-level events (Send, Reject) and on Postal deliveries, which are already per-message.",
            "example": "customer@example.com"
          },
          "raw": {
            "type": "object",
            "description": "Transactional only: the raw event as Amazon SES sent it. Carries more than the fields above (SMTP response, reporting MTA, complaint feedback type), and is the technical detail a delivery investigation actually needs — Postal messages have raw headers and content for that, which SES never retains."
          }
        },
        "required": [
          "id",
          "status",
          "details",
          "sent_with_ssl",
          "timestamp"
        ]
      },
      "MessageClickDto": {
        "type": "object",
        "properties": {
          "url": {
            "type": "object",
            "description": "The address the reader was sent on to.",
            "example": "https://yourdomain.com/welcome",
            "nullable": true
          },
          "ip_address": {
            "type": "object",
            "description": "The address the click came from, or null when it could not be determined.",
            "example": "192.168.1.100",
            "nullable": true
          },
          "user_agent": {
            "type": "string",
            "description": "User agent string",
            "example": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
          },
          "timestamp": {
            "type": "number",
            "description": "Click timestamp",
            "example": 1642766500
          }
        },
        "required": [
          "url",
          "ip_address",
          "timestamp"
        ]
      },
      "MessageLoadDto": {
        "type": "object",
        "properties": {
          "ip_address": {
            "type": "object",
            "description": "The address the open came from, or null when it could not be determined.",
            "example": "192.168.1.100",
            "nullable": true
          },
          "user_agent": {
            "type": "string",
            "description": "User agent string",
            "example": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
          },
          "timestamp": {
            "type": "number",
            "description": "Load timestamp",
            "example": 1642766450
          }
        },
        "required": [
          "ip_address",
          "timestamp"
        ]
      },
      "MessageActivityDto": {
        "type": "object",
        "properties": {
          "deliveries": {
            "description": "Array of delivery attempts",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageDeliveryDto"
            }
          },
          "clicks": {
            "description": "Array of link click events",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageClickDto"
            }
          },
          "loads": {
            "description": "Array of email open/load events",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageLoadDto"
            }
          },
          "open_count": {
            "type": "number",
            "description": "Every time this message was opened. Nothing caps it. `loads` keeps one entry an hour for each combination of client address and mail app, because a client that reloads a message's images on every view would otherwise repeat the same line and cost a webhook delivery each time. Note that this is per ADDRESS, not per reader: Gmail and Apple Mail both fetch through rotating proxy pools, so one reader can produce several entries in an hour. The two figures differ whenever anyone reads a message more than once.",
            "example": 63
          },
          "click_count": {
            "type": "number",
            "description": "Every click on this message. `clicks` collapses the same way as opens, and separately per link, so two clicks on different links are always two entries.",
            "example": 12
          }
        },
        "required": [
          "deliveries",
          "clicks",
          "loads",
          "open_count",
          "click_count"
        ]
      },
      "MessageSpamCheckDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the spam checker",
            "example": "SpamAssassin"
          },
          "score": {
            "type": "number",
            "description": "Spam score",
            "example": 0.1
          },
          "result": {
            "type": "string",
            "description": "Spam check result",
            "example": "NotSpam"
          },
          "details": {
            "type": "string",
            "description": "Detailed spam check information",
            "example": "Clean message, no spam indicators"
          }
        },
        "required": [
          "name",
          "score",
          "result"
        ]
      },
      "MessageContentDto": {
        "type": "object",
        "properties": {
          "plain_body": {
            "type": "string",
            "description": "Plain text body of the email",
            "example": "Welcome to our service!\n\nThank you for signing up..."
          },
          "html_body": {
            "type": "string",
            "description": "HTML body of the email (with tracking)",
            "example": "<html><body><h1>Welcome to our service!</h1><p>Thank you for signing up...</p></body></html>"
          },
          "html_body_without_tracking": {
            "type": "string",
            "description": "HTML body of the email (without tracking images)",
            "example": "<html><body><h1>Welcome to our service!</h1><p>Thank you for signing up...</p></body></html>"
          }
        }
      },
      "MessageAttachmentDto": {
        "type": "object",
        "properties": {
          "index": {
            "type": "number",
            "description": "Attachment index for downloading",
            "example": 0
          },
          "filename": {
            "type": "string",
            "description": "Original filename",
            "example": "welcome-guide.pdf"
          },
          "content_type": {
            "type": "string",
            "description": "MIME content type",
            "example": "application/pdf"
          },
          "size": {
            "type": "number",
            "description": "File size in bytes",
            "example": 524288
          },
          "hash": {
            "type": "string",
            "description": "SHA1 hash of file content",
            "example": "a1b2c3d4e5f6789012345678901234567890abcd"
          },
          "download_url": {
            "type": "string",
            "description": "URL to download the attachment",
            "example": "/api/v1/messages/12345/attachments/0"
          }
        },
        "required": [
          "index",
          "filename",
          "content_type",
          "size",
          "download_url"
        ]
      },
      "MessageDetailsDataDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Internal message ID",
            "example": 12345
          },
          "token": {
            "type": "object",
            "description": "Message token. Null for a Transactional message that was blocked by the suppression list and never reached Amazon SES.",
            "example": "abc123def456",
            "nullable": true
          },
          "properties": {
            "description": "Message properties",
            "allOf": [
              {
                "$ref": "#/components/schemas/MessagePropertiesDto"
              }
            ]
          },
          "activity": {
            "description": "Message activity (deliveries, clicks, loads)",
            "allOf": [
              {
                "$ref": "#/components/schemas/MessageActivityDto"
              }
            ]
          },
          "headers": {
            "type": "object",
            "description": "Email headers as key-value pairs (values are arrays)",
            "example": {
              "From": [
                "welcome@yourdomain.com"
              ],
              "To": [
                "customer@example.com"
              ],
              "Subject": [
                "Welcome to our service!"
              ]
            }
          },
          "spam_checks": {
            "description": "Spam check results",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageSpamCheckDto"
            }
          },
          "content": {
            "description": "Message content (plain and HTML bodies)",
            "allOf": [
              {
                "$ref": "#/components/schemas/MessageContentDto"
              }
            ]
          },
          "attachments": {
            "description": "File attachments",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageAttachmentDto"
            }
          }
        },
        "required": [
          "id",
          "token"
        ]
      },
      "MessageDetailsResponseDto": {
        "type": "object",
        "properties": {
          "message": {
            "description": "Complete message details",
            "allOf": [
              {
                "$ref": "#/components/schemas/MessageDetailsDataDto"
              }
            ]
          }
        },
        "required": [
          "message"
        ]
      },
      "GetRawMessageRequestDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The message identifier (can be numeric ID, token, or Message-ID header)",
            "example": "12345"
          }
        },
        "required": [
          "id"
        ]
      },
      "RawMessageResponseDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Outcome of the request.\n\n- `success` — `raw_data` holds the RFC 822 source.\n- `pending` — the message was accepted but its raw source is still being assembled. Retry in ~30 seconds.\n- `unavailable` — the raw source does not exist and never will. Do not retry; `error` says why. Every Transactional message is in this state, because Amazon SES does not retain sent mail.\n- `error` — the request failed. `error` says why.",
            "example": "success",
            "enum": [
              "success",
              "pending",
              "unavailable",
              "error"
            ]
          },
          "error": {
            "type": "string",
            "description": "Why the raw source was not returned. Always present when `status` is `unavailable` or `error`.",
            "example": "No message found matching provided ID"
          },
          "raw_data": {
            "type": "string",
            "description": "Raw EML content as string (RFC 822 format)",
            "example": "Return-Path: <sender@yourdomain.com>\nFrom: sender@yourdomain.com\nTo: recipient@example.com\n..."
          },
          "id": {
            "type": "string",
            "description": "Message ID from the request",
            "example": "12345"
          }
        },
        "required": [
          "status"
        ]
      },
      "PaginatedResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "description": "Array of items",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "total": {
            "type": "number",
            "description": "Total number of items"
          },
          "page": {
            "type": "number",
            "description": "Current page number"
          },
          "limit": {
            "type": "number",
            "description": "Items per page"
          },
          "totalPages": {
            "type": "number",
            "description": "Total number of pages"
          }
        },
        "required": [
          "data",
          "total",
          "page",
          "limit",
          "totalPages"
        ]
      },
      "QueuedEmailDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "sendingAccountId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "PROCESSING",
              "SENT",
              "FAILED",
              "CANCELLED"
            ]
          },
          "emailPayload": {
            "$ref": "#/components/schemas/SendMessageDto"
          },
          "messageId": {
            "type": "string"
          },
          "retryCount": {
            "type": "number"
          },
          "maxRetries": {
            "type": "number"
          },
          "lastError": {
            "type": "string"
          },
          "lastHttpStatus": {
            "type": "number"
          },
          "nextRetryAt": {
            "format": "date-time",
            "type": "string"
          },
          "sentAt": {
            "format": "date-time",
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "createdByUserId": {
            "type": "string"
          },
          "createdByEmail": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "organizationId",
          "sendingAccountId",
          "status",
          "emailPayload",
          "retryCount",
          "maxRetries",
          "createdAt",
          "updatedAt"
        ]
      },
      "MonthlyEmailStatsDto": {
        "type": "object",
        "properties": {
          "emailsSent": {
            "type": "number",
            "description": "Number of emails sent. Reported as 0 when `available` is false — read `available` before presenting this as a real count.",
            "example": 89432
          },
          "available": {
            "type": "boolean",
            "description": "Whether the figure was actually retrieved from the sending server. False means the upstream stats call failed and this section should be shown as unavailable rather than as zero; the rest of the response is still valid.",
            "example": true
          }
        },
        "required": [
          "emailsSent",
          "available"
        ]
      },
      "OverviewResponseDto": {
        "type": "object",
        "properties": {
          "currentMonth": {
            "description": "Email statistics for current month",
            "allOf": [
              {
                "$ref": "#/components/schemas/MonthlyEmailStatsDto"
              }
            ]
          },
          "lastMonth": {
            "description": "Email statistics for last month",
            "allOf": [
              {
                "$ref": "#/components/schemas/MonthlyEmailStatsDto"
              }
            ]
          },
          "domains": {
            "type": "number",
            "description": "Total number of domains",
            "example": 25
          },
          "unverifiedDomains": {
            "type": "number",
            "description": "Number of unverified domains",
            "example": 3
          },
          "mailboxes": {
            "type": "number",
            "description": "Total number of mailboxes",
            "example": 150
          },
          "inactiveMailboxes": {
            "type": "number",
            "description": "Number of inactive mailboxes (0 emails sent)",
            "example": 12
          },
          "warmingMailboxes": {
            "type": "number",
            "description": "Number of mailboxes currently in warmup process",
            "example": 8
          },
          "warmedMailboxes": {
            "type": "number",
            "description": "Number of mailboxes that have completed warmup (14+ days)",
            "example": 45
          }
        },
        "required": [
          "currentMonth",
          "lastMonth",
          "domains",
          "unverifiedDomains",
          "mailboxes",
          "inactiveMailboxes",
          "warmingMailboxes",
          "warmedMailboxes"
        ]
      },
      "SendingActivityDataPointDto": {
        "type": "object",
        "properties": {
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp for this bucket"
          },
          "sent": {
            "type": "number",
            "description": "Messages accepted by Amazon SES in this bucket",
            "example": 1420
          },
          "delivered": {
            "type": "number",
            "description": "Messages Amazon SES confirmed delivered",
            "example": 1394
          },
          "bounced": {
            "type": "number",
            "description": "Messages that bounced (permanent and transient combined)",
            "example": 21
          },
          "complained": {
            "type": "number",
            "description": "Messages a recipient reported as spam",
            "example": 2
          }
        },
        "required": [
          "timestamp",
          "sent",
          "delivered",
          "bounced",
          "complained"
        ]
      },
      "SendingActivitySummaryDto": {
        "type": "object",
        "properties": {
          "totalSent": {
            "type": "number",
            "example": 42150
          },
          "totalDelivered": {
            "type": "number",
            "example": 41402
          },
          "totalBounced": {
            "type": "number",
            "example": 512
          },
          "totalHardBounced": {
            "type": "number",
            "description": "Of totalBounced, those Amazon SES classified as permanent. This is the figure that counts against the account, so it is reported separately from transient bounces that may still deliver on a retry.",
            "example": 430
          },
          "totalComplained": {
            "type": "number",
            "example": 31
          },
          "totalRejected": {
            "type": "number",
            "description": "Amazon SES refused these outright — they were never attempted.",
            "example": 4
          },
          "deliveryRate": {
            "type": "object",
            "description": "totalDelivered / totalSent, as a fraction. Null when nothing was sent in the range, rather than 0 — a rate of zero and no data at all are different things and should not render the same.",
            "example": 0.9823,
            "nullable": true
          },
          "hardBounceRate": {
            "type": "object",
            "description": "totalHardBounced / totalSent. Amazon suspends sending for the whole account above roughly 5%, and this account is shared across customers, so this is the number to watch.",
            "example": 0.0102,
            "nullable": true
          },
          "complaintRate": {
            "type": "object",
            "description": "totalComplained / totalSent. Amazon acts above roughly 0.1%, which is a far tighter budget than the bounce rate.",
            "example": 0.0007,
            "nullable": true
          }
        },
        "required": [
          "totalSent",
          "totalDelivered",
          "totalBounced",
          "totalHardBounced",
          "totalComplained",
          "totalRejected"
        ]
      },
      "SendingActivityResponseDto": {
        "type": "object",
        "properties": {
          "startDate": {
            "type": "string",
            "example": "2026-09-01T00:00:00.000Z"
          },
          "endDate": {
            "type": "string",
            "example": "2026-09-30T23:59:59.000Z"
          },
          "granularity": {
            "type": "string",
            "enum": [
              "hourly",
              "daily",
              "monthly",
              "yearly"
            ]
          },
          "dataPoints": {
            "description": "One bucket per interval that had activity. Buckets with nothing at all are omitted rather than zero-filled; the client knows the range and the granularity, so it can fill gaps in whatever way its chart wants.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SendingActivityDataPointDto"
            }
          },
          "summary": {
            "$ref": "#/components/schemas/SendingActivitySummaryDto"
          }
        },
        "required": [
          "startDate",
          "endDate",
          "granularity",
          "dataPoints",
          "summary"
        ]
      },
      "EngagementDataPointDto": {
        "type": "object",
        "properties": {
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp for this bucket, by when messages were sent"
          },
          "sent": {
            "type": "number",
            "description": "Messages sent in this bucket. The cohort the two figures below are measured against.",
            "example": 940
          },
          "trackingRequested": {
            "type": "number",
            "description": "Of those, how many asked for tracking at all, as resolved at send time from the request fields and the account defaults. Distinct from the two figures below, which say how many actually carried it: a plain-text send, a body over the size ceiling, and anything submitted over the SMTP relay all ask and cannot carry. Zero here means tracking really is switched off for these sends.",
            "example": 900
          },
          "openTracked": {
            "type": "number",
            "description": "Of those, how many actually carried an open pixel — not how many asked for one. A send with no HTML part, or one whose body tripped a size or complexity ceiling, requested tracking and shipped without a pixel; counting those would measure the request rather than the result. This is the denominator for the open rate.",
            "example": 860
          },
          "clickTracked": {
            "type": "number",
            "description": "Of those, how many actually had a link rewritten. A message with no links in its body cannot be clicked however its flags were set.",
            "example": 860
          },
          "opened": {
            "type": "number",
            "description": "Of the open-tracked messages, how many were ever opened",
            "example": 318
          },
          "clicked": {
            "type": "number",
            "description": "Of the click-tracked messages, how many had a link clicked",
            "example": 46
          }
        },
        "required": [
          "timestamp",
          "sent",
          "trackingRequested",
          "openTracked",
          "clickTracked",
          "opened",
          "clicked"
        ]
      },
      "EngagementSummaryDto": {
        "type": "object",
        "properties": {
          "totalSent": {
            "type": "number",
            "description": "Messages sent in the range, excluding those refused before they were composed. The denominator for both rates below.",
            "example": 12480
          },
          "totalTrackingRequested": {
            "type": "number",
            "description": "Messages in the range that asked for tracking, whether or not they could carry it. Zero means the account had it switched off.",
            "example": 11800
          },
          "totalOpenTracked": {
            "type": "number",
            "description": "Messages in the range that carried an open pixel",
            "example": 11020
          },
          "totalClickTracked": {
            "type": "number",
            "description": "Messages in the range whose links were rewritten",
            "example": 11020
          },
          "totalOpened": {
            "type": "number",
            "example": 4192
          },
          "totalClicked": {
            "type": "number",
            "example": 613
          },
          "openRate": {
            "type": "object",
            "description": "totalOpened / totalOpenTracked. Null when nothing in the range was open-tracked, rather than 0 — a rate of zero and no data at all are different things and should not render the same.",
            "example": 0.3358,
            "nullable": true
          },
          "clickRate": {
            "type": "object",
            "description": "totalClicked / totalClickTracked.",
            "example": 0.0491,
            "nullable": true
          }
        },
        "required": [
          "totalSent",
          "totalTrackingRequested",
          "totalOpenTracked",
          "totalClickTracked",
          "totalOpened",
          "totalClicked"
        ]
      },
      "EngagementResponseDto": {
        "type": "object",
        "properties": {
          "startDate": {
            "type": "string",
            "example": "2026-09-01T00:00:00.000Z"
          },
          "endDate": {
            "type": "string",
            "example": "2026-09-30T23:59:59.000Z"
          },
          "granularity": {
            "type": "string",
            "enum": [
              "hourly",
              "daily",
              "monthly",
              "yearly"
            ]
          },
          "dataPoints": {
            "description": "One bucket per interval that had a send. Buckets with nothing at all are omitted rather than zero-filled; the client knows the range and the granularity, so it can fill gaps in whatever way its chart wants.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EngagementDataPointDto"
            }
          },
          "summary": {
            "$ref": "#/components/schemas/EngagementSummaryDto"
          }
        },
        "required": [
          "startDate",
          "endDate",
          "granularity",
          "dataPoints",
          "summary"
        ]
      },
      "ActivityGraphDataPointDto": {
        "type": "object",
        "properties": {
          "timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp for this data point",
            "example": "2025-01-01T00:00:00Z"
          },
          "incoming": {
            "type": "number",
            "description": "Count of incoming messages",
            "example": 582
          },
          "outgoing": {
            "type": "number",
            "description": "Count of outgoing messages",
            "example": 1467
          },
          "bounces": {
            "type": "number",
            "description": "Count of bounced messages",
            "example": 35
          },
          "spam": {
            "type": "number",
            "description": "Count of spam messages",
            "example": 12
          },
          "held": {
            "type": "number",
            "description": "Count of held messages",
            "example": 5
          }
        },
        "required": [
          "timestamp"
        ]
      },
      "ActivityGraphSummaryDto": {
        "type": "object",
        "properties": {
          "totalIncoming": {
            "type": "number",
            "description": "Total incoming messages across all data points",
            "example": 18246
          },
          "totalOutgoing": {
            "type": "number",
            "description": "Total outgoing messages across all data points",
            "example": 45789
          },
          "totalBounces": {
            "type": "number",
            "description": "Total bounced messages across all data points",
            "example": 1052
          },
          "totalSpam": {
            "type": "number",
            "description": "Total spam messages across all data points",
            "example": 234
          },
          "totalHeld": {
            "type": "number",
            "description": "Total held messages across all data points",
            "example": 89
          }
        }
      },
      "ActivityGraphResponseDto": {
        "type": "object",
        "properties": {
          "startDate": {
            "type": "string",
            "description": "Start date of the range in ISO 8601 format",
            "example": "2025-01-01T00:00:00Z"
          },
          "endDate": {
            "type": "string",
            "description": "End date of the range in ISO 8601 format",
            "example": "2025-01-31T23:59:59Z"
          },
          "granularity": {
            "type": "string",
            "description": "Time granularity used for data points",
            "enum": [
              "hourly",
              "daily",
              "monthly",
              "yearly"
            ],
            "example": "daily"
          },
          "dataPoints": {
            "description": "Array of data points with timestamps and counter values",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActivityGraphDataPointDto"
            }
          },
          "summary": {
            "description": "Aggregated totals for the entire date range",
            "allOf": [
              {
                "$ref": "#/components/schemas/ActivityGraphSummaryDto"
              }
            ]
          }
        },
        "required": [
          "startDate",
          "endDate",
          "granularity",
          "dataPoints",
          "summary"
        ]
      },
      "SenderStatsRangeDto": {
        "type": "object",
        "properties": {
          "startDate": {
            "type": "string",
            "example": "2026-08-06T00:00:00.000Z"
          },
          "endDate": {
            "type": "string",
            "example": "2026-09-05T23:59:59.000Z"
          }
        },
        "required": [
          "startDate",
          "endDate"
        ]
      },
      "SenderStatsDto": {
        "type": "object",
        "properties": {
          "sent": {
            "type": "number",
            "description": "Messages handed to Amazon SES. Excludes sends refused by the suppression list, which never reached SES and can never produce an outcome -- counting them would deflate every rate below.",
            "example": 12480
          },
          "delivered": {
            "type": "number",
            "description": "Messages SES confirmed were accepted by the receiving server",
            "example": 12101
          },
          "bounced": {
            "type": "number",
            "description": "Messages that bounced, permanent and transient together",
            "example": 261
          },
          "hardBounced": {
            "type": "number",
            "description": "Of `bounced`, those SES classified Permanent — a dead address. The split matters because only this half says the recipient is gone; a full mailbox is transient and may accept the next attempt.",
            "example": 198
          },
          "complained": {
            "type": "number",
            "description": "Messages a recipient reported as spam",
            "example": 14
          },
          "rejected": {
            "type": "number",
            "description": "Messages SES refused outright, usually for their content. Not a delivery outcome — no attempt was made.",
            "example": 0
          },
          "suppressed": {
            "type": "number",
            "description": "Sends refused before composition because a recipient was on the suppression list. Not included in `sent`; reported so a sender whose volume is being suppressed does not just look quiet.",
            "example": 7
          },
          "deliveryRate": {
            "type": "object",
            "description": "`delivered / sent`, or null when nothing was sent. Null rather than 0 so \"no deliveries\" and \"nothing to report\" do not render identically.",
            "example": 0.9696,
            "nullable": true
          },
          "hardBounceRate": {
            "type": "object",
            "description": "`hardBounced / sent`, or null when nothing was sent.",
            "example": 0.0159,
            "nullable": true
          },
          "complaintRate": {
            "type": "object",
            "description": "`complained / sent`, or null when nothing was sent.",
            "example": 0.0011,
            "nullable": true
          },
          "lastSentAt": {
            "type": "object",
            "description": "When this sender last handed a message to SES within the range, or null if it sent nothing. Distinguishes a dormant sender from a new one.",
            "example": "2026-09-05T09:14:22.000Z",
            "nullable": true
          }
        },
        "required": [
          "sent",
          "delivered",
          "bounced",
          "hardBounced",
          "complained",
          "rejected",
          "suppressed",
          "deliveryRate",
          "hardBounceRate",
          "complaintRate",
          "lastSentAt"
        ]
      },
      "SendingIdentityStatsDto": {
        "type": "object",
        "properties": {
          "sendingIdentifierId": {
            "type": "string",
            "format": "uuid"
          },
          "emailAddress": {
            "type": "string",
            "example": "notifications@acme.com"
          },
          "domainName": {
            "type": "string",
            "example": "acme.com"
          },
          "stats": {
            "$ref": "#/components/schemas/SenderStatsDto"
          }
        },
        "required": [
          "sendingIdentifierId",
          "emailAddress",
          "domainName",
          "stats"
        ]
      },
      "SendingIdentityStatsResponseDto": {
        "type": "object",
        "properties": {
          "range": {
            "$ref": "#/components/schemas/SenderStatsRangeDto"
          },
          "identities": {
            "description": "One entry per registered sending identity, including those that sent nothing — so the page can render its list straight from this response without zipping two arrays and filling gaps.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SendingIdentityStatsDto"
            }
          },
          "totals": {
            "description": "These rows summed. Every field is aggregated the same way.",
            "allOf": [
              {
                "$ref": "#/components/schemas/SenderStatsDto"
              }
            ]
          }
        },
        "required": [
          "range",
          "identities",
          "totals"
        ]
      },
      "DomainStatsDto": {
        "type": "object",
        "properties": {
          "domainId": {
            "type": "string",
            "format": "uuid"
          },
          "domainName": {
            "type": "string",
            "example": "acme.com"
          },
          "sendingIdentifierCount": {
            "type": "number",
            "description": "Sending identities registered on this domain, excluding deleted ones.",
            "example": 3
          },
          "stats": {
            "$ref": "#/components/schemas/SenderStatsDto"
          }
        },
        "required": [
          "domainId",
          "domainName",
          "sendingIdentifierCount",
          "stats"
        ]
      },
      "DomainStatsResponseDto": {
        "type": "object",
        "properties": {
          "range": {
            "$ref": "#/components/schemas/SenderStatsRangeDto"
          },
          "domains": {
            "description": "One entry per registered domain, including those that sent nothing.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DomainStatsDto"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/SenderStatsDto"
          }
        },
        "required": [
          "range",
          "domains",
          "totals"
        ]
      },
      "CatalogueDomainDto": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "example": "coastsidetech.com"
          },
          "tld": {
            "type": "string",
            "description": "Top-level domain, for filtering",
            "example": "com"
          },
          "ageYears": {
            "type": "object",
            "description": "Age in years since registration, to one decimal. Null when the registry published no creation date.",
            "example": 13.4,
            "nullable": true
          },
          "registeredAt": {
            "type": "object",
            "description": "Registration date",
            "example": "2013-05-11T00:00:00.000Z",
            "nullable": true
          },
          "warmedDays": {
            "type": "number",
            "description": "Days this domain has been warming, cumulative. Keeps climbing while it is listed — warmup does not stop until it is leased.",
            "example": 34
          },
          "listedAt": {
            "type": "object",
            "description": "When it was listed",
            "example": "2026-09-19T10:30:00.000Z",
            "nullable": true
          },
          "monthlyPriceCents": {
            "type": "number",
            "description": "Monthly lease price in cents",
            "example": 8500
          },
          "includedMailboxes": {
            "type": "number",
            "description": "Pre-warmed mailboxes included in the lease",
            "example": 5
          }
        },
        "required": [
          "domain",
          "tld",
          "ageYears",
          "registeredAt",
          "warmedDays",
          "listedAt",
          "monthlyPriceCents",
          "includedMailboxes"
        ]
      },
      "CatalogueDomainListDto": {
        "type": "object",
        "properties": {
          "data": {
            "description": "Array of items",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogueDomainDto"
            }
          },
          "total": {
            "type": "number",
            "description": "Total number of items"
          },
          "page": {
            "type": "number",
            "description": "Current page number"
          },
          "limit": {
            "type": "number",
            "description": "Items per page"
          },
          "totalPages": {
            "type": "number",
            "description": "Total number of pages"
          }
        },
        "required": [
          "data",
          "total",
          "page",
          "limit",
          "totalPages"
        ]
      },
      "CatalogueFacetsDto": {
        "type": "object",
        "properties": {
          "tlds": {
            "description": "TLDs present in the catalogue, with how many of each",
            "example": [
              {
                "tld": "com",
                "count": 24
              }
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "total": {
            "type": "number",
            "description": "Total domains available",
            "example": 31
          },
          "monthlyPriceCents": {
            "type": "number",
            "description": "Monthly lease price in cents",
            "example": 8500
          },
          "includedMailboxes": {
            "type": "number",
            "description": "Pre-warmed mailboxes included in every lease",
            "example": 5
          }
        },
        "required": [
          "tlds",
          "total",
          "monthlyPriceCents",
          "includedMailboxes"
        ]
      },
      "PurchaseEligibilityDto": {
        "type": "object",
        "properties": {
          "eligible": {
            "type": "boolean",
            "description": "Whether a lease would be accepted now"
          },
          "reason": {
            "type": "string",
            "enum": [
              "purchasing_disabled",
              "wrong_product",
              "no_subscription",
              "subscription_inactive",
              "subscription_ending",
              "plan_not_eligible",
              "sending_disabled",
              "cap_reached"
            ],
            "description": "Why not. Absent when eligible."
          },
          "message": {
            "type": "string",
            "description": "The same thing in words, safe to show a customer",
            "example": "You are leasing 3 of 3 domains."
          },
          "activeLeases": {
            "type": "number",
            "description": "Live leases this account holds",
            "example": 2
          },
          "leaseCap": {
            "type": "number",
            "description": "Maximum concurrent leases",
            "example": 3
          },
          "remaining": {
            "type": "number",
            "description": "Slots still free",
            "example": 1
          },
          "monthlyPriceCents": {
            "type": "number",
            "description": "Monthly lease price in cents",
            "example": 8500
          },
          "includedMailboxes": {
            "type": "number",
            "description": "Mailboxes included in a lease",
            "example": 5
          },
          "proratedCentsPerDomain": {
            "type": "number",
            "description": "What one domain would cost to buy **right now**, in cents: the rest of this billing period, prorated. An estimate for display — checkout returns what was actually charged, and the two differ if a period boundary passes in between. Zero when the period is about to roll over.",
            "example": 3290
          },
          "periodEndsAt": {
            "type": "object",
            "description": "End of the current billing period. The upfront charge covers up to here, and the first full-price invoice lands on it.",
            "example": "2026-02-01T00:00:00.000Z",
            "nullable": true
          },
          "remainingDays": {
            "type": "number",
            "description": "Days left in the period, the day the lease starts included — the numerator of the proration.",
            "example": 12
          }
        },
        "required": [
          "eligible",
          "activeLeases",
          "leaseCap",
          "remaining",
          "monthlyPriceCents",
          "includedMailboxes",
          "proratedCentsPerDomain",
          "periodEndsAt",
          "remainingDays"
        ]
      },
      "DomainLeaseDto": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "example": "coastsidetech.com"
          },
          "status": {
            "type": "string",
            "enum": [
              "provisioning",
              "active",
              "ending",
              "ended",
              "failed"
            ],
            "example": "active"
          },
          "provisionStage": {
            "type": "string",
            "enum": [
              "reserved",
              "stop_warmup",
              "delegate_credentials",
              "create_domain",
              "transfer_ownership",
              "clear_dns",
              "push_dns",
              "verify_dns",
              "convert_mailboxes",
              "release_pool",
              "done"
            ],
            "description": "How far setup has got. Only meaningful while provisioning."
          },
          "needsAttention": {
            "type": "boolean",
            "description": "Setup stopped and support needs to look at it",
            "example": false
          },
          "monthlyPriceCents": {
            "type": "number",
            "description": "Monthly price in cents",
            "example": 8500
          },
          "includedMailboxes": {
            "type": "number",
            "example": 5
          },
          "purchasedAt": {
            "format": "date-time",
            "type": "string",
            "example": "2026-09-19T10:30:00.000Z"
          },
          "activatedAt": {
            "type": "object",
            "nullable": true,
            "description": "When the domain became usable",
            "example": "2026-09-19T10:34:00.000Z"
          },
          "endsAt": {
            "type": "object",
            "nullable": true,
            "description": "When a scheduled cancellation takes effect",
            "example": null
          },
          "canResume": {
            "type": "boolean",
            "description": "Whether the customer can withdraw the cancellation themselves. False when the lease is ending because the subscription behind it is — that is fixed by reactivating the subscription, not here.",
            "example": false
          },
          "renews": {
            "type": "boolean",
            "description": "Whether this lease renews at the end of each billing period. False once a cancellation is scheduled.",
            "example": true
          }
        },
        "required": [
          "domain",
          "status",
          "needsAttention",
          "monthlyPriceCents",
          "includedMailboxes",
          "purchasedAt",
          "activatedAt",
          "endsAt",
          "canResume",
          "renews"
        ]
      },
      "CheckoutCartDto": {
        "type": "object",
        "properties": {
          "domains": {
            "description": "Domains to lease, as listed in the catalogue. All or nothing: if any one of them is unavailable, none are leased.",
            "example": [
              "coastsidetech.com",
              "probusinesschannel.com"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "domains"
        ]
      },
      "PurchasedDomainDto": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "example": "coastsidetech.com"
          },
          "leaseId": {
            "type": "string",
            "description": "Lease id, for following progress"
          },
          "status": {
            "type": "string",
            "enum": [
              "provisioning",
              "active",
              "ending",
              "ended",
              "failed"
            ],
            "example": "provisioning"
          },
          "monthlyPriceCents": {
            "type": "number",
            "example": 8500
          },
          "includedMailboxes": {
            "type": "number",
            "example": 5
          }
        },
        "required": [
          "domain",
          "leaseId",
          "status",
          "monthlyPriceCents",
          "includedMailboxes"
        ]
      },
      "CheckoutResultDto": {
        "type": "object",
        "properties": {
          "purchased": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PurchasedDomainDto"
            }
          },
          "activeLeases": {
            "type": "number",
            "description": "Leases held after this cart",
            "example": 3
          },
          "leaseCap": {
            "type": "number",
            "example": 3
          },
          "monthlyCentsTotal": {
            "type": "number",
            "description": "What this cart adds per month, in cents, summed from the price locked onto each lease rather than multiplied out from the catalogue price — the lease row is what billing reads.",
            "example": 17000
          },
          "chargedNowCents": {
            "type": "number",
            "description": "What was actually charged to the card just now, in cents: the rest of the current billing period, prorated. Authoritative — show this, not the estimate from `GET /eligibility`, which was computed before checkout. Zero is legitimate for a lease started at the very end of a period.",
            "example": 6580
          },
          "nextChargeAt": {
            "type": "string",
            "description": "When the first full-price invoice for these domains lands. The upfront charge covers everything up to this date.",
            "example": "2026-02-01T00:00:00.000Z"
          }
        },
        "required": [
          "purchased",
          "activeLeases",
          "leaseCap",
          "monthlyCentsTotal",
          "chargedNowCents",
          "nextChargeAt"
        ]
      },
      "UnavailableDomainDto": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "example": "coastsidetech.com"
          },
          "reason": {
            "type": "string",
            "enum": [
              "not_listed",
              "just_taken",
              "already_yours",
              "payment_failed"
            ],
            "example": "just_taken"
          },
          "message": {
            "type": "string",
            "example": "coastsidetech.com has just been leased by someone else."
          }
        },
        "required": [
          "domain",
          "reason",
          "message"
        ]
      },
      "CartUnavailableBodyDto": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 409
          },
          "error": {
            "type": "string",
            "example": "cart_unavailable"
          },
          "message": {
            "type": "string",
            "example": "2 of the domains in your cart are no longer available. Nothing was leased."
          },
          "unavailable": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnavailableDomainDto"
            }
          }
        },
        "required": [
          "statusCode",
          "error",
          "message",
          "unavailable"
        ]
      },
      "MarketplaceAccessDto": {
        "type": "object",
        "properties": {
          "visible": {
            "type": "boolean",
            "description": "Whether this account may see the marketplace at all. False means the navigation item and the page are not rendered, and every /marketplace route 404s.",
            "example": true
          }
        },
        "required": [
          "visible"
        ]
      },
      "BulkConnectPlusVibeDto": {
        "type": "object",
        "properties": {
          "credentialId": {
            "type": "string",
            "format": "uuid",
            "description": "Integration credential (from GET /api/integration-credentials/my) to push with. Defaults to the first active credential for the provider."
          },
          "emails": {
            "example": [
              "john@example.com",
              "jane@example.com"
            ],
            "description": "Mailbox emails to connect to the customer PlusVibe account",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "emails"
        ]
      }
    }
  }
}
