{
  "openapi": "3.1.0",
  "info": {
    "title": "Lettermint Team API",
    "version": "0.0.1",
    "description": "API for managing your Lettermint team, projects, domains, webhooks, and more. Authenticate using your Team API token via Bearer authentication."
  },
  "servers": [
    {
      "url": "https://api.lettermint.co/v1"
    }
  ],
  "tags": [
    {
      "name": "Generic"
    },
    {
      "name": "Team"
    },
    {
      "name": "Domain"
    },
    {
      "name": "Project"
    },
    {
      "name": "Webhook"
    },
    {
      "name": "Message"
    },
    {
      "name": "Suppression"
    },
    {
      "name": "Stats"
    }
  ],
  "x-tagGroups": [
    {
      "name": "Core",
      "tags": [
        "Generic",
        "Team",
        "Stats"
      ]
    },
    {
      "name": "Email Platform",
      "tags": [
        "Domain",
        "Project",
        "Webhook",
        "Message",
        "Suppression"
      ]
    }
  ],
  "security": [
    {
      "http": []
    }
  ],
  "paths": {
    "/domains": {
      "get": {
        "operationId": "domain.index",
        "summary": "List all domains for the team",
        "tags": [
          "Domain"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "page[size]",
            "in": "query",
            "description": "The number of results that will be returned per page.",
            "schema": {
              "type": "integer",
              "default": 30
            }
          },
          {
            "name": "page[cursor]",
            "in": "query",
            "description": "The cursor to start the pagination from.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "array",
              "default": [
                "-created_at"
              ],
              "items": {
                "type": "string",
                "enum": [
                  "domain",
                  "-domain",
                  "created_at",
                  "-created_at",
                  "status_changed_at",
                  "-status_changed_at"
                ]
              }
            },
            "explode": false
          },
          {
            "name": "filter[project]",
            "in": "query",
            "description": "Filter by project ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[status]",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/DomainStatus"
            }
          },
          {
            "name": "filter[domain]",
            "in": "query",
            "description": "Search by domain name (partial match, case insensitive)",
            "schema": {
              "type": "string"
            },
            "example": "example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated set of `DomainListData`",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DomainListData"
                      }
                    },
                    "path": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Base path for paginator generated URLs."
                    },
                    "per_page": {
                      "type": "integer",
                      "description": "Number of items shown per page.",
                      "minimum": 0
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The \"cursor\" that points to the next set of items."
                    },
                    "next_page_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    },
                    "prev_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The \"cursor\" that points to the previous set of items."
                    },
                    "prev_page_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    }
                  },
                  "required": [
                    "data",
                    "path",
                    "per_page",
                    "next_cursor",
                    "next_page_url",
                    "prev_cursor",
                    "prev_page_url"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "domain.store",
        "summary": "Create a new domain",
        "tags": [
          "Domain"
        ],
        "requestBody": {
          "description": "`StoreDomainData`",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreDomainData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "`DomainData`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainData"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationException"
          }
        },
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          }
        ]
      }
    },
    "/domains/{domainId}": {
      "get": {
        "operationId": "domain.show",
        "summary": "Get domain details",
        "tags": [
          "Domain"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "dnsRecords",
                  "projects"
                ]
              }
            },
            "explode": false
          }
        ],
        "responses": {
          "200": {
            "description": "`DomainData`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainData"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "domain.destroy",
        "summary": "Delete a domain",
        "tags": [
          "Domain"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "const": "Domain deleted successfully."
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/domains/{domainId}/dns-records/verify": {
      "post": {
        "operationId": "domain.verifyDnsRecords",
        "summary": "Verify all DNS records for a domain",
        "tags": [
          "Domain"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "failed_records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "name"
                        ]
                      }
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "record_id": {
                            "type": "string"
                          },
                          "error": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "record_id",
                          "error"
                        ]
                      }
                    },
                    "failed_count": {
                      "type": "integer"
                    },
                    "total_count": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message",
                    "failed_records",
                    "errors",
                    "failed_count",
                    "total_count"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/domains/{domainId}/dns-records/{recordId}/verify": {
      "post": {
        "operationId": "domain.verifySpecificDnsRecord",
        "summary": "Verify a specific DNS record",
        "tags": [
          "Domain"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "const": "DNS record verified successfully."
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object",
                      "additionalProperties": {}
                    }
                  },
                  "required": [
                    "message",
                    "result"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/domains/{domainId}/projects": {
      "put": {
        "operationId": "domain.updateProjects",
        "summary": "Update projects associated with a domain",
        "tags": [
          "Domain"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`UpdateDomainProjectsData`",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDomainProjectsData"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DomainData"
                    },
                    "message": {
                      "type": "string",
                      "const": "Domain projects updated successfully."
                    }
                  },
                  "required": [
                    "data",
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationException"
          }
        }
      }
    },
    "/ping": {
      "get": {
        "operationId": "v1.ping",
        "description": "This endpoint can be used to check the API status and verify authentication.\nIt accepts both Team API tokens (via Bearer authentication) and Project API tokens (via X-Lettermint-Token header).",
        "summary": "Ping the API",
        "tags": [
          "Generic"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Team API token using Bearer authentication. Format: `Bearer {team_token}`.",
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "X-Lettermint-Token",
            "in": "header",
            "description": "Project API token.",
            "schema": {
              "type": "string"
            },
            "example": "lm_..."
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "integer",
                  "const": 200
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/blocked-file-types": {
      "get": {
        "operationId": "v1.blockedFileTypes",
        "description": "Returns the file extensions and MIME types that cannot be sent as email attachments.",
        "summary": "List blocked file types",
        "tags": [
          "Generic"
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "extensions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "mime_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "extensions",
                    "mime_types"
                  ]
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          }
        ]
      }
    },
    "/messages": {
      "get": {
        "operationId": "message.index",
        "description": "Returns a paginated list of messages with filtering and sorting capabilities.",
        "summary": "List messages for the team",
        "tags": [
          "Message"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "page[size]",
            "in": "query",
            "description": "Number of results per page",
            "schema": {
              "type": "integer",
              "default": 30
            },
            "example": 30
          },
          {
            "name": "page[cursor]",
            "in": "query",
            "description": "Cursor for the next or previous page",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "array",
              "default": [
                "-created_at"
              ],
              "items": {
                "type": "string",
                "enum": [
                  "type",
                  "-type",
                  "status",
                  "-status",
                  "from_email",
                  "-from_email",
                  "subject",
                  "-subject",
                  "created_at",
                  "-created_at",
                  "status_changed_at",
                  "-status_changed_at"
                ]
              }
            },
            "explode": false
          },
          {
            "name": "filter[project]",
            "in": "query",
            "description": "Filter by project ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[search]",
            "in": "query",
            "description": "Search in sender, recipients, and subject",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[type]",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/MessageType"
            }
          },
          {
            "name": "filter[status]",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/MessageStatus"
            }
          },
          {
            "name": "filter[route_id]",
            "in": "query",
            "description": "Filter by route ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[domain_id]",
            "in": "query",
            "description": "Filter by domain ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[tag]",
            "in": "query",
            "description": "Filter by tag name",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[from_email]",
            "in": "query",
            "description": "Search by sender email (partial match)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[subject]",
            "in": "query",
            "description": "Search by subject (partial match)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[from_date]",
            "in": "query",
            "description": "Filter messages created after this date",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[to_date]",
            "in": "query",
            "description": "Filter messages created before this date",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated set of `MessageListData`\n\nThe collection of `MessageListData`",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/MessageListData"
                          }
                        },
                        "path": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Base path for paginator generated URLs."
                        },
                        "per_page": {
                          "type": "integer",
                          "description": "Number of items shown per page.",
                          "minimum": 0
                        },
                        "next_cursor": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The \"cursor\" that points to the next set of items."
                        },
                        "next_page_url": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "uri"
                        },
                        "prev_cursor": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The \"cursor\" that points to the previous set of items."
                        },
                        "prev_page_url": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "uri"
                        }
                      },
                      "required": [
                        "data",
                        "path",
                        "per_page",
                        "next_cursor",
                        "next_page_url",
                        "prev_cursor",
                        "prev_page_url"
                      ]
                    },
                    {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MessageListData"
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/messages/{messageId}": {
      "get": {
        "operationId": "message.show",
        "description": "Returns detailed information about a specific message including optional nested resources.",
        "summary": "Get message details",
        "tags": [
          "Message"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`MessageData`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageData"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/ModelNotFoundException"
          }
        }
      }
    },
    "/messages/{messageId}/events": {
      "get": {
        "operationId": "message.events",
        "description": "Returns a paginated list of events for a specific message with sorting capabilities.",
        "summary": "Get message events",
        "tags": [
          "Message"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page[size]",
            "in": "query",
            "description": "The number of results that will be returned per page.",
            "schema": {
              "type": "integer",
              "default": 30
            }
          },
          {
            "name": "page[cursor]",
            "in": "query",
            "description": "The cursor to start the pagination from.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_machine_events",
            "in": "query",
            "description": "Include machine/privacy/security opened and clicked events",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "timestamp",
                  "-timestamp",
                  "event",
                  "-event"
                ]
              }
            },
            "explode": false
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated set of `MessageEventData`",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MessageEventData"
                      }
                    },
                    "path": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Base path for paginator generated URLs."
                    },
                    "per_page": {
                      "type": "integer",
                      "description": "Number of items shown per page.",
                      "minimum": 0
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The \"cursor\" that points to the next set of items."
                    },
                    "next_page_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    },
                    "prev_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The \"cursor\" that points to the previous set of items."
                    },
                    "prev_page_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    }
                  },
                  "required": [
                    "data",
                    "path",
                    "per_page",
                    "next_cursor",
                    "next_page_url",
                    "prev_cursor",
                    "prev_page_url"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/messages/{messageId}/source": {
      "get": {
        "operationId": "message.source",
        "description": "Returns the raw EML source of the message.",
        "summary": "Get message source",
        "tags": [
          "Message"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "message/rfc822": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/messages/{messageId}/html": {
      "get": {
        "operationId": "message.html",
        "description": "Returns the HTML body of the message if available.",
        "summary": "Get message HTML content",
        "tags": [
          "Message"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "text/html; charset=UTF-8": {
                "schema": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/ModelNotFoundException"
          }
        }
      }
    },
    "/messages/{messageId}/text": {
      "get": {
        "operationId": "message.text",
        "description": "Returns the plain text body of the message if available.",
        "summary": "Get message plain text content",
        "tags": [
          "Message"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "text/plain; charset=UTF-8": {
                "schema": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/ModelNotFoundException"
          }
        }
      }
    },
    "/projects": {
      "get": {
        "operationId": "project.index",
        "summary": "List all projects for the team",
        "tags": [
          "Project"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "page[size]",
            "in": "query",
            "description": "The number of results that will be returned per page.",
            "schema": {
              "type": "integer",
              "default": 30
            }
          },
          {
            "name": "page[cursor]",
            "in": "query",
            "description": "The cursor to start the pagination from.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[search]",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "array",
              "default": [
                "-created_at"
              ],
              "items": {
                "type": "string",
                "enum": [
                  "name",
                  "-name",
                  "created_at",
                  "-created_at"
                ]
              }
            },
            "explode": false
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated set of `ProjectListData`",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProjectListData"
                      }
                    },
                    "path": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Base path for paginator generated URLs."
                    },
                    "per_page": {
                      "type": "integer",
                      "description": "Number of items shown per page.",
                      "minimum": 0
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The \"cursor\" that points to the next set of items."
                    },
                    "next_page_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    },
                    "prev_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The \"cursor\" that points to the previous set of items."
                    },
                    "prev_page_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    }
                  },
                  "required": [
                    "data",
                    "path",
                    "per_page",
                    "next_cursor",
                    "next_page_url",
                    "prev_cursor",
                    "prev_page_url"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "project.store",
        "summary": "Create a new project",
        "tags": [
          "Project"
        ],
        "x-code-samples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST https://api.lettermint.co/v1/projects \\\n  -H \"Authorization: Bearer $LETTERMINT_TEAM_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"Production App\",\"initial_routes\":\"both\"}'"
          }
        ],
        "requestBody": {
          "description": "`StoreProjectData`",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreProjectData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectData"
                    },
                    "message": {
                      "type": "string",
                      "const": "Project created successfully."
                    },
                    "api_token": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "message",
                    "api_token"
                  ]
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationException"
          }
        },
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          }
        ]
      }
    },
    "/projects/{projectId}": {
      "get": {
        "operationId": "project.show",
        "summary": "Get project details",
        "tags": [
          "Project"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "routes",
                  "routesCount",
                  "routesExists",
                  "domains",
                  "domainsCount",
                  "domainsExists",
                  "messageStats",
                  "messageStatsCount",
                  "messageStatsExists"
                ]
              }
            },
            "explode": false
          }
        ],
        "responses": {
          "200": {
            "description": "`ProjectData`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectData"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "project.update",
        "summary": "Update project settings",
        "tags": [
          "Project"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`UpdateProjectData`",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectData"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectData"
                    },
                    "message": {
                      "type": "string",
                      "const": "Project updated successfully."
                    }
                  },
                  "required": [
                    "data",
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationException"
          }
        }
      },
      "delete": {
        "operationId": "project.destroy",
        "summary": "Delete a project",
        "tags": [
          "Project"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "const": "Project deleted successfully."
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/projects/{projectId}/rotate-token": {
      "post": {
        "operationId": "project.rotateToken",
        "description": "Legacy endpoint that rotates the original Project API token. Use dashboard Project API token management to create, regenerate, or revoke specific tokens.",
        "summary": "Rotate Project API token (legacy)",
        "deprecated": true,
        "tags": [
          "Project"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectData"
                    },
                    "new_token": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string",
                      "const": "API token rotated successfully. Please update your integrations."
                    }
                  },
                  "required": [
                    "data",
                    "new_token",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/projects/{projectId}/routes": {
      "get": {
        "operationId": "route.index",
        "summary": "List routes for a project",
        "tags": [
          "Project"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page[size]",
            "in": "query",
            "description": "The number of results that will be returned per page.",
            "schema": {
              "type": "integer",
              "default": 30
            }
          },
          {
            "name": "page[cursor]",
            "in": "query",
            "description": "The cursor to start the pagination from.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "array",
              "default": [
                "-created_at"
              ],
              "items": {
                "type": "string",
                "enum": [
                  "name",
                  "-name",
                  "slug",
                  "-slug",
                  "created_at",
                  "-created_at"
                ]
              }
            },
            "explode": false
          },
          {
            "name": "filter[route_type]",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/RouteType"
            }
          },
          {
            "name": "filter[is_default]",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "filter[search]",
            "in": "query",
            "description": "Search by name or slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated set of `RouteListData`",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RouteListData"
                      }
                    },
                    "path": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Base path for paginator generated URLs."
                    },
                    "per_page": {
                      "type": "integer",
                      "description": "Number of items shown per page.",
                      "minimum": 0
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The \"cursor\" that points to the next set of items."
                    },
                    "next_page_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    },
                    "prev_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The \"cursor\" that points to the previous set of items."
                    },
                    "prev_page_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    }
                  },
                  "required": [
                    "data",
                    "path",
                    "per_page",
                    "next_cursor",
                    "next_page_url",
                    "prev_cursor",
                    "prev_page_url"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "route.store",
        "summary": "Create a new route",
        "tags": [
          "Project"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`StoreRouteData`",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreRouteData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RouteData"
                    },
                    "message": {
                      "type": "string",
                      "const": "Route created successfully."
                    }
                  },
                  "required": [
                    "data",
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationException"
          }
        }
      }
    },
    "/routes/{routeId}": {
      "get": {
        "operationId": "route.show",
        "summary": "Get route details",
        "tags": [
          "Project"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "routeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_machine",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "include",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "project",
                  "projectCount",
                  "projectExists",
                  "statistics"
                ]
              }
            },
            "explode": false
          }
        ],
        "responses": {
          "200": {
            "description": "`RouteData`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RouteData"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "route.update",
        "summary": "Update route settings",
        "tags": [
          "Project"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "routeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`UpdateRouteData`",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRouteData"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RouteData"
                    },
                    "message": {
                      "type": "string",
                      "const": "Route updated successfully."
                    }
                  },
                  "required": [
                    "data",
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationException"
          }
        }
      },
      "delete": {
        "operationId": "route.destroy",
        "summary": "Delete a route",
        "tags": [
          "Project"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "routeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "const": "Route deleted successfully."
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/routes/{routeId}/verify-inbound-domain": {
      "post": {
        "operationId": "route.verifyInboundDomain",
        "summary": "Verify inbound domain for a route",
        "tags": [
          "Project"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "routeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "verified": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string",
                          "const": "Inbound domain verified successfully."
                        }
                      },
                      "required": [
                        "verified",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "verified": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string",
                          "const": "Inbound domain verification failed. Please ensure MX records point to our servers."
                        },
                        "expected_mx_records": {
                          "type": "array",
                          "prefixItems": [
                            {
                              "type": "string",
                              "const": "inbound.lettermint.co"
                            }
                          ],
                          "minItems": 1,
                          "maxItems": 1,
                          "additionalItems": false
                        },
                        "found_mx_records": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "verified",
                        "message",
                        "expected_mx_records",
                        "found_mx_records"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/stats": {
      "get": {
        "operationId": "stats.index",
        "description": "Returns aggregate message statistics for the specified date range.\nProvide a project_id to get per-project stats with transactional/broadcast breakdown.\nWithout project_id, returns team-wide totals from team_message_stats.\nMaximum date range is 90 days.",
        "summary": "Get message statistics",
        "tags": [
          "Stats"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "Start date (Y-m-d)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "End date (Y-m-d, max 90 days from `from`)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Optional project UUID for project-scoped stats with transactional/broadcast breakdown",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_machine",
            "in": "query",
            "description": "Include machine/privacy/security tracking observations in open and click totals",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            }
          },
          {
            "name": "include_machine",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`StatsData`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatsData"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationException"
          }
        }
      }
    },
    "/suppressions": {
      "get": {
        "operationId": "suppression.index",
        "summary": "List all suppressions for the team",
        "tags": [
          "Suppression"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "page[size]",
            "in": "query",
            "description": "The number of results that will be returned per page.",
            "schema": {
              "type": "integer",
              "default": 30
            }
          },
          {
            "name": "page[cursor]",
            "in": "query",
            "description": "The cursor to start the pagination from.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "array",
              "default": [
                "-created_at"
              ],
              "items": {
                "type": "string",
                "enum": [
                  "value",
                  "-value",
                  "created_at",
                  "-created_at",
                  "reason",
                  "-reason"
                ]
              }
            },
            "explode": false
          },
          {
            "name": "filter[scope]",
            "in": "query",
            "description": "Filter by scope (team, project, route)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[route_id]",
            "in": "query",
            "description": "Filter by route ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[project_id]",
            "in": "query",
            "description": "Filter by project ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[value]",
            "in": "query",
            "description": "Search by email/domain value (partial match)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[reason]",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/SuppressionReason"
            }
          },
          {
            "name": "filter[startDate]",
            "in": "query",
            "description": "Filter suppressions created or updated on or after this ISO 8601 date or datetime",
            "schema": {
              "type": "string"
            },
            "example": "2026-01-01"
          },
          {
            "name": "filter[endDate]",
            "in": "query",
            "description": "Filter suppressions created or updated on or before this ISO 8601 date or datetime",
            "schema": {
              "type": "string"
            },
            "example": "2026-01-31T23:59:59Z"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated set of `SuppressedRecipientData`",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SuppressedRecipientData"
                      }
                    },
                    "path": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Base path for paginator generated URLs."
                    },
                    "per_page": {
                      "type": "integer",
                      "description": "Number of items shown per page.",
                      "minimum": 0
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The \"cursor\" that points to the next set of items."
                    },
                    "next_page_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    },
                    "prev_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The \"cursor\" that points to the previous set of items."
                    },
                    "prev_page_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    }
                  },
                  "required": [
                    "data",
                    "path",
                    "per_page",
                    "next_cursor",
                    "next_page_url",
                    "prev_cursor",
                    "prev_page_url"
                  ]
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationException"
          }
        }
      },
      "post": {
        "operationId": "suppression.store",
        "summary": "Add email(s) to suppression list",
        "tags": [
          "Suppression"
        ],
        "requestBody": {
          "description": "`StoreSuppressionData`",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreSuppressionData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "string",
                          "enum": [
                            "No emails were added."
                          ]
                        }
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "created": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "skipped": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "created",
                        "skipped"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationException"
          }
        },
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          }
        ]
      }
    },
    "/suppressions/{suppressionId}": {
      "delete": {
        "operationId": "suppression.destroy",
        "summary": "Remove email from suppression list",
        "tags": [
          "Suppression"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "suppressionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Suppression removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string",
                      "const": "removed"
                    },
                    "message": {
                      "type": "string"
                    },
                    "confidence": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "success",
                    "status",
                    "message"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Manual review ticket created or reused",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "review_ticket_created",
                        "review_ticket_exists"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "ticket_identifier": {
                      "type": "string"
                    },
                    "confidence": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "success",
                    "status",
                    "message",
                    "ticket_identifier"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/team": {
      "get": {
        "operationId": "team.show",
        "description": "Returns basic team information with optional includes for related resources.",
        "summary": "Get team details",
        "tags": [
          "Team"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "include",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "features",
                  "addons"
                ]
              }
            },
            "explode": false
          }
        ],
        "responses": {
          "200": {
            "description": "`TeamData`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamData"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "team.update",
        "description": "Updates editable team properties (name).",
        "summary": "Update team settings",
        "tags": [
          "Team"
        ],
        "requestBody": {
          "description": "`UpdateTeamData`",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTeamData"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TeamData"
                    },
                    "message": {
                      "type": "string",
                      "const": "Team settings updated successfully."
                    }
                  },
                  "required": [
                    "data",
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationException"
          }
        },
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          }
        ]
      }
    },
    "/team/usage": {
      "get": {
        "operationId": "team.usage",
        "description": "Returns current and historical email usage data with billing information.\nHistorical usage includes up to 12 most recent periods.",
        "summary": "Get team usage statistics",
        "tags": [
          "Team"
        ],
        "responses": {
          "200": {
            "description": "`TeamUsageDetailData`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamUsageDetailData"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          }
        ]
      }
    },
    "/team/roles": {
      "get": {
        "operationId": "team.roles",
        "description": "Owner is returned for display but cannot be assigned through the Team API.\nThe additive `assignable` field tells clients whether a role can be used\nfor a new assignment under the team's current plan.",
        "summary": "Get reusable team roles",
        "tags": [
          "Team"
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TeamRoleData"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/RbacConflictException"
          }
        },
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          }
        ]
      }
    },
    "/team/members": {
      "get": {
        "operationId": "team.members",
        "description": "Returns role assignments for teams using reusable roles.",
        "summary": "Get team members",
        "tags": [
          "Team"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "page[size]",
            "in": "query",
            "description": "The number of results that will be returned per page.",
            "schema": {
              "type": "integer",
              "default": 30
            }
          },
          {
            "name": "page[cursor]",
            "in": "query",
            "description": "The cursor to start the pagination from.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated set of `TeamMemberData`",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TeamMemberData"
                      }
                    },
                    "path": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Base path for paginator generated URLs."
                    },
                    "per_page": {
                      "type": "integer",
                      "description": "Number of items shown per page.",
                      "minimum": 0
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The \"cursor\" that points to the next set of items."
                    },
                    "next_page_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    },
                    "prev_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The \"cursor\" that points to the previous set of items."
                    },
                    "prev_page_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    }
                  },
                  "required": [
                    "data",
                    "path",
                    "per_page",
                    "next_cursor",
                    "next_page_url",
                    "prev_cursor",
                    "prev_page_url"
                  ]
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/RbacConflictException"
          }
        }
      }
    },
    "/team/members/{userId}": {
      "get": {
        "operationId": "team.members.show",
        "description": "Use the user ID returned by the team-member list.",
        "summary": "Get a team member",
        "tags": [
          "Team"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`TeamMemberData`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamMemberData"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/RbacConflictException"
          }
        }
      }
    },
    "/team/members/{userId}/assignment": {
      "put": {
        "operationId": "team.members.assignment.update",
        "description": "Replaces the member's non-Owner role and complete project scope atomically.\nUse the user's ID returned by `GET /team/members`.",
        "summary": "Replace a team member's assignment",
        "tags": [
          "Team"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`UpdateTeamMemberAssignmentData`",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTeamMemberAssignmentData"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "`TeamMemberData`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamMemberData"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/RbacConflictException"
          },
          "422": {
            "$ref": "#/components/responses/ValidationException"
          }
        }
      }
    },
    "/webhooks": {
      "get": {
        "operationId": "webhook.index",
        "description": "Returns a paginated list of webhooks with filtering options.",
        "summary": "List all webhooks for the team",
        "tags": [
          "Webhook"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "array",
              "default": [
                "-created_at"
              ],
              "items": {
                "type": "string",
                "enum": [
                  "name",
                  "-name",
                  "url",
                  "-url",
                  "created_at",
                  "-created_at"
                ]
              }
            },
            "explode": false
          },
          {
            "name": "filter[project]",
            "in": "query",
            "description": "Filter by project ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[enabled]",
            "in": "query",
            "description": "Filter by enabled status",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "filter[event]",
            "in": "query",
            "description": "Filter by specific event type",
            "schema": {
              "$ref": "#/components/schemas/WebhookEvent"
            }
          },
          {
            "name": "filter[route_id]",
            "in": "query",
            "description": "Filter by route ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[search]",
            "in": "query",
            "description": "Search by webhook name or URL",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated set of `WebhookListData`",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookListData"
                      }
                    },
                    "path": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Base path for paginator generated URLs."
                    },
                    "per_page": {
                      "type": "integer",
                      "description": "Number of items shown per page.",
                      "minimum": 0
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The \"cursor\" that points to the next set of items."
                    },
                    "next_page_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    },
                    "prev_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The \"cursor\" that points to the previous set of items."
                    },
                    "prev_page_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    }
                  },
                  "required": [
                    "data",
                    "path",
                    "per_page",
                    "next_cursor",
                    "next_page_url",
                    "prev_cursor",
                    "prev_page_url"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "webhook.store",
        "description": "Creates a webhook for a specific route and generates a secret for signature verification.",
        "summary": "Create a new webhook",
        "tags": [
          "Webhook"
        ],
        "requestBody": {
          "description": "`StoreWebhookData`",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreWebhookData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookData"
                    },
                    "message": {
                      "type": "string",
                      "const": "Webhook created successfully. Please save the secret as it will not be shown again."
                    }
                  },
                  "required": [
                    "data",
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationException"
          }
        },
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          }
        ]
      }
    },
    "/webhooks/{webhookId}": {
      "get": {
        "operationId": "webhook.show",
        "description": "Returns full webhook information including recent deliveries.",
        "summary": "Get webhook details",
        "tags": [
          "Webhook"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`WebhookData`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookData"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "webhook.update",
        "description": "Updates webhook configuration. Events, URL, name, and enabled status can be modified.",
        "summary": "Update webhook settings",
        "tags": [
          "Webhook"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`UpdateWebhookData`",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookData"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookData"
                    },
                    "message": {
                      "type": "string",
                      "const": "Webhook updated successfully."
                    }
                  },
                  "required": [
                    "data",
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationException"
          }
        }
      },
      "delete": {
        "operationId": "webhook.destroy",
        "description": "Permanently removes a webhook and all associated delivery records.",
        "summary": "Delete a webhook",
        "tags": [
          "Webhook"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "const": "Webhook deleted successfully."
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{webhookId}/test": {
      "post": {
        "operationId": "webhook.test",
        "description": "Dispatches a test webhook delivery to verify the endpoint is working correctly.",
        "summary": "Test a webhook by sending a sample payload",
        "tags": [
          "Webhook"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "const": "Test webhook dispatched successfully. Check the deliveries endpoint for results."
                    },
                    "delivery_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message",
                    "delivery_id"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{webhookId}/regenerate-secret": {
      "post": {
        "operationId": "webhook.regenerateSecret",
        "description": "Generates a new secret for webhook signature verification. The old secret will be invalidated.",
        "summary": "Regenerate webhook secret",
        "tags": [
          "Webhook"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookData"
                    },
                    "message": {
                      "type": "string",
                      "const": "Webhook secret regenerated successfully. Please update your integration."
                    }
                  },
                  "required": [
                    "data",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{webhookId}/deliveries": {
      "get": {
        "operationId": "webhook.deliveries",
        "description": "Returns a paginated list of delivery attempts for a specific webhook.",
        "summary": "Get webhook deliveries",
        "tags": [
          "Webhook"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "array",
              "default": [
                "-created_at"
              ],
              "items": {
                "type": "string",
                "enum": [
                  "created_at",
                  "-created_at",
                  "attempt_number",
                  "-attempt_number"
                ]
              }
            },
            "explode": false
          },
          {
            "name": "filter[status]",
            "in": "query",
            "description": "Filter by delivery status",
            "schema": {
              "$ref": "#/components/schemas/WebhookDeliveryStatus"
            }
          },
          {
            "name": "filter[event_type]",
            "in": "query",
            "description": "Filter by event type",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[from_date]",
            "in": "query",
            "description": "Filter deliveries from this date (Y-m-d format)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[to_date]",
            "in": "query",
            "description": "Filter deliveries to this date (Y-m-d format)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated set of `WebhookDeliveryListData`",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookDeliveryListData"
                      }
                    },
                    "path": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Base path for paginator generated URLs."
                    },
                    "per_page": {
                      "type": "integer",
                      "description": "Number of items shown per page.",
                      "minimum": 0
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The \"cursor\" that points to the next set of items."
                    },
                    "next_page_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    },
                    "prev_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The \"cursor\" that points to the previous set of items."
                    },
                    "prev_page_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    }
                  },
                  "required": [
                    "data",
                    "path",
                    "per_page",
                    "next_cursor",
                    "next_page_url",
                    "prev_cursor",
                    "prev_page_url"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{webhookId}/deliveries/{deliveryId}": {
      "get": {
        "operationId": "webhook.showDelivery",
        "description": "Returns full details of a single delivery attempt including payload and response data.",
        "summary": "Get a specific webhook delivery",
        "tags": [
          "Webhook"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer token. Format: `Bearer {team_token}`",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer lm_team_..."
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`WebhookDeliveryData`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryData"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "http": {
        "type": "http",
        "scheme": "bearer",
        "description": "Team API token. Find this in your team settings."
      }
    },
    "schemas": {
      "AttachmentDelivery": {
        "type": "string",
        "enum": [
          "inline",
          "url"
        ],
        "title": "AttachmentDelivery"
      },
      "BuiltInTeamRole": {
        "type": "string",
        "enum": [
          "owner",
          "admin",
          "member"
        ],
        "title": "BuiltInTeamRole"
      },
      "DnsRecordStatus": {
        "type": "string",
        "description": "| |\n|---|\n| `active` <br/> The record is active and verified. |\n| `failed` <br/> The record could not be verified. |\n| `pending` <br/> The record is pending verification. |",
        "enum": [
          "active",
          "failed",
          "pending"
        ],
        "title": "DnsRecordStatus"
      },
      "DomainData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "status_changed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "dns_records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DomainDnsRecordData"
            }
          },
          "projects": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name"
              ]
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "domain",
          "status_changed_at",
          "created_at"
        ],
        "title": "DomainData"
      },
      "DomainDnsRecordData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/RecordType"
          },
          "hostname": {
            "type": "string"
          },
          "fqdn": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/DnsRecordStatus"
          },
          "verified_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "type",
          "hostname",
          "fqdn",
          "content",
          "status",
          "verified_at",
          "last_checked_at"
        ],
        "title": "DomainDnsRecordData"
      },
      "DomainListData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/DomainStatus"
          },
          "status_changed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "domain",
          "status",
          "status_changed_at",
          "created_at"
        ],
        "title": "DomainListData"
      },
      "DomainStatus": {
        "type": "string",
        "description": "| |\n|---|\n| `verified` <br/> The domain is active and verified. |\n| `partially_verified` <br/> Some DNS records of the domain could not be verified. |\n| `pending_verification` <br/> The domain is new and verification is pending. |\n| `failed_verification` <br/> The domain verification failed. |",
        "enum": [
          "verified",
          "partially_verified",
          "pending_verification",
          "failed_verification"
        ],
        "title": "DomainStatus"
      },
      "InitialRoutes": {
        "type": "string",
        "enum": [
          "both",
          "transactional",
          "broadcast"
        ],
        "title": "InitialRoutes"
      },
      "MessageAttachmentData": {
        "type": "object",
        "properties": {
          "size": {
            "type": "integer",
            "default": 0
          },
          "filename": {
            "type": "string",
            "default": "unknown"
          },
          "content_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "content_type": {
            "type": "string",
            "default": "application/octet-stream"
          }
        },
        "required": [
          "size",
          "filename",
          "content_id",
          "content_type"
        ],
        "title": "MessageAttachmentData"
      },
      "MessageData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/MessageType"
          },
          "status": {
            "$ref": "#/components/schemas/MessageStatus"
          },
          "status_changed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "tag": {
            "type": [
              "string",
              "null"
            ]
          },
          "from_email": {
            "type": "string"
          },
          "from_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "reply_to": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "subject": {
            "type": [
              "string",
              "null"
            ]
          },
          "to": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/MessageRecipientData"
            }
          },
          "cc": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/MessageRecipientData"
            }
          },
          "bcc": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/MessageRecipientData"
            }
          },
          "attachments": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/MessageAttachmentData"
            }
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": "string"
            }
          },
          "spam_score": {
            "type": [
              "number",
              "null"
            ]
          },
          "spam_symbols": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SpamSymbol"
            }
          },
          "route_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "type",
          "status",
          "status_changed_at",
          "tag",
          "from_email",
          "from_name",
          "reply_to",
          "subject",
          "to",
          "cc",
          "bcc",
          "attachments",
          "metadata",
          "route_id",
          "created_at"
        ],
        "title": "MessageData"
      },
      "MessageEventData": {
        "type": "object",
        "properties": {
          "message_id": {
            "type": "string"
          },
          "event": {
            "$ref": "#/components/schemas/MessageEventType"
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {}
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "message_id",
          "event",
          "metadata",
          "timestamp"
        ],
        "title": "MessageEventData"
      },
      "MessageEventType": {
        "type": "string",
        "enum": [
          "queued",
          "processed",
          "suppressed",
          "delivered",
          "auto_replied",
          "soft_bounced",
          "hard_bounced",
          "spam_complaint",
          "failed",
          "blocked",
          "policy_rejected",
          "unsubscribed",
          "opened",
          "clicked",
          "inbound_received",
          "inbound_queued",
          "inbound_spam_blocked",
          "inbound_processed",
          "inbound_retry"
        ],
        "title": "MessageEventType"
      },
      "MessageListData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/MessageType"
          },
          "status": {
            "$ref": "#/components/schemas/MessageStatus"
          },
          "from_email": {
            "type": "string"
          },
          "from_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "subject": {
            "type": [
              "string",
              "null"
            ]
          },
          "to": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/MessageRecipientData"
            }
          },
          "cc": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/MessageRecipientData"
            }
          },
          "bcc": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/MessageRecipientData"
            }
          },
          "reply_to": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "tag": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "status",
          "from_email",
          "from_name",
          "subject",
          "to",
          "cc",
          "bcc",
          "reply_to",
          "tag",
          "created_at"
        ],
        "title": "MessageListData"
      },
      "MessageRecipientData": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "email",
          "name"
        ],
        "title": "MessageRecipientData"
      },
      "MessageStatsData": {
        "type": "object",
        "properties": {
          "messages_transactional": {
            "type": "integer"
          },
          "messages_broadcast": {
            "type": "integer"
          },
          "messages_inbound": {
            "type": "integer"
          },
          "deliverability": {
            "type": "number"
          }
        },
        "required": [
          "messages_transactional",
          "messages_broadcast",
          "messages_inbound",
          "deliverability"
        ],
        "title": "MessageStatsData"
      },
      "MessageStatus": {
        "type": "string",
        "enum": [
          "pending",
          "queued",
          "suppressed",
          "processed",
          "delivered",
          "opened",
          "clicked",
          "soft_bounced",
          "hard_bounced",
          "spam_complaint",
          "failed",
          "blocked",
          "policy_rejected",
          "unsubscribed"
        ],
        "title": "MessageStatus"
      },
      "MessageType": {
        "type": "string",
        "enum": [
          "inbound",
          "outbound"
        ],
        "title": "MessageType"
      },
      "Plan": {
        "type": "string",
        "enum": [
          "free",
          "starter",
          "growth",
          "pro"
        ],
        "title": "Plan"
      },
      "ProjectAccessScope": {
        "type": "string",
        "enum": [
          "all",
          "selected"
        ],
        "title": "ProjectAccessScope"
      },
      "ProjectData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "smtp_enabled": {
            "type": "boolean"
          },
          "redact_email_content": {
            "type": "boolean"
          },
          "default_route_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "token_generated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "token_last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "token_last_used_ip": {
            "type": [
              "string",
              "null"
            ]
          },
          "routes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RouteData"
            }
          },
          "routes_count": {
            "type": "integer"
          },
          "domains": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DomainData"
            }
          },
          "domains_count": {
            "type": "integer"
          },
          "team_members_count": {
            "type": "integer"
          },
          "last_28_days": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MessageStatsData"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "smtp_enabled",
          "redact_email_content",
          "default_route_id",
          "token_generated_at",
          "token_last_used_at",
          "token_last_used_ip",
          "created_at",
          "updated_at"
        ],
        "title": "ProjectData"
      },
      "ProjectListData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "smtp_enabled": {
            "type": "boolean"
          },
          "routes_count": {
            "type": "integer"
          },
          "domains_count": {
            "type": "integer"
          },
          "team_members_count": {
            "type": "integer"
          },
          "last_28_days": {
            "$ref": "#/components/schemas/MessageStatsData"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "smtp_enabled",
          "routes_count",
          "domains_count",
          "team_members_count",
          "last_28_days",
          "created_at",
          "updated_at"
        ],
        "title": "ProjectListData"
      },
      "RbacConflictCode": {
        "type": "string",
        "enum": [
          "rbac_not_enabled",
          "stale_resource",
          "owner_protected",
          "last_owner",
          "built_in_role_immutable"
        ],
        "title": "RbacConflictCode"
      },
      "RbacPermission": {
        "type": "string",
        "enum": [
          "team:manage",
          "billing:manage",
          "security:manage",
          "audit:read",
          "support:manage",
          "members:read",
          "members:manage",
          "roles:manage",
          "team_tokens:read",
          "team_tokens:manage",
          "team_tokens:rotate",
          "team_tokens:revoke",
          "projects:create",
          "team_suppressions:read",
          "team_suppressions:add",
          "team_suppressions:remove",
          "projects:read",
          "projects:manage",
          "projects:delete",
          "routes:read",
          "routes:manage",
          "routes:delete",
          "domains:read",
          "domains:manage",
          "domains:delete",
          "project_tokens:read",
          "project_tokens:manage",
          "project_tokens:rotate",
          "project_tokens:revoke",
          "webhooks:read",
          "webhooks:manage",
          "webhooks:delete",
          "webhooks:rotate_secret",
          "stats:read",
          "messages:read",
          "messages:read_content",
          "suppressions:read",
          "suppressions:add",
          "suppressions:remove"
        ],
        "title": "RbacPermission"
      },
      "RecordType": {
        "type": "string",
        "enum": [
          "TXT",
          "CNAME",
          "MX"
        ],
        "title": "RecordType"
      },
      "RouteData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "route_type": {
            "$ref": "#/components/schemas/RouteType"
          },
          "is_default": {
            "type": "boolean"
          },
          "inbound_address": {
            "type": [
              "string",
              "null"
            ]
          },
          "inbound_domain": {
            "type": [
              "string",
              "null"
            ]
          },
          "inbound_domain_verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "inbound_spam_threshold": {
            "type": [
              "number",
              "null"
            ]
          },
          "attachment_delivery": {
            "$ref": "#/components/schemas/AttachmentDelivery"
          },
          "settings": {
            "description": "Route settings available for this route type and team feature access",
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "object",
                "properties": {
                  "disable_hosted_unsubscribe": {
                    "type": "boolean"
                  },
                  "track_opens": {
                    "type": "boolean"
                  },
                  "track_clicks": {
                    "type": "boolean"
                  },
                  "generate_plaintext_fallback": {
                    "type": "boolean"
                  },
                  "suppress_auto_responders": {
                    "type": "boolean"
                  },
                  "redact_email_content": {
                    "type": "boolean"
                  },
                  "attachment_delivery": {
                    "type": "object"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "project": {
            "$ref": "#/components/schemas/ProjectData"
          },
          "webhooks_count": {
            "type": "integer"
          },
          "suppressed_recipients_count": {
            "type": "integer"
          },
          "statistics": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RouteStatisticData"
                }
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "project_id",
          "slug",
          "name",
          "route_type",
          "is_default",
          "created_at",
          "updated_at"
        ],
        "title": "RouteData"
      },
      "RouteListData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "route_type": {
            "$ref": "#/components/schemas/RouteType"
          },
          "is_default": {
            "type": "boolean"
          },
          "webhooks_count": {
            "type": "integer"
          },
          "suppressed_recipients_count": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "route_type",
          "is_default",
          "webhooks_count",
          "suppressed_recipients_count",
          "created_at",
          "updated_at"
        ],
        "title": "RouteListData"
      },
      "RouteStatisticData": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "sent_count": {
            "type": "integer"
          },
          "delivered_count": {
            "type": "integer"
          },
          "opened_count": {
            "type": "integer"
          },
          "clicked_count": {
            "type": "integer"
          },
          "hard_bounce_count": {
            "type": "integer"
          },
          "spam_complaint_count": {
            "type": "integer"
          },
          "inbound_received_count": {
            "type": "integer"
          },
          "effective_opened_count": {
            "type": [
              "integer",
              "null"
            ]
          },
          "machine_opened_count": {
            "type": [
              "integer",
              "null"
            ]
          },
          "machine_clicked_count": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "date",
          "sent_count",
          "delivered_count",
          "opened_count",
          "clicked_count",
          "hard_bounce_count",
          "spam_complaint_count",
          "inbound_received_count",
          "effective_opened_count",
          "machine_opened_count",
          "machine_clicked_count"
        ],
        "title": "RouteStatisticData"
      },
      "RouteType": {
        "type": "string",
        "enum": [
          "transactional",
          "broadcast",
          "inbound"
        ],
        "title": "RouteType"
      },
      "SpamSymbol": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "score": {
            "type": "number"
          },
          "options": {
            "type": "array",
            "default": [],
            "items": {
              "type": "string"
            },
            "minItems": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "score",
          "options",
          "description"
        ],
        "title": "SpamSymbol"
      },
      "StatsDailyData": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "sent": {
            "type": "integer"
          },
          "delivered": {
            "type": "integer"
          },
          "hard_bounced": {
            "type": "integer"
          },
          "spam_complaints": {
            "type": "integer"
          },
          "opened": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Null when tracking is not enabled for this context"
          },
          "clicked": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Null when tracking is not enabled for this context"
          },
          "inbound": {
            "$ref": "#/components/schemas/StatsInboundData"
          },
          "transactional": {
            "anyOf": [
              {
                "description": "Null for team-scoped stats (only available when project_id is specified)",
                "$ref": "#/components/schemas/StatsTypeData"
              },
              {
                "type": "null"
              }
            ]
          },
          "broadcast": {
            "anyOf": [
              {
                "description": "Null for team-scoped stats (only available when project_id is specified)",
                "$ref": "#/components/schemas/StatsTypeData"
              },
              {
                "type": "null"
              }
            ]
          },
          "effective_opened": {
            "type": [
              "integer",
              "null"
            ]
          },
          "machine_opened": {
            "type": [
              "integer",
              "null"
            ]
          },
          "machine_clicked": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "date",
          "sent",
          "delivered",
          "hard_bounced",
          "spam_complaints",
          "opened",
          "clicked",
          "inbound",
          "transactional",
          "broadcast",
          "effective_opened",
          "machine_opened",
          "machine_clicked"
        ],
        "title": "StatsDailyData"
      },
      "StatsData": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "totals": {
            "$ref": "#/components/schemas/StatsTotalsData"
          },
          "daily": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatsDailyData"
            }
          }
        },
        "required": [
          "from",
          "to",
          "totals",
          "daily"
        ],
        "title": "StatsData"
      },
      "StatsInboundData": {
        "type": "object",
        "properties": {
          "received": {
            "type": "integer"
          }
        },
        "required": [
          "received"
        ],
        "title": "StatsInboundData"
      },
      "StatsRequestData": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "include_machine": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "from",
          "to"
        ],
        "title": "StatsRequestData"
      },
      "StatsTotalsData": {
        "type": "object",
        "properties": {
          "sent": {
            "type": "integer"
          },
          "delivered": {
            "type": "integer"
          },
          "hard_bounced": {
            "type": "integer"
          },
          "spam_complaints": {
            "type": "integer"
          },
          "opened": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Null when tracking is not enabled for this context"
          },
          "clicked": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Null when tracking is not enabled for this context"
          },
          "inbound": {
            "$ref": "#/components/schemas/StatsInboundData"
          },
          "transactional": {
            "anyOf": [
              {
                "description": "Null for team-scoped stats (only available when project_id is specified)",
                "$ref": "#/components/schemas/StatsTypeData"
              },
              {
                "type": "null"
              }
            ]
          },
          "broadcast": {
            "anyOf": [
              {
                "description": "Null for team-scoped stats (only available when project_id is specified)",
                "$ref": "#/components/schemas/StatsTypeData"
              },
              {
                "type": "null"
              }
            ]
          },
          "effective_opened": {
            "type": [
              "integer",
              "null"
            ]
          },
          "machine_opened": {
            "type": [
              "integer",
              "null"
            ]
          },
          "machine_clicked": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "sent",
          "delivered",
          "hard_bounced",
          "spam_complaints",
          "opened",
          "clicked",
          "inbound",
          "transactional",
          "broadcast",
          "effective_opened",
          "machine_opened",
          "machine_clicked"
        ],
        "title": "StatsTotalsData"
      },
      "StatsTypeData": {
        "type": "object",
        "properties": {
          "sent": {
            "type": "integer"
          },
          "hard_bounced": {
            "type": "integer"
          },
          "spam_complaints": {
            "type": "integer"
          }
        },
        "required": [
          "sent",
          "hard_bounced",
          "spam_complaints"
        ],
        "title": "StatsTypeData"
      },
      "StoreDomainData": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "pattern": "^(?!:\\/\\/)(?=.{1,255}$)((.{1,63}\\.){1,127}[a-zA-Z]{2,63})$",
            "maxLength": 255
          }
        },
        "required": [
          "domain"
        ],
        "title": "StoreDomainData"
      },
      "StoreProjectData": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "smtp_enabled": {
            "type": "boolean",
            "default": false
          },
          "initial_routes": {
            "default": "both",
            "$ref": "#/components/schemas/InitialRoutes"
          },
          "short_token": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "name"
        ],
        "title": "StoreProjectData"
      },
      "StoreRouteData": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "route_type": {
            "$ref": "#/components/schemas/RouteType"
          },
          "slug": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          }
        },
        "required": [
          "name",
          "route_type"
        ],
        "title": "StoreRouteData"
      },
      "StoreSuppressionData": {
        "type": "object",
        "properties": {
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 255
          },
          "emails": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string",
              "format": "email",
              "maxLength": 255
            },
            "minItems": 1,
            "maxItems": 1000
          },
          "reason": {
            "$ref": "#/components/schemas/SuppressionReason"
          },
          "scope": {
            "$ref": "#/components/schemas/SuppressionScope"
          },
          "route_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        },
        "required": [
          "reason",
          "scope"
        ],
        "title": "StoreSuppressionData"
      },
      "StoreWebhookData": {
        "type": "object",
        "properties": {
          "route_id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 500
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEvent"
            },
            "minItems": 1
          },
          "enabled": {
            "type": [
              "boolean",
              "null"
            ],
            "default": true
          },
          "include_machine_events": {
            "type": [
              "boolean",
              "null"
            ],
            "default": false
          }
        },
        "required": [
          "route_id",
          "name",
          "url",
          "events"
        ],
        "title": "StoreWebhookData"
      },
      "SuppressedRecipientData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/SuppressionType"
          },
          "value": {
            "type": "string"
          },
          "reason": {
            "$ref": "#/components/schemas/SuppressionReason"
          },
          "scope": {
            "$ref": "#/components/schemas/SuppressionScope"
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "route_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "type",
          "value",
          "reason",
          "scope",
          "project_id",
          "route_id",
          "created_at",
          "updated_at"
        ],
        "title": "SuppressedRecipientData"
      },
      "SuppressionReason": {
        "type": "string",
        "enum": [
          "spam_complaint",
          "hard_bounce",
          "unsubscribe",
          "manual"
        ],
        "title": "SuppressionReason"
      },
      "SuppressionScope": {
        "type": "string",
        "enum": [
          "global",
          "team",
          "project",
          "route"
        ],
        "title": "SuppressionScope"
      },
      "SuppressionType": {
        "type": "string",
        "enum": [
          "email",
          "domain",
          "extension"
        ],
        "title": "SuppressionType"
      },
      "TeamAddonData": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "type",
          "expires_at"
        ],
        "title": "TeamAddonData"
      },
      "TeamData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/TeamType"
          },
          "plan": {
            "$ref": "#/components/schemas/Plan"
          },
          "included_volume": {
            "type": "integer",
            "description": "Number of emails included in the team's monthly plan."
          },
          "tier": {
            "type": "integer",
            "description": "Deprecated alias for `included_volume`.",
            "deprecated": true
          },
          "verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "addons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TeamAddonData"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "domains_count": {
            "type": "integer"
          },
          "projects_count": {
            "type": "integer"
          },
          "members_count": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "name",
          "type",
          "plan",
          "included_volume",
          "tier",
          "verified_at",
          "created_at"
        ],
        "title": "TeamData"
      },
      "TeamMemberData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ]
          },
          "project_access": {
            "$ref": "#/components/schemas/TeamMemberProjectAccessData"
          },
          "joined_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "role",
          "project_access",
          "joined_at"
        ],
        "title": "TeamMemberData"
      },
      "TeamMemberProjectAccessData": {
        "type": "object",
        "properties": {
          "scope": {
            "$ref": "#/components/schemas/ProjectAccessScope"
          },
          "projects": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name"
              ]
            }
          }
        },
        "required": [
          "scope",
          "projects"
        ],
        "title": "TeamMemberProjectAccessData"
      },
      "TeamRoleData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "system_key": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BuiltInTeamRole"
              },
              {
                "type": "null"
              }
            ]
          },
          "permissions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RbacPermission"
            }
          },
          "assignable": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "system_key",
          "permissions",
          "assignable"
        ],
        "title": "TeamRoleData"
      },
      "TeamType": {
        "type": "string",
        "enum": [
          "personal",
          "business"
        ],
        "title": "TeamType"
      },
      "TeamUsageDetailData": {
        "type": "object",
        "properties": {
          "current_period": {
            "$ref": "#/components/schemas/TeamUsagePeriodData"
          },
          "historical_usage": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TeamUsagePeriodData"
            }
          }
        },
        "required": [
          "current_period",
          "historical_usage"
        ],
        "title": "TeamUsageDetailData"
      },
      "TeamUsagePeriodData": {
        "type": "object",
        "properties": {
          "usage": {
            "type": "integer"
          },
          "last_incremented_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "period_start": {
            "type": "string",
            "format": "date-time"
          },
          "period_end": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "usage",
          "last_incremented_at",
          "period_start",
          "period_end"
        ],
        "title": "TeamUsagePeriodData"
      },
      "UpdateDomainProjectsData": {
        "type": "object",
        "properties": {
          "project_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "minItems": 1
          }
        },
        "required": [
          "project_ids"
        ],
        "title": "UpdateDomainProjectsData"
      },
      "UpdateProjectData": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "smtp_enabled": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "redact_email_content": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "default_route_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        },
        "title": "UpdateProjectData"
      },
      "UpdateRouteData": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "settings": {
            "anyOf": [
              {
                "description": "Route settings. `track_opens` and `track_clicks` apply to transactional and broadcast routes when email tracking is available. `generate_plaintext_fallback` opts in to generated plaintext fallbacks for HTML-only outbound messages; customer-provided plaintext is always preserved. `suppress_auto_responders` adds outbound headers that suppress auto-responders. `disable_hosted_unsubscribe` applies to broadcast routes when enabled for the team. `redact_email_content` requires email redaction access",
                "$ref": "#/components/schemas/UpdateRouteSettingsData"
              },
              {
                "type": "null"
              }
            ]
          },
          "inbound_settings": {
            "anyOf": [
              {
                "description": "Inbound route settings. Only accepted for inbound routes",
                "$ref": "#/components/schemas/UpdateRouteInboundSettingsData"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "title": "UpdateRouteData"
      },
      "UpdateRouteInboundSettingsData": {
        "type": "object",
        "properties": {
          "inbound_domain": {
            "type": [
              "string",
              "null"
            ],
            "description": "Custom receiving domain for inbound routes, such as support.example.com or *.m.example.com. Address patterns such as *@*.m.example.com are normalized",
            "maxLength": 255
          },
          "inbound_spam_threshold": {
            "type": [
              "number",
              "null"
            ],
            "description": "Inbound spam threshold for inbound routes. Higher values are more permissive",
            "minimum": 0,
            "maximum": 10
          },
          "attachment_delivery": {
            "anyOf": [
              {
                "description": "Inbound attachment delivery mode",
                "$ref": "#/components/schemas/AttachmentDelivery"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "title": "UpdateRouteInboundSettingsData"
      },
      "UpdateRouteSettingsData": {
        "type": "object",
        "properties": {
          "track_opens": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Enable open tracking for transactional and broadcast routes. Requires email tracking access"
          },
          "track_clicks": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Enable click tracking for transactional and broadcast routes. Requires email tracking access"
          },
          "generate_plaintext_fallback": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Opt in to generated plaintext fallbacks for HTML-only outbound messages on transactional and broadcast routes. Customer-provided plaintext is always preserved"
          },
          "suppress_auto_responders": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Add outbound headers that suppress auto-responders for transactional and broadcast routes. Customer-provided header values are preserved"
          },
          "disable_hosted_unsubscribe": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Disable Lettermint-hosted unsubscribe link injection for broadcast routes. Available only when enabled for the team"
          },
          "redact_email_content": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Redact email content in the dashboard for this route. Requires email redaction access"
          }
        },
        "title": "UpdateRouteSettingsData"
      },
      "UpdateTeamData": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          }
        },
        "title": "UpdateTeamData"
      },
      "UpdateTeamMemberAssignmentData": {
        "type": "object",
        "properties": {
          "role_id": {
            "type": "string",
            "format": "uuid"
          },
          "project_access": {
            "type": "object",
            "properties": {
              "scope": {
                "$ref": "#/components/schemas/ProjectAccessScope"
              },
              "project_ids": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "maxItems": 1000
              }
            },
            "required": [
              "scope"
            ]
          }
        },
        "required": [
          "role_id",
          "project_access"
        ],
        "title": "UpdateTeamMemberAssignmentData"
      },
      "UpdateWebhookData": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 500
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEvent"
            },
            "minItems": 1
          },
          "enabled": {
            "type": "boolean"
          },
          "include_machine_events": {
            "type": "boolean"
          }
        },
        "title": "UpdateWebhookData"
      },
      "WebhookData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "route_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1
          },
          "enabled": {
            "type": "boolean"
          },
          "include_machine_events": {
            "type": "boolean"
          },
          "secret": {
            "type": "string"
          },
          "last_called_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "route_id",
          "name",
          "url",
          "events",
          "enabled",
          "include_machine_events",
          "last_called_at",
          "created_at",
          "updated_at"
        ],
        "title": "WebhookData"
      },
      "WebhookDeliveryData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "webhook_id": {
            "type": "string"
          },
          "event_type": {
            "$ref": "#/components/schemas/WebhookEvent"
          },
          "status": {
            "$ref": "#/components/schemas/WebhookDeliveryStatus"
          },
          "attempt_number": {
            "type": "integer"
          },
          "http_status_code": {
            "type": [
              "integer",
              "null"
            ]
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "payload": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1
          },
          "response_body": {
            "type": [
              "string",
              "null"
            ]
          },
          "response_headers": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "webhook_id",
          "event_type",
          "status",
          "attempt_number",
          "http_status_code",
          "duration_ms",
          "payload",
          "response_body",
          "response_headers",
          "error_message",
          "delivered_at",
          "timestamp"
        ],
        "title": "WebhookDeliveryData"
      },
      "WebhookDeliveryListData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "webhook_id": {
            "type": "string"
          },
          "event_type": {
            "$ref": "#/components/schemas/WebhookEvent"
          },
          "status": {
            "$ref": "#/components/schemas/WebhookDeliveryStatus"
          },
          "attempt_number": {
            "type": "integer"
          },
          "http_status_code": {
            "type": [
              "integer",
              "null"
            ]
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "webhook_id",
          "event_type",
          "status",
          "attempt_number",
          "http_status_code",
          "duration_ms",
          "delivered_at",
          "created_at"
        ],
        "title": "WebhookDeliveryListData"
      },
      "WebhookDeliveryStatus": {
        "type": "string",
        "enum": [
          "pending",
          "success",
          "failed",
          "client_error",
          "server_error",
          "timeout"
        ],
        "title": "WebhookDeliveryStatus"
      },
      "WebhookEvent": {
        "type": "string",
        "enum": [
          "message.created",
          "message.sent",
          "message.delivered",
          "message.auto_replied",
          "message.hard_bounced",
          "message.soft_bounced",
          "message.spam_complaint",
          "message.failed",
          "message.suppressed",
          "message.unsubscribed",
          "message.opened",
          "message.clicked",
          "message.inbound",
          "message.policy_rejected",
          "webhook.test"
        ],
        "title": "WebhookEvent"
      },
      "WebhookListData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "route_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEvent"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "last_called_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "route_id",
          "name",
          "url",
          "events",
          "enabled",
          "last_called_at",
          "created_at",
          "updated_at"
        ],
        "title": "WebhookListData"
      }
    },
    "responses": {
      "ValidationException": {
        "description": "Validation error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string",
                  "description": "Errors overview."
                },
                "errors": {
                  "type": "object",
                  "description": "A detailed description of each field that failed validation.",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "required": [
                "message",
                "errors"
              ]
            }
          }
        }
      },
      "RbacConflictException": {
        "description": "Role or project-access state conflict",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "$ref": "#/components/schemas/RbacConflictCode"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              },
              "required": [
                "error"
              ]
            }
          }
        }
      },
      "ModelNotFoundException": {
        "description": "Not found",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string",
                  "description": "Error overview."
                }
              },
              "required": [
                "message"
              ]
            }
          }
        }
      }
    }
  }
}
