{
  "openapi": "3.0.3",
  "info": {
    "title": "EmailsDone Firebase Wrapper",
    "version": "1.0.0",
    "description": "A single Firebase HTTPS function exposing one route per EmailsDone transactional template."
  },
  "servers": [
    {
      "url": "http://127.0.0.1:5001/{projectId}/europe-west2/emailsdone",
      "description": "Firebase Functions emulator",
      "variables": {
        "projectId": {
          "default": "demo-emailsdone-firebase"
        }
      }
    }
  ],
  "paths": {
    "/auth/account-locked": {
      "post": {
        "operationId": "sendAccountLocked",
        "tags": [
          "Authentication"
        ],
        "summary": "Send account-locked",
        "description": "Send the EmailsDone account-locked template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Account locked data for the account-locked template. Sent when an account is locked. Generated from template version v1.",
                    "x-emailsdone-template-name": "Account locked",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Unlock account",
                        "example": "Unlock account"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Account locked",
                        "example": "Account locked"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your account has been locked for security.",
                        "example": "Your account has been locked for security."
                      },
                      {
                        "name": "lockDetails",
                        "label": "Lock details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "lockedAt": "Locked At",
                          "reason": "Reason"
                        },
                        "detailsTable": {
                          "binding": "lockDetails",
                          "heading": "Lock details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "lockedAt",
                              "label": "Locked",
                              "format": "datetime"
                            },
                            {
                              "key": "reason",
                              "label": "Reason",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "notice",
                        "label": "Notice",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "You may need to verify your identity before access is restored.",
                        "example": "You may need to verify your identity before access is restored."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Your account has been locked for security.",
                        "example": "Your account has been locked for security."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Account locked",
                        "example": "Account locked"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Unlock account",
                            "examples": [
                              "Unlock account"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Account locked",
                        "examples": [
                          "Account locked"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Your account has been locked for security.",
                        "examples": [
                          "Your account has been locked for security."
                        ],
                        "maxLength": 1000
                      },
                      "lockDetails": {
                        "type": "object",
                        "description": "Lock details",
                        "additionalProperties": false,
                        "properties": {
                          "lockedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Locked"
                          },
                          "reason": {
                            "type": "string",
                            "description": "Reason"
                          }
                        },
                        "examples": [
                          {
                            "lockedAt": "Locked At",
                            "reason": "Reason"
                          }
                        ]
                      },
                      "notice": {
                        "type": "string",
                        "description": "Notice",
                        "default": "You may need to verify your identity before access is restored.",
                        "examples": [
                          "You may need to verify your identity before access is restored."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Your account has been locked for security.",
                        "examples": [
                          "Your account has been locked for security."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Account locked",
                        "examples": [
                          "Account locked"
                        ],
                        "maxLength": 180
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/auth/email-changed": {
      "post": {
        "operationId": "sendEmailChanged",
        "tags": [
          "Authentication"
        ],
        "summary": "Send email-changed",
        "description": "Send the EmailsDone email-changed template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Email changed data for the email-changed template. Sent when an account email address is changed. Generated from template version v1.",
                    "x-emailsdone-template-name": "Email changed",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Review account",
                        "example": "Review account"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "changeDetails",
                        "label": "Change details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "changedAt": "Changed At",
                          "oldEmail": "Old Email",
                          "newEmail": "New Email"
                        },
                        "detailsTable": {
                          "binding": "changeDetails",
                          "heading": "Change details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "changedAt",
                              "label": "Changed",
                              "format": "datetime"
                            },
                            {
                              "key": "oldEmail",
                              "label": "Previous email",
                              "format": "email"
                            },
                            {
                              "key": "newEmail",
                              "label": "New email",
                              "format": "email"
                            }
                          ]
                        }
                      },
                      {
                        "name": "footerNote",
                        "label": "Footer Note",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "If you did not make this change, review your account security.",
                        "example": "If you did not make this change, review your account security."
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Email address changed",
                        "example": "Email address changed"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "The email address on your account was changed.",
                        "example": "The email address on your account was changed."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "The email address on your account was changed.",
                        "example": "The email address on your account was changed."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Email address changed",
                        "example": "Email address changed"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Review account",
                            "examples": [
                              "Review account"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "changeDetails": {
                        "type": "object",
                        "description": "Change details",
                        "additionalProperties": false,
                        "properties": {
                          "changedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Changed"
                          },
                          "newEmail": {
                            "type": "string",
                            "format": "email",
                            "description": "New email"
                          },
                          "oldEmail": {
                            "type": "string",
                            "format": "email",
                            "description": "Previous email"
                          }
                        },
                        "examples": [
                          {
                            "changedAt": "Changed At",
                            "oldEmail": "Old Email",
                            "newEmail": "New Email"
                          }
                        ]
                      },
                      "footerNote": {
                        "type": "string",
                        "description": "Footer Note",
                        "default": "If you did not make this change, review your account security.",
                        "examples": [
                          "If you did not make this change, review your account security."
                        ],
                        "maxLength": 1000
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Email address changed",
                        "examples": [
                          "Email address changed"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "The email address on your account was changed.",
                        "examples": [
                          "The email address on your account was changed."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "The email address on your account was changed.",
                        "examples": [
                          "The email address on your account was changed."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Email address changed",
                        "examples": [
                          "Email address changed"
                        ],
                        "maxLength": 180
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/auth/login-code": {
      "post": {
        "operationId": "sendLoginCode",
        "tags": [
          "Authentication"
        ],
        "summary": "Send login-code",
        "description": "Send the EmailsDone login-code template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Login code data for the login-code template. Sent when a user requests a one-time login code. Generated from template version v1.",
                    "x-emailsdone-template-name": "Login code",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "code",
                        "label": "Code",
                        "type": "code",
                        "required": true,
                        "description": "",
                        "maxLength": 240,
                        "example": "123456"
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "footerNote",
                        "label": "Footer Note",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "If you did not request this code, you can safely ignore this email.",
                        "example": "If you did not request this code, you can safely ignore this email."
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Your login code",
                        "example": "Your login code"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Use this code to continue signing in.",
                        "example": "Use this code to continue signing in."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Use this code to continue signing in.",
                        "example": "Use this code to continue signing in."
                      },
                      {
                        "name": "securityNote",
                        "label": "Security Note",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "For security, this code will expire soon.",
                        "example": "For security, this code will expire soon."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Your login code",
                        "example": "Your login code"
                      }
                    ],
                    "properties": {
                      "code": {
                        "type": "string",
                        "description": "Code",
                        "examples": [
                          "123456"
                        ],
                        "maxLength": 240
                      },
                      "footerNote": {
                        "type": "string",
                        "description": "Footer Note",
                        "default": "If you did not request this code, you can safely ignore this email.",
                        "examples": [
                          "If you did not request this code, you can safely ignore this email."
                        ],
                        "maxLength": 1000
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Your login code",
                        "examples": [
                          "Your login code"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Use this code to continue signing in.",
                        "examples": [
                          "Use this code to continue signing in."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Use this code to continue signing in.",
                        "examples": [
                          "Use this code to continue signing in."
                        ],
                        "maxLength": 220
                      },
                      "securityNote": {
                        "type": "string",
                        "description": "Security Note",
                        "default": "For security, this code will expire soon.",
                        "examples": [
                          "For security, this code will expire soon."
                        ],
                        "maxLength": 1000
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Your login code",
                        "examples": [
                          "Your login code"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "code"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/auth/magic-link": {
      "post": {
        "operationId": "sendMagicLink",
        "tags": [
          "Authentication"
        ],
        "summary": "Send magic-link",
        "description": "Send the EmailsDone magic-link template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Magic link data for the magic-link template. Sent when a user requests a sign-in link. Generated from template version v1.",
                    "x-emailsdone-template-name": "Magic link",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": true,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Sign in",
                        "example": "Sign in"
                      },
                      {
                        "name": "footerNote",
                        "label": "Footer Note",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "If you did not request this email, you can safely ignore it.",
                        "example": "If you did not request this email, you can safely ignore it."
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Sign in to your account",
                        "example": "Sign in to your account"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Use this secure link to sign in. This link is private and will expire soon.",
                        "example": "Use this secure link to sign in. This link is private and will expire soon."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Use this secure link to sign in.",
                        "example": "Use this secure link to sign in."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Your sign-in link for {{projectName}}",
                        "example": "Your sign-in link for Project Name"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Sign in",
                            "examples": [
                              "Sign in"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        },
                        "required": [
                          "url"
                        ]
                      },
                      "footerNote": {
                        "type": "string",
                        "description": "Footer Note",
                        "default": "If you did not request this email, you can safely ignore it.",
                        "examples": [
                          "If you did not request this email, you can safely ignore it."
                        ],
                        "maxLength": 1000
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Sign in to your account",
                        "examples": [
                          "Sign in to your account"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Use this secure link to sign in. This link is private and will expire soon.",
                        "examples": [
                          "Use this secure link to sign in. This link is private and will expire soon."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Use this secure link to sign in.",
                        "examples": [
                          "Use this secure link to sign in."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Your sign-in link for {{projectName}}",
                        "examples": [
                          "Your sign-in link for Project Name"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "actionButton"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/auth/mfa-disabled": {
      "post": {
        "operationId": "sendMfaDisabled",
        "tags": [
          "Authentication"
        ],
        "summary": "Send mfa-disabled",
        "description": "Send the EmailsDone mfa-disabled template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "MFA disabled data for the mfa-disabled template. Sent when multi-factor authentication is disabled. Generated from template version v1.",
                    "x-emailsdone-template-name": "MFA disabled",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Review account",
                        "example": "Review account"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "footerNote",
                        "label": "Footer Note",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "If you did not make this change, review your account security.",
                        "example": "If you did not make this change, review your account security."
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Multi-factor authentication disabled",
                        "example": "Multi-factor authentication disabled"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Multi-factor authentication has been disabled for your account.",
                        "example": "Multi-factor authentication has been disabled for your account."
                      },
                      {
                        "name": "notice",
                        "label": "Notice",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your account may be less protected without multi-factor authentication.",
                        "example": "Your account may be less protected without multi-factor authentication."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Multi-factor authentication has been removed from your account.",
                        "example": "Multi-factor authentication has been removed from your account."
                      },
                      {
                        "name": "securityDetails",
                        "label": "Security details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "disabledAt": "Disabled At",
                          "device": "Device",
                          "country": "Country",
                          "ip": "Ip"
                        },
                        "detailsTable": {
                          "binding": "securityDetails",
                          "heading": "Security details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "disabledAt",
                              "label": "Disabled",
                              "format": "datetime"
                            },
                            {
                              "key": "device",
                              "label": "Device",
                              "format": null
                            },
                            {
                              "key": "country",
                              "label": "Location",
                              "format": null
                            },
                            {
                              "key": "ip",
                              "label": "IP address",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Multi-factor authentication disabled",
                        "example": "Multi-factor authentication disabled"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Review account",
                            "examples": [
                              "Review account"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "footerNote": {
                        "type": "string",
                        "description": "Footer Note",
                        "default": "If you did not make this change, review your account security.",
                        "examples": [
                          "If you did not make this change, review your account security."
                        ],
                        "maxLength": 1000
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Multi-factor authentication disabled",
                        "examples": [
                          "Multi-factor authentication disabled"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Multi-factor authentication has been disabled for your account.",
                        "examples": [
                          "Multi-factor authentication has been disabled for your account."
                        ],
                        "maxLength": 1000
                      },
                      "notice": {
                        "type": "string",
                        "description": "Notice",
                        "default": "Your account may be less protected without multi-factor authentication.",
                        "examples": [
                          "Your account may be less protected without multi-factor authentication."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Multi-factor authentication has been removed from your account.",
                        "examples": [
                          "Multi-factor authentication has been removed from your account."
                        ],
                        "maxLength": 220
                      },
                      "securityDetails": {
                        "type": "object",
                        "description": "Security details",
                        "additionalProperties": false,
                        "properties": {
                          "country": {
                            "type": "string",
                            "description": "Location"
                          },
                          "device": {
                            "type": "string",
                            "description": "Device"
                          },
                          "disabledAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Disabled"
                          },
                          "ip": {
                            "type": "string",
                            "description": "IP address"
                          }
                        },
                        "examples": [
                          {
                            "disabledAt": "Disabled At",
                            "device": "Device",
                            "country": "Country",
                            "ip": "Ip"
                          }
                        ]
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Multi-factor authentication disabled",
                        "examples": [
                          "Multi-factor authentication disabled"
                        ],
                        "maxLength": 180
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/auth/mfa-enabled": {
      "post": {
        "operationId": "sendMfaEnabled",
        "tags": [
          "Authentication"
        ],
        "summary": "Send mfa-enabled",
        "description": "Send the EmailsDone mfa-enabled template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "MFA enabled data for the mfa-enabled template. Sent when multi-factor authentication is enabled. Generated from template version v1.",
                    "x-emailsdone-template-name": "MFA enabled",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Review account",
                        "example": "Review account"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "footerNote",
                        "label": "Footer Note",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "If you did not make this change, review your account security.",
                        "example": "If you did not make this change, review your account security."
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Multi-factor authentication enabled",
                        "example": "Multi-factor authentication enabled"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Multi-factor authentication has been enabled for your account.",
                        "example": "Multi-factor authentication has been enabled for your account."
                      },
                      {
                        "name": "notice",
                        "label": "Notice",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your account now has an extra layer of protection.",
                        "example": "Your account now has an extra layer of protection."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "An extra layer of security has been added to your account.",
                        "example": "An extra layer of security has been added to your account."
                      },
                      {
                        "name": "securityDetails",
                        "label": "Security details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "enabledAt": "Enabled At",
                          "method": "Method",
                          "device": "Device"
                        },
                        "detailsTable": {
                          "binding": "securityDetails",
                          "heading": "Security details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "enabledAt",
                              "label": "Enabled",
                              "format": "datetime"
                            },
                            {
                              "key": "method",
                              "label": "Method",
                              "format": null
                            },
                            {
                              "key": "device",
                              "label": "Device",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Multi-factor authentication enabled",
                        "example": "Multi-factor authentication enabled"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Review account",
                            "examples": [
                              "Review account"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "footerNote": {
                        "type": "string",
                        "description": "Footer Note",
                        "default": "If you did not make this change, review your account security.",
                        "examples": [
                          "If you did not make this change, review your account security."
                        ],
                        "maxLength": 1000
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Multi-factor authentication enabled",
                        "examples": [
                          "Multi-factor authentication enabled"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Multi-factor authentication has been enabled for your account.",
                        "examples": [
                          "Multi-factor authentication has been enabled for your account."
                        ],
                        "maxLength": 1000
                      },
                      "notice": {
                        "type": "string",
                        "description": "Notice",
                        "default": "Your account now has an extra layer of protection.",
                        "examples": [
                          "Your account now has an extra layer of protection."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "An extra layer of security has been added to your account.",
                        "examples": [
                          "An extra layer of security has been added to your account."
                        ],
                        "maxLength": 220
                      },
                      "securityDetails": {
                        "type": "object",
                        "description": "Security details",
                        "additionalProperties": false,
                        "properties": {
                          "device": {
                            "type": "string",
                            "description": "Device"
                          },
                          "enabledAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Enabled"
                          },
                          "method": {
                            "type": "string",
                            "description": "Method"
                          }
                        },
                        "examples": [
                          {
                            "enabledAt": "Enabled At",
                            "method": "Method",
                            "device": "Device"
                          }
                        ]
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Multi-factor authentication enabled",
                        "examples": [
                          "Multi-factor authentication enabled"
                        ],
                        "maxLength": 180
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/auth/new-device-login": {
      "post": {
        "operationId": "sendNewDeviceLogin",
        "tags": [
          "Authentication"
        ],
        "summary": "Send new-device-login",
        "description": "Send the EmailsDone new-device-login template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "New device login data for the new-device-login template. Sent when a user signs in from a new device. Generated from template version v1.",
                    "x-emailsdone-template-name": "New device login",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Review account",
                        "example": "Review account"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "footerNote",
                        "label": "Footer Note",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "If this was you, no action is needed.",
                        "example": "If this was you, no action is needed."
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "New sign-in detected",
                        "example": "New sign-in detected"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your account was accessed from a device we have not seen before.",
                        "example": "Your account was accessed from a device we have not seen before."
                      },
                      {
                        "name": "loginDetails",
                        "label": "Sign-in details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "signedInAt": "Signed In At",
                          "device": "Device",
                          "country": "Country",
                          "ip": "Ip"
                        },
                        "detailsTable": {
                          "binding": "loginDetails",
                          "heading": "Sign-in details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "signedInAt",
                              "label": "Time",
                              "format": "datetime"
                            },
                            {
                              "key": "device",
                              "label": "Device",
                              "format": null
                            },
                            {
                              "key": "country",
                              "label": "Location",
                              "format": null
                            },
                            {
                              "key": "ip",
                              "label": "IP address",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "A new device signed in to your account.",
                        "example": "A new device signed in to your account."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "New sign-in detected",
                        "example": "New sign-in detected"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Review account",
                            "examples": [
                              "Review account"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "footerNote": {
                        "type": "string",
                        "description": "Footer Note",
                        "default": "If this was you, no action is needed.",
                        "examples": [
                          "If this was you, no action is needed."
                        ],
                        "maxLength": 1000
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "New sign-in detected",
                        "examples": [
                          "New sign-in detected"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Your account was accessed from a device we have not seen before.",
                        "examples": [
                          "Your account was accessed from a device we have not seen before."
                        ],
                        "maxLength": 1000
                      },
                      "loginDetails": {
                        "type": "object",
                        "description": "Sign-in details",
                        "additionalProperties": false,
                        "properties": {
                          "country": {
                            "type": "string",
                            "description": "Location"
                          },
                          "device": {
                            "type": "string",
                            "description": "Device"
                          },
                          "ip": {
                            "type": "string",
                            "description": "IP address"
                          },
                          "signedInAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Time"
                          }
                        },
                        "examples": [
                          {
                            "signedInAt": "Signed In At",
                            "device": "Device",
                            "country": "Country",
                            "ip": "Ip"
                          }
                        ]
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "A new device signed in to your account.",
                        "examples": [
                          "A new device signed in to your account."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "New sign-in detected",
                        "examples": [
                          "New sign-in detected"
                        ],
                        "maxLength": 180
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/auth/password-changed": {
      "post": {
        "operationId": "sendPasswordChanged",
        "tags": [
          "Authentication"
        ],
        "summary": "Send password-changed",
        "description": "Send the EmailsDone password-changed template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Password changed data for the password-changed template. Sent when an account password is changed. Generated from template version v1.",
                    "x-emailsdone-template-name": "Password changed",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Review account",
                        "example": "Review account"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "changeDetails",
                        "label": "Change details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "changedAt": "Changed At",
                          "device": "Device",
                          "country": "Country",
                          "ip": "Ip"
                        },
                        "detailsTable": {
                          "binding": "changeDetails",
                          "heading": "Change details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "changedAt",
                              "label": "Changed",
                              "format": "datetime"
                            },
                            {
                              "key": "device",
                              "label": "Device",
                              "format": null
                            },
                            {
                              "key": "country",
                              "label": "Location",
                              "format": null
                            },
                            {
                              "key": "ip",
                              "label": "IP address",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "footerNote",
                        "label": "Footer Note",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "If you did not make this change, reset your password and review your account security.",
                        "example": "If you did not make this change, reset your password and review your account security."
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Password changed",
                        "example": "Password changed"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "The password on your account was changed.",
                        "example": "The password on your account was changed."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "The password on your account was changed.",
                        "example": "The password on your account was changed."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Password changed",
                        "example": "Password changed"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Review account",
                            "examples": [
                              "Review account"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "changeDetails": {
                        "type": "object",
                        "description": "Change details",
                        "additionalProperties": false,
                        "properties": {
                          "changedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Changed"
                          },
                          "country": {
                            "type": "string",
                            "description": "Location"
                          },
                          "device": {
                            "type": "string",
                            "description": "Device"
                          },
                          "ip": {
                            "type": "string",
                            "description": "IP address"
                          }
                        },
                        "examples": [
                          {
                            "changedAt": "Changed At",
                            "device": "Device",
                            "country": "Country",
                            "ip": "Ip"
                          }
                        ]
                      },
                      "footerNote": {
                        "type": "string",
                        "description": "Footer Note",
                        "default": "If you did not make this change, reset your password and review your account security.",
                        "examples": [
                          "If you did not make this change, reset your password and review your account security."
                        ],
                        "maxLength": 1000
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Password changed",
                        "examples": [
                          "Password changed"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "The password on your account was changed.",
                        "examples": [
                          "The password on your account was changed."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "The password on your account was changed.",
                        "examples": [
                          "The password on your account was changed."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Password changed",
                        "examples": [
                          "Password changed"
                        ],
                        "maxLength": 180
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/auth/password-reset": {
      "post": {
        "operationId": "sendPasswordReset",
        "tags": [
          "Authentication"
        ],
        "summary": "Send password-reset",
        "description": "Send the EmailsDone password-reset template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Password reset data for the password-reset template. Sent when a user requests a password reset. Generated from template version v1.",
                    "x-emailsdone-template-name": "Password reset",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": true,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/reset"
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Reset password",
                        "example": "Reset password"
                      },
                      {
                        "name": "footerNote",
                        "label": "Footer Note",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "If you did not request this, you can safely ignore this email. Your password will remain unchanged.",
                        "example": "If you did not request this, you can safely ignore this email. Your password will remain unchanged."
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Reset your password",
                        "example": "Reset your password"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "We received a request to reset your password.",
                        "example": "We received a request to reset your password."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Use this secure link to reset your password.",
                        "example": "Use this secure link to reset your password."
                      },
                      {
                        "name": "requestDetails",
                        "label": "Request details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "requestedAt": "Requested At",
                          "device": "Device",
                          "country": "Country",
                          "ip": "Ip"
                        },
                        "detailsTable": {
                          "binding": "requestDetails",
                          "heading": "Request details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "requestedAt",
                              "label": "Time",
                              "format": "datetime"
                            },
                            {
                              "key": "device",
                              "label": "Device",
                              "format": null
                            },
                            {
                              "key": "country",
                              "label": "Location",
                              "format": null
                            },
                            {
                              "key": "ip",
                              "label": "IP address",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "securityNote",
                        "label": "Security Note",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "For security, this link is private and will expire soon.",
                        "example": "For security, this link is private and will expire soon."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Reset your password",
                        "example": "Reset your password"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Reset password",
                            "examples": [
                              "Reset password"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/reset"
                            ],
                            "maxLength": 2048
                          }
                        },
                        "required": [
                          "url"
                        ]
                      },
                      "footerNote": {
                        "type": "string",
                        "description": "Footer Note",
                        "default": "If you did not request this, you can safely ignore this email. Your password will remain unchanged.",
                        "examples": [
                          "If you did not request this, you can safely ignore this email. Your password will remain unchanged."
                        ],
                        "maxLength": 1000
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Reset your password",
                        "examples": [
                          "Reset your password"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "We received a request to reset your password.",
                        "examples": [
                          "We received a request to reset your password."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Use this secure link to reset your password.",
                        "examples": [
                          "Use this secure link to reset your password."
                        ],
                        "maxLength": 220
                      },
                      "requestDetails": {
                        "type": "object",
                        "description": "Request details",
                        "additionalProperties": false,
                        "properties": {
                          "country": {
                            "type": "string",
                            "description": "Location"
                          },
                          "device": {
                            "type": "string",
                            "description": "Device"
                          },
                          "ip": {
                            "type": "string",
                            "description": "IP address"
                          },
                          "requestedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Time"
                          }
                        },
                        "examples": [
                          {
                            "requestedAt": "Requested At",
                            "device": "Device",
                            "country": "Country",
                            "ip": "Ip"
                          }
                        ]
                      },
                      "securityNote": {
                        "type": "string",
                        "description": "Security Note",
                        "default": "For security, this link is private and will expire soon.",
                        "examples": [
                          "For security, this link is private and will expire soon."
                        ],
                        "maxLength": 1000
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Reset your password",
                        "examples": [
                          "Reset your password"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "actionButton"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              },
              "example": {
                "to": "user@example.com",
                "data": {
                  "actionButton": {
                    "url": "https://app.example.com/reset"
                  }
                },
                "idempotencyKey": "password-reset-user-123"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/auth/suspicious-login": {
      "post": {
        "operationId": "sendSuspiciousLogin",
        "tags": [
          "Authentication"
        ],
        "summary": "Send suspicious-login",
        "description": "Send the EmailsDone suspicious-login template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Suspicious login data for the suspicious-login template. Sent when a suspicious sign-in attempt is detected. Generated from template version v1.",
                    "x-emailsdone-template-name": "Suspicious login",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Review account",
                        "example": "Review account"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Suspicious sign-in attempt",
                        "example": "Suspicious sign-in attempt"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "A sign-in attempt looked unusual and may need your attention.",
                        "example": "A sign-in attempt looked unusual and may need your attention."
                      },
                      {
                        "name": "loginDetails",
                        "label": "Sign-in details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "attemptedAt": "Attempted At",
                          "device": "Device",
                          "country": "Country",
                          "ip": "Ip"
                        },
                        "detailsTable": {
                          "binding": "loginDetails",
                          "heading": "Sign-in details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "attemptedAt",
                              "label": "Time",
                              "format": "datetime"
                            },
                            {
                              "key": "device",
                              "label": "Device",
                              "format": null
                            },
                            {
                              "key": "country",
                              "label": "Location",
                              "format": null
                            },
                            {
                              "key": "ip",
                              "label": "IP address",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "notice",
                        "label": "Notice",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "If this was not you, review your account security.",
                        "example": "If this was not you, review your account security."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Review this sign-in attempt.",
                        "example": "Review this sign-in attempt."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Suspicious sign-in attempt",
                        "example": "Suspicious sign-in attempt"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Review account",
                            "examples": [
                              "Review account"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Suspicious sign-in attempt",
                        "examples": [
                          "Suspicious sign-in attempt"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "A sign-in attempt looked unusual and may need your attention.",
                        "examples": [
                          "A sign-in attempt looked unusual and may need your attention."
                        ],
                        "maxLength": 1000
                      },
                      "loginDetails": {
                        "type": "object",
                        "description": "Sign-in details",
                        "additionalProperties": false,
                        "properties": {
                          "attemptedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Time"
                          },
                          "country": {
                            "type": "string",
                            "description": "Location"
                          },
                          "device": {
                            "type": "string",
                            "description": "Device"
                          },
                          "ip": {
                            "type": "string",
                            "description": "IP address"
                          }
                        },
                        "examples": [
                          {
                            "attemptedAt": "Attempted At",
                            "device": "Device",
                            "country": "Country",
                            "ip": "Ip"
                          }
                        ]
                      },
                      "notice": {
                        "type": "string",
                        "description": "Notice",
                        "default": "If this was not you, review your account security.",
                        "examples": [
                          "If this was not you, review your account security."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Review this sign-in attempt.",
                        "examples": [
                          "Review this sign-in attempt."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Suspicious sign-in attempt",
                        "examples": [
                          "Suspicious sign-in attempt"
                        ],
                        "maxLength": 180
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/auth/verify-email": {
      "post": {
        "operationId": "sendVerifyEmail",
        "tags": [
          "Authentication"
        ],
        "summary": "Send verify-email",
        "description": "Send the EmailsDone verify-email template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Verify email data for the verify-email template. Sent when a user needs to verify an email address. Generated from template version v1.",
                    "x-emailsdone-template-name": "Verify email",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": true,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/verify"
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Verify email",
                        "example": "Verify email"
                      },
                      {
                        "name": "footerNote",
                        "label": "Footer Note",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "If you did not create an account, you can safely ignore this email.",
                        "example": "If you did not create an account, you can safely ignore this email."
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Verify your email",
                        "example": "Verify your email"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Please confirm your email address to finish setting up your account.",
                        "example": "Please confirm your email address to finish setting up your account."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Confirm your email address to finish setting up your account.",
                        "example": "Confirm your email address to finish setting up your account."
                      },
                      {
                        "name": "securityNote",
                        "label": "Security Note",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Verifying your email helps keep your account secure and ensures you can receive important notifications.",
                        "example": "Verifying your email helps keep your account secure and ensures you can receive important notifications."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Verify your email address",
                        "example": "Verify your email address"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Verify email",
                            "examples": [
                              "Verify email"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/verify"
                            ],
                            "maxLength": 2048
                          }
                        },
                        "required": [
                          "url"
                        ]
                      },
                      "footerNote": {
                        "type": "string",
                        "description": "Footer Note",
                        "default": "If you did not create an account, you can safely ignore this email.",
                        "examples": [
                          "If you did not create an account, you can safely ignore this email."
                        ],
                        "maxLength": 1000
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Verify your email",
                        "examples": [
                          "Verify your email"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Please confirm your email address to finish setting up your account.",
                        "examples": [
                          "Please confirm your email address to finish setting up your account."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Confirm your email address to finish setting up your account.",
                        "examples": [
                          "Confirm your email address to finish setting up your account."
                        ],
                        "maxLength": 220
                      },
                      "securityNote": {
                        "type": "string",
                        "description": "Security Note",
                        "default": "Verifying your email helps keep your account secure and ensures you can receive important notifications.",
                        "examples": [
                          "Verifying your email helps keep your account secure and ensures you can receive important notifications."
                        ],
                        "maxLength": 1000
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Verify your email address",
                        "examples": [
                          "Verify your email address"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "actionButton"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              },
              "example": {
                "to": "user@example.com",
                "data": {
                  "actionButton": {
                    "url": "https://app.example.com/verify"
                  }
                },
                "idempotencyKey": "verify-email-user-123"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/auth/welcome": {
      "post": {
        "operationId": "sendWelcome",
        "tags": [
          "Authentication"
        ],
        "summary": "Send welcome",
        "description": "Send the EmailsDone welcome template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Welcome data for the welcome template. Sent when a user first joins an app. Generated from template version v1.",
                    "x-emailsdone-template-name": "Welcome",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": true,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Open {{projectName}}",
                        "example": "Open {{projectName}}"
                      },
                      {
                        "name": "callToActionHeading",
                        "label": "Call To Action Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "",
                        "example": ""
                      },
                      {
                        "name": "callToActionParagraph",
                        "label": "Call To Action Paragraph",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "",
                        "example": ""
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Welcome to {{projectName}}",
                        "example": "Welcome to Project Name"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your account has been created and you're ready to get started.",
                        "example": "Your account has been created and you're ready to get started."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Your account is ready to go.",
                        "example": "Your account is ready to go."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Welcome to {{projectName}}",
                        "example": "Welcome to Project Name"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Open {{projectName}}",
                            "examples": [
                              "Open {{projectName}}"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        },
                        "required": [
                          "url"
                        ]
                      },
                      "callToActionHeading": {
                        "type": "string",
                        "description": "Call To Action Heading",
                        "default": "",
                        "examples": [
                          ""
                        ],
                        "maxLength": 180
                      },
                      "callToActionParagraph": {
                        "type": "string",
                        "description": "Call To Action Paragraph",
                        "default": "",
                        "examples": [
                          ""
                        ],
                        "maxLength": 1000
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Welcome to {{projectName}}",
                        "examples": [
                          "Welcome to Project Name"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Your account has been created and you're ready to get started.",
                        "examples": [
                          "Your account has been created and you're ready to get started."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Your account is ready to go.",
                        "examples": [
                          "Your account is ready to go."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Welcome to {{projectName}}",
                        "examples": [
                          "Welcome to Project Name"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "actionButton"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/billing/invoice": {
      "post": {
        "operationId": "sendInvoice",
        "tags": [
          "Billing"
        ],
        "summary": "Send invoice",
        "description": "Send the EmailsDone invoice template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Invoice data for the invoice template. Sent when an invoice is issued. Generated from template version v1.",
                    "x-emailsdone-template-name": "Invoice",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "invoice",
                        "label": "Invoice",
                        "type": "object",
                        "required": true,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "items": [
                            {
                              "quantity": "Quantity",
                              "code": "Code",
                              "description": "Description",
                              "amount": "GBP 20.00"
                            }
                          ],
                          "totals": {
                            "subtotal": "GBP 20.00",
                            "tax": "Tax",
                            "total": "GBP 20.00"
                          }
                        }
                      },
                      {
                        "name": "invoiceNumber",
                        "label": "Invoice Number",
                        "type": "text",
                        "required": true,
                        "description": "",
                        "maxLength": 1000,
                        "example": "Invoice Number"
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View invoice",
                        "example": "View invoice"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Invoice {{invoiceNumber}}",
                        "example": "Invoice Invoice Number"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your invoice is ready.",
                        "example": "Your invoice is ready."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Your invoice is ready.",
                        "example": "Your invoice is ready."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Invoice {{invoiceNumber}}",
                        "example": "Invoice Invoice Number"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View invoice",
                            "examples": [
                              "View invoice"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Invoice {{invoiceNumber}}",
                        "examples": [
                          "Invoice Invoice Number"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Your invoice is ready.",
                        "examples": [
                          "Your invoice is ready."
                        ],
                        "maxLength": 1000
                      },
                      "invoice": {
                        "type": "object",
                        "description": "Invoice",
                        "examples": [
                          {
                            "items": [
                              {
                                "quantity": "Quantity",
                                "code": "Code",
                                "description": "Description",
                                "amount": "GBP 20.00"
                              }
                            ],
                            "totals": {
                              "subtotal": "GBP 20.00",
                              "tax": "Tax",
                              "total": "GBP 20.00"
                            }
                          }
                        ]
                      },
                      "invoiceNumber": {
                        "type": "string",
                        "description": "Invoice Number",
                        "examples": [
                          "Invoice Number"
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Your invoice is ready.",
                        "examples": [
                          "Your invoice is ready."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Invoice {{invoiceNumber}}",
                        "examples": [
                          "Invoice Invoice Number"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "invoice",
                      "invoiceNumber"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/billing/invoice-overdue": {
      "post": {
        "operationId": "sendInvoiceOverdue",
        "tags": [
          "Billing"
        ],
        "summary": "Send invoice-overdue",
        "description": "Send the EmailsDone invoice-overdue template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Invoice overdue data for the invoice-overdue template. Sent when an invoice is overdue. Generated from template version v1.",
                    "x-emailsdone-template-name": "Invoice overdue",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": true,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Pay invoice",
                        "example": "Pay invoice"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Invoice overdue",
                        "example": "Invoice overdue"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Payment for this invoice is now overdue.",
                        "example": "Payment for this invoice is now overdue."
                      },
                      {
                        "name": "invoiceDetails",
                        "label": "Invoice details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "invoiceNumber": "Invoice Number",
                          "amount": "Amount",
                          "dueDate": "Due Date",
                          "daysOverdue": "Days Overdue"
                        },
                        "detailsTable": {
                          "binding": "invoiceDetails",
                          "heading": "Invoice details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "invoiceNumber",
                              "label": "Invoice",
                              "format": null
                            },
                            {
                              "key": "amount",
                              "label": "Amount",
                              "format": "currency"
                            },
                            {
                              "key": "dueDate",
                              "label": "Due date",
                              "format": "date"
                            },
                            {
                              "key": "daysOverdue",
                              "label": "Days overdue",
                              "format": "number"
                            }
                          ]
                        }
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Payment is now overdue.",
                        "example": "Payment is now overdue."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Invoice overdue",
                        "example": "Invoice overdue"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Pay invoice",
                            "examples": [
                              "Pay invoice"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        },
                        "required": [
                          "url"
                        ]
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Invoice overdue",
                        "examples": [
                          "Invoice overdue"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Payment for this invoice is now overdue.",
                        "examples": [
                          "Payment for this invoice is now overdue."
                        ],
                        "maxLength": 1000
                      },
                      "invoiceDetails": {
                        "type": "object",
                        "description": "Invoice details",
                        "additionalProperties": false,
                        "properties": {
                          "amount": {
                            "type": "string",
                            "description": "Amount"
                          },
                          "daysOverdue": {
                            "type": "number",
                            "description": "Days overdue"
                          },
                          "dueDate": {
                            "type": "string",
                            "format": "date",
                            "description": "Due date"
                          },
                          "invoiceNumber": {
                            "type": "string",
                            "description": "Invoice"
                          }
                        },
                        "examples": [
                          {
                            "invoiceNumber": "Invoice Number",
                            "amount": "Amount",
                            "dueDate": "Due Date",
                            "daysOverdue": "Days Overdue"
                          }
                        ]
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Payment is now overdue.",
                        "examples": [
                          "Payment is now overdue."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Invoice overdue",
                        "examples": [
                          "Invoice overdue"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "actionButton"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/billing/payment-failed": {
      "post": {
        "operationId": "sendPaymentFailed",
        "tags": [
          "Billing"
        ],
        "summary": "Send payment-failed",
        "description": "Send the EmailsDone payment-failed template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Payment failed data for the payment-failed template. Sent when a payment attempt fails. Generated from template version v1.",
                    "x-emailsdone-template-name": "Payment failed",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": true,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Update payment",
                        "example": "Update payment"
                      },
                      {
                        "name": "actionNote",
                        "label": "Action Note",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Update your payment details to continue.",
                        "example": "Update your payment details to continue."
                      },
                      {
                        "name": "footerNote",
                        "label": "Footer Note",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "If you have already updated your payment details, no further action is needed.",
                        "example": "If you have already updated your payment details, no further action is needed."
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Payment failed",
                        "example": "Payment failed"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "We could not complete your latest payment.",
                        "example": "We could not complete your latest payment."
                      },
                      {
                        "name": "paymentDetails",
                        "label": "Payment details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "amount": "Amount",
                          "dueDate": "Due Date",
                          "paymentMethod": "Payment Method",
                          "reason": "Reason"
                        },
                        "detailsTable": {
                          "binding": "paymentDetails",
                          "heading": "Payment details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "amount",
                              "label": "Amount",
                              "format": "currency"
                            },
                            {
                              "key": "dueDate",
                              "label": "Due date",
                              "format": "date"
                            },
                            {
                              "key": "paymentMethod",
                              "label": "Payment method",
                              "format": null
                            },
                            {
                              "key": "reason",
                              "label": "Reason",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Update your payment details to continue.",
                        "example": "Update your payment details to continue."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Payment failed",
                        "example": "Payment failed"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Update payment",
                            "examples": [
                              "Update payment"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        },
                        "required": [
                          "url"
                        ]
                      },
                      "actionNote": {
                        "type": "string",
                        "description": "Action Note",
                        "default": "Update your payment details to continue.",
                        "examples": [
                          "Update your payment details to continue."
                        ],
                        "maxLength": 1000
                      },
                      "footerNote": {
                        "type": "string",
                        "description": "Footer Note",
                        "default": "If you have already updated your payment details, no further action is needed.",
                        "examples": [
                          "If you have already updated your payment details, no further action is needed."
                        ],
                        "maxLength": 1000
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Payment failed",
                        "examples": [
                          "Payment failed"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "We could not complete your latest payment.",
                        "examples": [
                          "We could not complete your latest payment."
                        ],
                        "maxLength": 1000
                      },
                      "paymentDetails": {
                        "type": "object",
                        "description": "Payment details",
                        "additionalProperties": false,
                        "properties": {
                          "amount": {
                            "type": "string",
                            "description": "Amount"
                          },
                          "dueDate": {
                            "type": "string",
                            "format": "date",
                            "description": "Due date"
                          },
                          "paymentMethod": {
                            "type": "string",
                            "description": "Payment method"
                          },
                          "reason": {
                            "type": "string",
                            "description": "Reason"
                          }
                        },
                        "examples": [
                          {
                            "amount": "Amount",
                            "dueDate": "Due Date",
                            "paymentMethod": "Payment Method",
                            "reason": "Reason"
                          }
                        ]
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Update your payment details to continue.",
                        "examples": [
                          "Update your payment details to continue."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Payment failed",
                        "examples": [
                          "Payment failed"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "actionButton"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              },
              "example": {
                "to": "user@example.com",
                "data": {
                  "actionButton": {
                    "url": "https://app.example.com/billing"
                  }
                },
                "idempotencyKey": "payment-failed-invoice-123"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/billing/payment-succeeded": {
      "post": {
        "operationId": "sendPaymentSucceeded",
        "tags": [
          "Billing"
        ],
        "summary": "Send payment-succeeded",
        "description": "Send the EmailsDone payment-succeeded template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Payment succeeded data for the payment-succeeded template. Sent when a payment succeeds. Generated from template version v1.",
                    "x-emailsdone-template-name": "Payment succeeded",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View receipt",
                        "example": "View receipt"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Payment received",
                        "example": "Payment received"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your payment was successful.",
                        "example": "Your payment was successful."
                      },
                      {
                        "name": "paymentDetails",
                        "label": "Payment details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "amount": "Amount",
                          "paidAt": "Paid At",
                          "paymentMethod": "Payment Method",
                          "reference": "Reference"
                        },
                        "detailsTable": {
                          "binding": "paymentDetails",
                          "heading": "Payment details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "amount",
                              "label": "Amount",
                              "format": "currency"
                            },
                            {
                              "key": "paidAt",
                              "label": "Paid",
                              "format": "datetime"
                            },
                            {
                              "key": "paymentMethod",
                              "label": "Payment method",
                              "format": null
                            },
                            {
                              "key": "reference",
                              "label": "Reference",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Your payment was successful.",
                        "example": "Your payment was successful."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Payment received",
                        "example": "Payment received"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View receipt",
                            "examples": [
                              "View receipt"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Payment received",
                        "examples": [
                          "Payment received"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Your payment was successful.",
                        "examples": [
                          "Your payment was successful."
                        ],
                        "maxLength": 1000
                      },
                      "paymentDetails": {
                        "type": "object",
                        "description": "Payment details",
                        "additionalProperties": false,
                        "properties": {
                          "amount": {
                            "type": "string",
                            "description": "Amount"
                          },
                          "paidAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Paid"
                          },
                          "paymentMethod": {
                            "type": "string",
                            "description": "Payment method"
                          },
                          "reference": {
                            "type": "string",
                            "description": "Reference"
                          }
                        },
                        "examples": [
                          {
                            "amount": "Amount",
                            "paidAt": "Paid At",
                            "paymentMethod": "Payment Method",
                            "reference": "Reference"
                          }
                        ]
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Your payment was successful.",
                        "examples": [
                          "Your payment was successful."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Payment received",
                        "examples": [
                          "Payment received"
                        ],
                        "maxLength": 180
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/billing/refund-issued": {
      "post": {
        "operationId": "sendRefundIssued",
        "tags": [
          "Billing"
        ],
        "summary": "Send refund-issued",
        "description": "Send the EmailsDone refund-issued template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Refund issued data for the refund-issued template. Sent when a refund is issued. Generated from template version v1.",
                    "x-emailsdone-template-name": "Refund issued",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "footerNote",
                        "label": "Footer Note",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Refund timing may depend on the payment method used.",
                        "example": "Refund timing may depend on the payment method used."
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Refund issued",
                        "example": "Refund issued"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "A refund has been issued.",
                        "example": "A refund has been issued."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "A refund has been issued.",
                        "example": "A refund has been issued."
                      },
                      {
                        "name": "refundDetails",
                        "label": "Refund details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "amount": "Amount",
                          "issuedAt": "Issued At",
                          "paymentMethod": "Payment Method",
                          "reference": "Reference"
                        },
                        "detailsTable": {
                          "binding": "refundDetails",
                          "heading": "Refund details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "amount",
                              "label": "Amount",
                              "format": "currency"
                            },
                            {
                              "key": "issuedAt",
                              "label": "Issued",
                              "format": "date"
                            },
                            {
                              "key": "paymentMethod",
                              "label": "Payment method",
                              "format": null
                            },
                            {
                              "key": "reference",
                              "label": "Reference",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Refund issued",
                        "example": "Refund issued"
                      }
                    ],
                    "properties": {
                      "footerNote": {
                        "type": "string",
                        "description": "Footer Note",
                        "default": "Refund timing may depend on the payment method used.",
                        "examples": [
                          "Refund timing may depend on the payment method used."
                        ],
                        "maxLength": 1000
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Refund issued",
                        "examples": [
                          "Refund issued"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "A refund has been issued.",
                        "examples": [
                          "A refund has been issued."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "A refund has been issued.",
                        "examples": [
                          "A refund has been issued."
                        ],
                        "maxLength": 220
                      },
                      "refundDetails": {
                        "type": "object",
                        "description": "Refund details",
                        "additionalProperties": false,
                        "properties": {
                          "amount": {
                            "type": "string",
                            "description": "Amount"
                          },
                          "issuedAt": {
                            "type": "string",
                            "format": "date",
                            "description": "Issued"
                          },
                          "paymentMethod": {
                            "type": "string",
                            "description": "Payment method"
                          },
                          "reference": {
                            "type": "string",
                            "description": "Reference"
                          }
                        },
                        "examples": [
                          {
                            "amount": "Amount",
                            "issuedAt": "Issued At",
                            "paymentMethod": "Payment Method",
                            "reference": "Reference"
                          }
                        ]
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Refund issued",
                        "examples": [
                          "Refund issued"
                        ],
                        "maxLength": 180
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/billing/subscription-cancelled": {
      "post": {
        "operationId": "sendSubscriptionCancelled",
        "tags": [
          "Billing"
        ],
        "summary": "Send subscription-cancelled",
        "description": "Send the EmailsDone subscription-cancelled template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Subscription cancelled data for the subscription-cancelled template. Sent when a subscription is cancelled. Generated from template version v1.",
                    "x-emailsdone-template-name": "Subscription cancelled",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Manage subscription",
                        "example": "Manage subscription"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Subscription cancelled",
                        "example": "Subscription cancelled"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your subscription has been cancelled.",
                        "example": "Your subscription has been cancelled."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Your subscription has been cancelled.",
                        "example": "Your subscription has been cancelled."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Subscription cancelled",
                        "example": "Subscription cancelled"
                      },
                      {
                        "name": "subscriptionDetails",
                        "label": "Subscription details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "cancelledAt": "Cancelled At",
                          "accessEndsAt": "Access Ends At",
                          "plan": "Plan"
                        },
                        "detailsTable": {
                          "binding": "subscriptionDetails",
                          "heading": "Subscription details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "cancelledAt",
                              "label": "Cancelled",
                              "format": "date"
                            },
                            {
                              "key": "accessEndsAt",
                              "label": "Access ends",
                              "format": "date"
                            },
                            {
                              "key": "plan",
                              "label": "Plan",
                              "format": null
                            }
                          ]
                        }
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Manage subscription",
                            "examples": [
                              "Manage subscription"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Subscription cancelled",
                        "examples": [
                          "Subscription cancelled"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Your subscription has been cancelled.",
                        "examples": [
                          "Your subscription has been cancelled."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Your subscription has been cancelled.",
                        "examples": [
                          "Your subscription has been cancelled."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Subscription cancelled",
                        "examples": [
                          "Subscription cancelled"
                        ],
                        "maxLength": 180
                      },
                      "subscriptionDetails": {
                        "type": "object",
                        "description": "Subscription details",
                        "additionalProperties": false,
                        "properties": {
                          "accessEndsAt": {
                            "type": "string",
                            "format": "date",
                            "description": "Access ends"
                          },
                          "cancelledAt": {
                            "type": "string",
                            "format": "date",
                            "description": "Cancelled"
                          },
                          "plan": {
                            "type": "string",
                            "description": "Plan"
                          }
                        },
                        "examples": [
                          {
                            "cancelledAt": "Cancelled At",
                            "accessEndsAt": "Access Ends At",
                            "plan": "Plan"
                          }
                        ]
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/billing/subscription-paused": {
      "post": {
        "operationId": "sendSubscriptionPaused",
        "tags": [
          "Billing"
        ],
        "summary": "Send subscription-paused",
        "description": "Send the EmailsDone subscription-paused template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Subscription paused data for the subscription-paused template. Sent when a subscription is paused. Generated from template version v1.",
                    "x-emailsdone-template-name": "Subscription paused",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Manage subscription",
                        "example": "Manage subscription"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Subscription paused",
                        "example": "Subscription paused"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your subscription has been paused.",
                        "example": "Your subscription has been paused."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Your subscription has been paused.",
                        "example": "Your subscription has been paused."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Subscription paused",
                        "example": "Subscription paused"
                      },
                      {
                        "name": "subscriptionDetails",
                        "label": "Subscription details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "pausedAt": "Paused At",
                          "resumesAt": "Resumes At",
                          "plan": "Plan"
                        },
                        "detailsTable": {
                          "binding": "subscriptionDetails",
                          "heading": "Subscription details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "pausedAt",
                              "label": "Paused",
                              "format": "date"
                            },
                            {
                              "key": "resumesAt",
                              "label": "Resumes",
                              "format": "date"
                            },
                            {
                              "key": "plan",
                              "label": "Plan",
                              "format": null
                            }
                          ]
                        }
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Manage subscription",
                            "examples": [
                              "Manage subscription"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Subscription paused",
                        "examples": [
                          "Subscription paused"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Your subscription has been paused.",
                        "examples": [
                          "Your subscription has been paused."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Your subscription has been paused.",
                        "examples": [
                          "Your subscription has been paused."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Subscription paused",
                        "examples": [
                          "Subscription paused"
                        ],
                        "maxLength": 180
                      },
                      "subscriptionDetails": {
                        "type": "object",
                        "description": "Subscription details",
                        "additionalProperties": false,
                        "properties": {
                          "pausedAt": {
                            "type": "string",
                            "format": "date",
                            "description": "Paused"
                          },
                          "plan": {
                            "type": "string",
                            "description": "Plan"
                          },
                          "resumesAt": {
                            "type": "string",
                            "format": "date",
                            "description": "Resumes"
                          }
                        },
                        "examples": [
                          {
                            "pausedAt": "Paused At",
                            "resumesAt": "Resumes At",
                            "plan": "Plan"
                          }
                        ]
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/billing/subscription-renewed": {
      "post": {
        "operationId": "sendSubscriptionRenewed",
        "tags": [
          "Billing"
        ],
        "summary": "Send subscription-renewed",
        "description": "Send the EmailsDone subscription-renewed template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Subscription renewed data for the subscription-renewed template. Sent when a subscription renews. Generated from template version v1.",
                    "x-emailsdone-template-name": "Subscription renewed",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View details",
                        "example": "View details"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Subscription renewed",
                        "example": "Subscription renewed"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your subscription has renewed.",
                        "example": "Your subscription has renewed."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Your subscription has renewed.",
                        "example": "Your subscription has renewed."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Subscription renewed",
                        "example": "Subscription renewed"
                      },
                      {
                        "name": "subscriptionDetails",
                        "label": "Subscription details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "plan": "Plan",
                          "renewedAt": "Renewed At",
                          "nextRenewalAt": "Next Renewal At",
                          "amount": "Amount"
                        },
                        "detailsTable": {
                          "binding": "subscriptionDetails",
                          "heading": "Subscription details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "plan",
                              "label": "Plan",
                              "format": null
                            },
                            {
                              "key": "renewedAt",
                              "label": "Renewed",
                              "format": "date"
                            },
                            {
                              "key": "nextRenewalAt",
                              "label": "Next renewal",
                              "format": "date"
                            },
                            {
                              "key": "amount",
                              "label": "Amount",
                              "format": "currency"
                            }
                          ]
                        }
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View details",
                            "examples": [
                              "View details"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Subscription renewed",
                        "examples": [
                          "Subscription renewed"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Your subscription has renewed.",
                        "examples": [
                          "Your subscription has renewed."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Your subscription has renewed.",
                        "examples": [
                          "Your subscription has renewed."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Subscription renewed",
                        "examples": [
                          "Subscription renewed"
                        ],
                        "maxLength": 180
                      },
                      "subscriptionDetails": {
                        "type": "object",
                        "description": "Subscription details",
                        "additionalProperties": false,
                        "properties": {
                          "amount": {
                            "type": "string",
                            "description": "Amount"
                          },
                          "nextRenewalAt": {
                            "type": "string",
                            "format": "date",
                            "description": "Next renewal"
                          },
                          "plan": {
                            "type": "string",
                            "description": "Plan"
                          },
                          "renewedAt": {
                            "type": "string",
                            "format": "date",
                            "description": "Renewed"
                          }
                        },
                        "examples": [
                          {
                            "plan": "Plan",
                            "renewedAt": "Renewed At",
                            "nextRenewalAt": "Next Renewal At",
                            "amount": "Amount"
                          }
                        ]
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/billing/subscription-started": {
      "post": {
        "operationId": "sendSubscriptionStarted",
        "tags": [
          "Billing"
        ],
        "summary": "Send subscription-started",
        "description": "Send the EmailsDone subscription-started template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Subscription started data for the subscription-started template. Sent when a subscription starts. Generated from template version v1.",
                    "x-emailsdone-template-name": "Subscription started",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Manage subscription",
                        "example": "Manage subscription"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Subscription started",
                        "example": "Subscription started"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your subscription is active.",
                        "example": "Your subscription is active."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Your subscription is active.",
                        "example": "Your subscription is active."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Subscription started",
                        "example": "Subscription started"
                      },
                      {
                        "name": "subscriptionDetails",
                        "label": "Subscription details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "plan": "Plan",
                          "startedAt": "Started At",
                          "renewsAt": "Renews At",
                          "amount": "Amount"
                        },
                        "detailsTable": {
                          "binding": "subscriptionDetails",
                          "heading": "Subscription details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "plan",
                              "label": "Plan",
                              "format": null
                            },
                            {
                              "key": "startedAt",
                              "label": "Started",
                              "format": "date"
                            },
                            {
                              "key": "renewsAt",
                              "label": "Renews",
                              "format": "date"
                            },
                            {
                              "key": "amount",
                              "label": "Amount",
                              "format": "currency"
                            }
                          ]
                        }
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Manage subscription",
                            "examples": [
                              "Manage subscription"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Subscription started",
                        "examples": [
                          "Subscription started"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Your subscription is active.",
                        "examples": [
                          "Your subscription is active."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Your subscription is active.",
                        "examples": [
                          "Your subscription is active."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Subscription started",
                        "examples": [
                          "Subscription started"
                        ],
                        "maxLength": 180
                      },
                      "subscriptionDetails": {
                        "type": "object",
                        "description": "Subscription details",
                        "additionalProperties": false,
                        "properties": {
                          "amount": {
                            "type": "string",
                            "description": "Amount"
                          },
                          "plan": {
                            "type": "string",
                            "description": "Plan"
                          },
                          "renewsAt": {
                            "type": "string",
                            "format": "date",
                            "description": "Renews"
                          },
                          "startedAt": {
                            "type": "string",
                            "format": "date",
                            "description": "Started"
                          }
                        },
                        "examples": [
                          {
                            "plan": "Plan",
                            "startedAt": "Started At",
                            "renewsAt": "Renews At",
                            "amount": "Amount"
                          }
                        ]
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/billing/trial-ending": {
      "post": {
        "operationId": "sendTrialEnding",
        "tags": [
          "Billing"
        ],
        "summary": "Send trial-ending",
        "description": "Send the EmailsDone trial-ending template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Trial ending data for the trial-ending template. Sent before a trial ends. Generated from template version v1.",
                    "x-emailsdone-template-name": "Trial ending",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": true,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "trialEndDate",
                        "label": "Trial End Date",
                        "type": "text",
                        "required": true,
                        "description": "",
                        "maxLength": 1000,
                        "example": "June 15, 2026"
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Upgrade",
                        "example": "Upgrade"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Your trial is ending soon",
                        "example": "Your trial is ending soon"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your trial ends on {{trialEndDate}}.",
                        "example": "Your trial ends on Trial End Date."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Upgrade to continue after your trial ends.",
                        "example": "Upgrade to continue after your trial ends."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Your trial is ending soon",
                        "example": "Your trial is ending soon"
                      },
                      {
                        "name": "upgradeNote",
                        "label": "Upgrade Note",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Upgrade before your trial ends to continue.",
                        "example": "Upgrade before your trial ends to continue."
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Upgrade",
                            "examples": [
                              "Upgrade"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        },
                        "required": [
                          "url"
                        ]
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Your trial is ending soon",
                        "examples": [
                          "Your trial is ending soon"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Your trial ends on {{trialEndDate}}.",
                        "examples": [
                          "Your trial ends on Trial End Date."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Upgrade to continue after your trial ends.",
                        "examples": [
                          "Upgrade to continue after your trial ends."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Your trial is ending soon",
                        "examples": [
                          "Your trial is ending soon"
                        ],
                        "maxLength": 180
                      },
                      "trialEndDate": {
                        "type": "string",
                        "description": "Trial End Date",
                        "examples": [
                          "June 15, 2026"
                        ],
                        "maxLength": 1000
                      },
                      "upgradeNote": {
                        "type": "string",
                        "description": "Upgrade Note",
                        "default": "Upgrade before your trial ends to continue.",
                        "examples": [
                          "Upgrade before your trial ends to continue."
                        ],
                        "maxLength": 1000
                      }
                    },
                    "required": [
                      "actionButton",
                      "trialEndDate"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/billing/trial-started": {
      "post": {
        "operationId": "sendTrialStarted",
        "tags": [
          "Billing"
        ],
        "summary": "Send trial-started",
        "description": "Send the EmailsDone trial-started template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Trial started data for the trial-started template. Sent when a trial starts. Generated from template version v1.",
                    "x-emailsdone-template-name": "Trial started",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Get started",
                        "example": "Get started"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Your trial has started",
                        "example": "Your trial has started"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your trial is ready to use.",
                        "example": "Your trial is ready to use."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Your trial is ready to use.",
                        "example": "Your trial is ready to use."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Your trial has started",
                        "example": "Your trial has started"
                      },
                      {
                        "name": "trialDetails",
                        "label": "Trial details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "startedAt": "Started At",
                          "endsAt": "Ends At",
                          "plan": "Plan"
                        },
                        "detailsTable": {
                          "binding": "trialDetails",
                          "heading": "Trial details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "startedAt",
                              "label": "Started",
                              "format": "date"
                            },
                            {
                              "key": "endsAt",
                              "label": "Ends",
                              "format": "date"
                            },
                            {
                              "key": "plan",
                              "label": "Plan",
                              "format": null
                            }
                          ]
                        }
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Get started",
                            "examples": [
                              "Get started"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Your trial has started",
                        "examples": [
                          "Your trial has started"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Your trial is ready to use.",
                        "examples": [
                          "Your trial is ready to use."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Your trial is ready to use.",
                        "examples": [
                          "Your trial is ready to use."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Your trial has started",
                        "examples": [
                          "Your trial has started"
                        ],
                        "maxLength": 180
                      },
                      "trialDetails": {
                        "type": "object",
                        "description": "Trial details",
                        "additionalProperties": false,
                        "properties": {
                          "endsAt": {
                            "type": "string",
                            "format": "date",
                            "description": "Ends"
                          },
                          "plan": {
                            "type": "string",
                            "description": "Plan"
                          },
                          "startedAt": {
                            "type": "string",
                            "format": "date",
                            "description": "Started"
                          }
                        },
                        "examples": [
                          {
                            "startedAt": "Started At",
                            "endsAt": "Ends At",
                            "plan": "Plan"
                          }
                        ]
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/billing/usage-threshold": {
      "post": {
        "operationId": "sendUsageThreshold",
        "tags": [
          "Billing"
        ],
        "summary": "Send usage-threshold",
        "description": "Send the EmailsDone usage-threshold template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Usage threshold data for the usage-threshold template. Sent when usage reaches a configured threshold. Generated from template version v1.",
                    "x-emailsdone-template-name": "Usage threshold",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "message",
                        "label": "Message",
                        "type": "text",
                        "required": true,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your usage has reached a configured threshold.",
                        "example": "Your usage has reached a configured threshold."
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View usage",
                        "example": "View usage"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Usage threshold reached",
                        "example": "Usage threshold reached"
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Your usage has reached a configured threshold.",
                        "example": "Your usage has reached a configured threshold."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Usage threshold reached",
                        "example": "Usage threshold reached"
                      },
                      {
                        "name": "usageDetails",
                        "label": "Usage details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "used": "Used",
                          "limit": "Limit",
                          "percentage": "Percentage",
                          "periodEndsAt": "Period Ends At"
                        },
                        "detailsTable": {
                          "binding": "usageDetails",
                          "heading": "Usage details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "used",
                              "label": "Used",
                              "format": "number"
                            },
                            {
                              "key": "limit",
                              "label": "Limit",
                              "format": "number"
                            },
                            {
                              "key": "percentage",
                              "label": "Usage",
                              "format": "number"
                            },
                            {
                              "key": "periodEndsAt",
                              "label": "Period ends",
                              "format": "date"
                            }
                          ]
                        }
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View usage",
                            "examples": [
                              "View usage"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Usage threshold reached",
                        "examples": [
                          "Usage threshold reached"
                        ],
                        "maxLength": 180
                      },
                      "message": {
                        "type": "string",
                        "description": "Message",
                        "default": "Your usage has reached a configured threshold.",
                        "examples": [
                          "Your usage has reached a configured threshold."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Your usage has reached a configured threshold.",
                        "examples": [
                          "Your usage has reached a configured threshold."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Usage threshold reached",
                        "examples": [
                          "Usage threshold reached"
                        ],
                        "maxLength": 180
                      },
                      "usageDetails": {
                        "type": "object",
                        "description": "Usage details",
                        "additionalProperties": false,
                        "properties": {
                          "limit": {
                            "type": "number",
                            "description": "Limit"
                          },
                          "percentage": {
                            "type": "number",
                            "description": "Usage"
                          },
                          "periodEndsAt": {
                            "type": "string",
                            "format": "date",
                            "description": "Period ends"
                          },
                          "used": {
                            "type": "number",
                            "description": "Used"
                          }
                        },
                        "examples": [
                          {
                            "used": "Used",
                            "limit": "Limit",
                            "percentage": "Percentage",
                            "periodEndsAt": "Period Ends At"
                          }
                        ]
                      }
                    },
                    "required": [
                      "message"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/developer/api-key-created": {
      "post": {
        "operationId": "sendApiKeyCreated",
        "tags": [
          "Developer"
        ],
        "summary": "Send api-key-created",
        "description": "Send the EmailsDone api-key-created template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "API key created data for the api-key-created template. Sent when an API key is created. Generated from template version v1.",
                    "x-emailsdone-template-name": "API key created",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Manage API keys",
                        "example": "Manage API keys"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "apiKeyDetails",
                        "label": "API key details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "name": "Name",
                          "createdAt": "Created At",
                          "environment": "Environment",
                          "createdBy": "Created By"
                        },
                        "detailsTable": {
                          "binding": "apiKeyDetails",
                          "heading": "API key details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "name",
                              "label": "Name",
                              "format": null
                            },
                            {
                              "key": "createdAt",
                              "label": "Created",
                              "format": "datetime"
                            },
                            {
                              "key": "environment",
                              "label": "Environment",
                              "format": null
                            },
                            {
                              "key": "createdBy",
                              "label": "Created by",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "API key created",
                        "example": "API key created"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "A new API key has been created.",
                        "example": "A new API key has been created."
                      },
                      {
                        "name": "notice",
                        "label": "Notice",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Keep API keys secure and do not share them publicly.",
                        "example": "Keep API keys secure and do not share them publicly."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "A new API key has been created.",
                        "example": "A new API key has been created."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "API key created",
                        "example": "API key created"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Manage API keys",
                            "examples": [
                              "Manage API keys"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "apiKeyDetails": {
                        "type": "object",
                        "description": "API key details",
                        "additionalProperties": false,
                        "properties": {
                          "createdAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Created"
                          },
                          "createdBy": {
                            "type": "string",
                            "description": "Created by"
                          },
                          "environment": {
                            "type": "string",
                            "description": "Environment"
                          },
                          "name": {
                            "type": "string",
                            "description": "Name"
                          }
                        },
                        "examples": [
                          {
                            "name": "Name",
                            "createdAt": "Created At",
                            "environment": "Environment",
                            "createdBy": "Created By"
                          }
                        ]
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "API key created",
                        "examples": [
                          "API key created"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "A new API key has been created.",
                        "examples": [
                          "A new API key has been created."
                        ],
                        "maxLength": 1000
                      },
                      "notice": {
                        "type": "string",
                        "description": "Notice",
                        "default": "Keep API keys secure and do not share them publicly.",
                        "examples": [
                          "Keep API keys secure and do not share them publicly."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "A new API key has been created.",
                        "examples": [
                          "A new API key has been created."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "API key created",
                        "examples": [
                          "API key created"
                        ],
                        "maxLength": 180
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/developer/api-key-rotated": {
      "post": {
        "operationId": "sendApiKeyRotated",
        "tags": [
          "Developer"
        ],
        "summary": "Send api-key-rotated",
        "description": "Send the EmailsDone api-key-rotated template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "API key rotated data for the api-key-rotated template. Sent when an API key is rotated. Generated from template version v1.",
                    "x-emailsdone-template-name": "API key rotated",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Manage API keys",
                        "example": "Manage API keys"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "apiKeyDetails",
                        "label": "API key details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "name": "Name",
                          "rotatedAt": "Rotated At",
                          "environment": "Environment",
                          "rotatedBy": "Rotated By"
                        },
                        "detailsTable": {
                          "binding": "apiKeyDetails",
                          "heading": "API key details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "name",
                              "label": "Name",
                              "format": null
                            },
                            {
                              "key": "rotatedAt",
                              "label": "Rotated",
                              "format": "datetime"
                            },
                            {
                              "key": "environment",
                              "label": "Environment",
                              "format": null
                            },
                            {
                              "key": "rotatedBy",
                              "label": "Rotated by",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "API key rotated",
                        "example": "API key rotated"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "An API key has been rotated.",
                        "example": "An API key has been rotated."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "An API key has been rotated.",
                        "example": "An API key has been rotated."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "API key rotated",
                        "example": "API key rotated"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Manage API keys",
                            "examples": [
                              "Manage API keys"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "apiKeyDetails": {
                        "type": "object",
                        "description": "API key details",
                        "additionalProperties": false,
                        "properties": {
                          "environment": {
                            "type": "string",
                            "description": "Environment"
                          },
                          "name": {
                            "type": "string",
                            "description": "Name"
                          },
                          "rotatedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Rotated"
                          },
                          "rotatedBy": {
                            "type": "string",
                            "description": "Rotated by"
                          }
                        },
                        "examples": [
                          {
                            "name": "Name",
                            "rotatedAt": "Rotated At",
                            "environment": "Environment",
                            "rotatedBy": "Rotated By"
                          }
                        ]
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "API key rotated",
                        "examples": [
                          "API key rotated"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "An API key has been rotated.",
                        "examples": [
                          "An API key has been rotated."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "An API key has been rotated.",
                        "examples": [
                          "An API key has been rotated."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "API key rotated",
                        "examples": [
                          "API key rotated"
                        ],
                        "maxLength": 180
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/developer/credits-exhausted": {
      "post": {
        "operationId": "sendCreditsExhausted",
        "tags": [
          "Developer"
        ],
        "summary": "Send credits-exhausted",
        "description": "Send the EmailsDone credits-exhausted template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Credits exhausted data for the credits-exhausted template. Sent when available credits are exhausted. Generated from template version v1.",
                    "x-emailsdone-template-name": "Credits exhausted",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": true,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Add credits",
                        "example": "Add credits"
                      },
                      {
                        "name": "creditDetails",
                        "label": "Credit details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "remaining": "Remaining",
                          "used": "Used",
                          "periodEndsAt": "Period Ends At"
                        },
                        "detailsTable": {
                          "binding": "creditDetails",
                          "heading": "Credit details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "remaining",
                              "label": "Remaining",
                              "format": "number"
                            },
                            {
                              "key": "used",
                              "label": "Used",
                              "format": "number"
                            },
                            {
                              "key": "periodEndsAt",
                              "label": "Period ends",
                              "format": "date"
                            }
                          ]
                        }
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Credits exhausted",
                        "example": "Credits exhausted"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your available credits have been used.",
                        "example": "Your available credits have been used."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Add credits to continue.",
                        "example": "Add credits to continue."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Credits exhausted",
                        "example": "Credits exhausted"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Add credits",
                            "examples": [
                              "Add credits"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        },
                        "required": [
                          "url"
                        ]
                      },
                      "creditDetails": {
                        "type": "object",
                        "description": "Credit details",
                        "additionalProperties": false,
                        "properties": {
                          "periodEndsAt": {
                            "type": "string",
                            "format": "date",
                            "description": "Period ends"
                          },
                          "remaining": {
                            "type": "number",
                            "description": "Remaining"
                          },
                          "used": {
                            "type": "number",
                            "description": "Used"
                          }
                        },
                        "examples": [
                          {
                            "remaining": "Remaining",
                            "used": "Used",
                            "periodEndsAt": "Period Ends At"
                          }
                        ]
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Credits exhausted",
                        "examples": [
                          "Credits exhausted"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Your available credits have been used.",
                        "examples": [
                          "Your available credits have been used."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Add credits to continue.",
                        "examples": [
                          "Add credits to continue."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Credits exhausted",
                        "examples": [
                          "Credits exhausted"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "actionButton"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/developer/credits-low": {
      "post": {
        "operationId": "sendCreditsLow",
        "tags": [
          "Developer"
        ],
        "summary": "Send credits-low",
        "description": "Send the EmailsDone credits-low template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Credits low data for the credits-low template. Sent when available credits are running low. Generated from template version v1.",
                    "x-emailsdone-template-name": "Credits low",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Add credits",
                        "example": "Add credits"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "creditDetails",
                        "label": "Credit details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "remaining": "Remaining",
                          "threshold": "Threshold",
                          "periodEndsAt": "Period Ends At"
                        },
                        "detailsTable": {
                          "binding": "creditDetails",
                          "heading": "Credit details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "remaining",
                              "label": "Remaining",
                              "format": "number"
                            },
                            {
                              "key": "threshold",
                              "label": "Threshold",
                              "format": "number"
                            },
                            {
                              "key": "periodEndsAt",
                              "label": "Period ends",
                              "format": "date"
                            }
                          ]
                        }
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Credits are running low",
                        "example": "Credits are running low"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your available credits are running low.",
                        "example": "Your available credits are running low."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Add credits to continue without interruption.",
                        "example": "Add credits to continue without interruption."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Credits are running low",
                        "example": "Credits are running low"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Add credits",
                            "examples": [
                              "Add credits"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "creditDetails": {
                        "type": "object",
                        "description": "Credit details",
                        "additionalProperties": false,
                        "properties": {
                          "periodEndsAt": {
                            "type": "string",
                            "format": "date",
                            "description": "Period ends"
                          },
                          "remaining": {
                            "type": "number",
                            "description": "Remaining"
                          },
                          "threshold": {
                            "type": "number",
                            "description": "Threshold"
                          }
                        },
                        "examples": [
                          {
                            "remaining": "Remaining",
                            "threshold": "Threshold",
                            "periodEndsAt": "Period Ends At"
                          }
                        ]
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Credits are running low",
                        "examples": [
                          "Credits are running low"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Your available credits are running low.",
                        "examples": [
                          "Your available credits are running low."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Add credits to continue without interruption.",
                        "examples": [
                          "Add credits to continue without interruption."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Credits are running low",
                        "examples": [
                          "Credits are running low"
                        ],
                        "maxLength": 180
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/announcement": {
      "post": {
        "operationId": "sendAnnouncement",
        "tags": [
          "Notifications"
        ],
        "summary": "Send announcement",
        "description": "Send the EmailsDone announcement template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Announcement data for the announcement template. Sent for a short product or account announcement. Generated from template version v1.",
                    "x-emailsdone-template-name": "Announcement",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "message",
                        "label": "Message",
                        "type": "text",
                        "required": true,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "",
                        "example": "There is an update in your account."
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Learn more",
                        "example": "Learn more"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Announcement",
                        "example": "Announcement"
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "{{message}}",
                        "example": "Message"
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Announcement",
                        "example": "Announcement"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Learn more",
                            "examples": [
                              "Learn more"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Announcement",
                        "examples": [
                          "Announcement"
                        ],
                        "maxLength": 180
                      },
                      "message": {
                        "type": "string",
                        "description": "Message",
                        "default": "",
                        "examples": [
                          "There is an update in your account."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "{{message}}",
                        "examples": [
                          "Message"
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Announcement",
                        "examples": [
                          "Announcement"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "message"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/approval-approved": {
      "post": {
        "operationId": "sendApprovalApproved",
        "tags": [
          "Notifications"
        ],
        "summary": "Send approval-approved",
        "description": "Send the EmailsDone approval-approved template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Approval approved data for the approval-approved template. Sent when an approval request is approved. Generated from template version v1.",
                    "x-emailsdone-template-name": "Approval approved",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "message",
                        "label": "Message",
                        "type": "text",
                        "required": true,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "{{message}}",
                        "example": "There is an update in your account."
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View",
                        "example": "View"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "approvalDetails",
                        "label": "Approval details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "item": "Item",
                          "approvedBy": "Approved By",
                          "approvedAt": "Approved At"
                        },
                        "detailsTable": {
                          "binding": "approvalDetails",
                          "heading": "Approval details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "item",
                              "label": "Item",
                              "format": null
                            },
                            {
                              "key": "approvedBy",
                              "label": "Approved by",
                              "format": null
                            },
                            {
                              "key": "approvedAt",
                              "label": "Approved",
                              "format": "datetime"
                            }
                          ]
                        }
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Approved",
                        "example": "Approved"
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "{{message}}",
                        "example": "Message"
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Approved",
                        "example": "Approved"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View",
                            "examples": [
                              "View"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "approvalDetails": {
                        "type": "object",
                        "description": "Approval details",
                        "additionalProperties": false,
                        "properties": {
                          "approvedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Approved"
                          },
                          "approvedBy": {
                            "type": "string",
                            "description": "Approved by"
                          },
                          "item": {
                            "type": "string",
                            "description": "Item"
                          }
                        },
                        "examples": [
                          {
                            "item": "Item",
                            "approvedBy": "Approved By",
                            "approvedAt": "Approved At"
                          }
                        ]
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Approved",
                        "examples": [
                          "Approved"
                        ],
                        "maxLength": 180
                      },
                      "message": {
                        "type": "string",
                        "description": "Message",
                        "default": "{{message}}",
                        "examples": [
                          "There is an update in your account."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "{{message}}",
                        "examples": [
                          "Message"
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Approved",
                        "examples": [
                          "Approved"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "message"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/approval-needed": {
      "post": {
        "operationId": "sendApprovalNeeded",
        "tags": [
          "Notifications"
        ],
        "summary": "Send approval-needed",
        "description": "Send the EmailsDone approval-needed template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Approval needed data for the approval-needed template. Sent when an approval is needed. Generated from template version v1.",
                    "x-emailsdone-template-name": "Approval needed",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": true,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Review request",
                        "example": "Review request"
                      },
                      {
                        "name": "approvalDetails",
                        "label": "Approval details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "item": "Item",
                          "requestedBy": "Requested By",
                          "requestedAt": "Requested At"
                        },
                        "detailsTable": {
                          "binding": "approvalDetails",
                          "heading": "Approval details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "item",
                              "label": "Item",
                              "format": null
                            },
                            {
                              "key": "requestedBy",
                              "label": "Requested by",
                              "format": null
                            },
                            {
                              "key": "requestedAt",
                              "label": "Requested",
                              "format": "datetime"
                            }
                          ]
                        }
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Approval needed",
                        "example": "Approval needed"
                      },
                      {
                        "name": "message",
                        "label": "Message",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "An item is waiting for approval.",
                        "example": "An item is waiting for approval."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "An item is waiting for approval.",
                        "example": "An item is waiting for approval."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Approval needed",
                        "example": "Approval needed"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Review request",
                            "examples": [
                              "Review request"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        },
                        "required": [
                          "url"
                        ]
                      },
                      "approvalDetails": {
                        "type": "object",
                        "description": "Approval details",
                        "additionalProperties": false,
                        "properties": {
                          "item": {
                            "type": "string",
                            "description": "Item"
                          },
                          "requestedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Requested"
                          },
                          "requestedBy": {
                            "type": "string",
                            "description": "Requested by"
                          }
                        },
                        "examples": [
                          {
                            "item": "Item",
                            "requestedBy": "Requested By",
                            "requestedAt": "Requested At"
                          }
                        ]
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Approval needed",
                        "examples": [
                          "Approval needed"
                        ],
                        "maxLength": 180
                      },
                      "message": {
                        "type": "string",
                        "description": "Message",
                        "default": "An item is waiting for approval.",
                        "examples": [
                          "An item is waiting for approval."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "An item is waiting for approval.",
                        "examples": [
                          "An item is waiting for approval."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Approval needed",
                        "examples": [
                          "Approval needed"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "actionButton"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/approval-rejected": {
      "post": {
        "operationId": "sendApprovalRejected",
        "tags": [
          "Notifications"
        ],
        "summary": "Send approval-rejected",
        "description": "Send the EmailsDone approval-rejected template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Approval rejected data for the approval-rejected template. Sent when an approval request is rejected. Generated from template version v1.",
                    "x-emailsdone-template-name": "Approval rejected",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "message",
                        "label": "Message",
                        "type": "text",
                        "required": true,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "{{message}}",
                        "example": "There is an update in your account."
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View",
                        "example": "View"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "approvalDetails",
                        "label": "Approval details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "item": "Item",
                          "reviewedBy": "Reviewed By",
                          "reviewedAt": "Reviewed At",
                          "reason": "Reason"
                        },
                        "detailsTable": {
                          "binding": "approvalDetails",
                          "heading": "Approval details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "item",
                              "label": "Item",
                              "format": null
                            },
                            {
                              "key": "reviewedBy",
                              "label": "Reviewed by",
                              "format": null
                            },
                            {
                              "key": "reviewedAt",
                              "label": "Reviewed",
                              "format": "datetime"
                            },
                            {
                              "key": "reason",
                              "label": "Reason",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Not approved",
                        "example": "Not approved"
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "{{message}}",
                        "example": "Message"
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Not approved",
                        "example": "Not approved"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View",
                            "examples": [
                              "View"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "approvalDetails": {
                        "type": "object",
                        "description": "Approval details",
                        "additionalProperties": false,
                        "properties": {
                          "item": {
                            "type": "string",
                            "description": "Item"
                          },
                          "reason": {
                            "type": "string",
                            "description": "Reason"
                          },
                          "reviewedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Reviewed"
                          },
                          "reviewedBy": {
                            "type": "string",
                            "description": "Reviewed by"
                          }
                        },
                        "examples": [
                          {
                            "item": "Item",
                            "reviewedBy": "Reviewed By",
                            "reviewedAt": "Reviewed At",
                            "reason": "Reason"
                          }
                        ]
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Not approved",
                        "examples": [
                          "Not approved"
                        ],
                        "maxLength": 180
                      },
                      "message": {
                        "type": "string",
                        "description": "Message",
                        "default": "{{message}}",
                        "examples": [
                          "There is an update in your account."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "{{message}}",
                        "examples": [
                          "Message"
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Not approved",
                        "examples": [
                          "Not approved"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "message"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/digest": {
      "post": {
        "operationId": "sendDigest",
        "tags": [
          "Notifications"
        ],
        "summary": "Send digest",
        "description": "Send the EmailsDone digest template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Digest data for the digest template. Sent as a summary digest. Generated from template version v1.",
                    "x-emailsdone-template-name": "Digest",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View activity",
                        "example": "View activity"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Your digest",
                        "example": "Your digest"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Here is a summary of recent activity.",
                        "example": "Here is a summary of recent activity."
                      },
                      {
                        "name": "message",
                        "label": "Message",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "",
                        "example": ""
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "A summary of recent activity.",
                        "example": "A summary of recent activity."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Your digest",
                        "example": "Your digest"
                      },
                      {
                        "name": "summary",
                        "label": "Summary",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "newItems": "New Items",
                          "updates": "Updates",
                          "alerts": "Alerts"
                        },
                        "detailsTable": {
                          "binding": "summary",
                          "heading": "Summary",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "newItems",
                              "label": "New items",
                              "format": "number"
                            },
                            {
                              "key": "updates",
                              "label": "Updates",
                              "format": "number"
                            },
                            {
                              "key": "alerts",
                              "label": "Alerts",
                              "format": "number"
                            }
                          ]
                        }
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View activity",
                            "examples": [
                              "View activity"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Your digest",
                        "examples": [
                          "Your digest"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Here is a summary of recent activity.",
                        "examples": [
                          "Here is a summary of recent activity."
                        ],
                        "maxLength": 1000
                      },
                      "message": {
                        "type": "string",
                        "description": "Message",
                        "default": "",
                        "examples": [
                          ""
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "A summary of recent activity.",
                        "examples": [
                          "A summary of recent activity."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Your digest",
                        "examples": [
                          "Your digest"
                        ],
                        "maxLength": 180
                      },
                      "summary": {
                        "type": "object",
                        "description": "Summary",
                        "additionalProperties": false,
                        "properties": {
                          "alerts": {
                            "type": "number",
                            "description": "Alerts"
                          },
                          "newItems": {
                            "type": "number",
                            "description": "New items"
                          },
                          "updates": {
                            "type": "number",
                            "description": "Updates"
                          }
                        },
                        "examples": [
                          {
                            "newItems": "New Items",
                            "updates": "Updates",
                            "alerts": "Alerts"
                          }
                        ]
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/export-ready": {
      "post": {
        "operationId": "sendExportReady",
        "tags": [
          "Notifications"
        ],
        "summary": "Send export-ready",
        "description": "Send the EmailsDone export-ready template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Export ready data for the export-ready template. Sent when an export has completed. Generated from template version v1.",
                    "x-emailsdone-template-name": "Export ready",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": true,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/download"
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Download export",
                        "example": "Download export"
                      },
                      {
                        "name": "exportDetails",
                        "label": "Export details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "createdAt": "Created At",
                          "expiresAt": "Expires At",
                          "format": "Format",
                          "size": "Size"
                        },
                        "detailsTable": {
                          "binding": "exportDetails",
                          "heading": "Export details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "createdAt",
                              "label": "Created",
                              "format": "datetime"
                            },
                            {
                              "key": "expiresAt",
                              "label": "Expires",
                              "format": "datetime"
                            },
                            {
                              "key": "format",
                              "label": "Format",
                              "format": null
                            },
                            {
                              "key": "size",
                              "label": "Size",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Your export is ready",
                        "example": "Your export is ready"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "The export you requested is ready to download.",
                        "example": "The export you requested is ready to download."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Download your completed export.",
                        "example": "Download your completed export."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Your export is ready",
                        "example": "Your export is ready"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Download export",
                            "examples": [
                              "Download export"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/download"
                            ],
                            "maxLength": 2048
                          }
                        },
                        "required": [
                          "url"
                        ]
                      },
                      "exportDetails": {
                        "type": "object",
                        "description": "Export details",
                        "additionalProperties": false,
                        "properties": {
                          "createdAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Created"
                          },
                          "expiresAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Expires"
                          },
                          "format": {
                            "type": "string",
                            "description": "Format"
                          },
                          "size": {
                            "type": "string",
                            "description": "Size"
                          }
                        },
                        "examples": [
                          {
                            "createdAt": "Created At",
                            "expiresAt": "Expires At",
                            "format": "Format",
                            "size": "Size"
                          }
                        ]
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Your export is ready",
                        "examples": [
                          "Your export is ready"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "The export you requested is ready to download.",
                        "examples": [
                          "The export you requested is ready to download."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Download your completed export.",
                        "examples": [
                          "Download your completed export."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Your export is ready",
                        "examples": [
                          "Your export is ready"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "actionButton"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/generation-complete": {
      "post": {
        "operationId": "sendGenerationComplete",
        "tags": [
          "Notifications"
        ],
        "summary": "Send generation-complete",
        "description": "Send the EmailsDone generation-complete template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Generation complete data for the generation-complete template. Sent when generated content is ready. Generated from template version v1.",
                    "x-emailsdone-template-name": "Generation complete",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": true,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View result",
                        "example": "View result"
                      },
                      {
                        "name": "generationDetails",
                        "label": "Generation details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "completedAt": "Completed At",
                          "type": "Type",
                          "reference": "Reference"
                        },
                        "detailsTable": {
                          "binding": "generationDetails",
                          "heading": "Generation details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "completedAt",
                              "label": "Completed",
                              "format": "datetime"
                            },
                            {
                              "key": "type",
                              "label": "Type",
                              "format": null
                            },
                            {
                              "key": "reference",
                              "label": "Reference",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Generation complete",
                        "example": "Generation complete"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your generated result is ready.",
                        "example": "Your generated result is ready."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Your generated result is ready.",
                        "example": "Your generated result is ready."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Generation complete",
                        "example": "Generation complete"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View result",
                            "examples": [
                              "View result"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        },
                        "required": [
                          "url"
                        ]
                      },
                      "generationDetails": {
                        "type": "object",
                        "description": "Generation details",
                        "additionalProperties": false,
                        "properties": {
                          "completedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Completed"
                          },
                          "reference": {
                            "type": "string",
                            "description": "Reference"
                          },
                          "type": {
                            "type": "string",
                            "description": "Type"
                          }
                        },
                        "examples": [
                          {
                            "completedAt": "Completed At",
                            "type": "Type",
                            "reference": "Reference"
                          }
                        ]
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Generation complete",
                        "examples": [
                          "Generation complete"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Your generated result is ready.",
                        "examples": [
                          "Your generated result is ready."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Your generated result is ready.",
                        "examples": [
                          "Your generated result is ready."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Generation complete",
                        "examples": [
                          "Generation complete"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "actionButton"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/import-complete": {
      "post": {
        "operationId": "sendImportComplete",
        "tags": [
          "Notifications"
        ],
        "summary": "Send import-complete",
        "description": "Send the EmailsDone import-complete template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Import complete data for the import-complete template. Sent when an import completes. Generated from template version v1.",
                    "x-emailsdone-template-name": "Import complete",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View import",
                        "example": "View import"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Import complete",
                        "example": "Import complete"
                      },
                      {
                        "name": "importDetails",
                        "label": "Import details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "completedAt": "Completed At",
                          "recordsImported": "Records Imported",
                          "recordsSkipped": "Records Skipped",
                          "fileName": "File Name"
                        },
                        "detailsTable": {
                          "binding": "importDetails",
                          "heading": "Import details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "completedAt",
                              "label": "Completed",
                              "format": "datetime"
                            },
                            {
                              "key": "recordsImported",
                              "label": "Records imported",
                              "format": "number"
                            },
                            {
                              "key": "recordsSkipped",
                              "label": "Records skipped",
                              "format": "number"
                            },
                            {
                              "key": "fileName",
                              "label": "File",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "message",
                        "label": "Message",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your import has completed.",
                        "example": "Your import has completed."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Your import has completed.",
                        "example": "Your import has completed."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Import complete",
                        "example": "Import complete"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View import",
                            "examples": [
                              "View import"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Import complete",
                        "examples": [
                          "Import complete"
                        ],
                        "maxLength": 180
                      },
                      "importDetails": {
                        "type": "object",
                        "description": "Import details",
                        "additionalProperties": false,
                        "properties": {
                          "completedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Completed"
                          },
                          "fileName": {
                            "type": "string",
                            "description": "File"
                          },
                          "recordsImported": {
                            "type": "number",
                            "description": "Records imported"
                          },
                          "recordsSkipped": {
                            "type": "number",
                            "description": "Records skipped"
                          }
                        },
                        "examples": [
                          {
                            "completedAt": "Completed At",
                            "recordsImported": "Records Imported",
                            "recordsSkipped": "Records Skipped",
                            "fileName": "File Name"
                          }
                        ]
                      },
                      "message": {
                        "type": "string",
                        "description": "Message",
                        "default": "Your import has completed.",
                        "examples": [
                          "Your import has completed."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Your import has completed.",
                        "examples": [
                          "Your import has completed."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Import complete",
                        "examples": [
                          "Import complete"
                        ],
                        "maxLength": 180
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/job-complete": {
      "post": {
        "operationId": "sendJobComplete",
        "tags": [
          "Notifications"
        ],
        "summary": "Send job-complete",
        "description": "Send the EmailsDone job-complete template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Job complete data for the job-complete template. Sent when a background job completes. Generated from template version v1.",
                    "x-emailsdone-template-name": "Job complete",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View result",
                        "example": "View result"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Job complete",
                        "example": "Job complete"
                      },
                      {
                        "name": "jobDetails",
                        "label": "Job details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "jobName": "Job Name",
                          "completedAt": "Completed At",
                          "duration": "Duration",
                          "reference": "Reference"
                        },
                        "detailsTable": {
                          "binding": "jobDetails",
                          "heading": "Job details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "jobName",
                              "label": "Job",
                              "format": null
                            },
                            {
                              "key": "completedAt",
                              "label": "Completed",
                              "format": "datetime"
                            },
                            {
                              "key": "duration",
                              "label": "Duration",
                              "format": null
                            },
                            {
                              "key": "reference",
                              "label": "Reference",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "message",
                        "label": "Message",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your job has completed.",
                        "example": "Your job has completed."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Your job has completed.",
                        "example": "Your job has completed."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Job complete",
                        "example": "Job complete"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View result",
                            "examples": [
                              "View result"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Job complete",
                        "examples": [
                          "Job complete"
                        ],
                        "maxLength": 180
                      },
                      "jobDetails": {
                        "type": "object",
                        "description": "Job details",
                        "additionalProperties": false,
                        "properties": {
                          "completedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Completed"
                          },
                          "duration": {
                            "type": "string",
                            "description": "Duration"
                          },
                          "jobName": {
                            "type": "string",
                            "description": "Job"
                          },
                          "reference": {
                            "type": "string",
                            "description": "Reference"
                          }
                        },
                        "examples": [
                          {
                            "jobName": "Job Name",
                            "completedAt": "Completed At",
                            "duration": "Duration",
                            "reference": "Reference"
                          }
                        ]
                      },
                      "message": {
                        "type": "string",
                        "description": "Message",
                        "default": "Your job has completed.",
                        "examples": [
                          "Your job has completed."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Your job has completed.",
                        "examples": [
                          "Your job has completed."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Job complete",
                        "examples": [
                          "Job complete"
                        ],
                        "maxLength": 180
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/notification-alert": {
      "post": {
        "operationId": "sendNotificationAlert",
        "tags": [
          "Notifications"
        ],
        "summary": "Send notification-alert",
        "description": "Send the EmailsDone notification-alert template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Alert notification data for the notification-alert template. Sent for an important alert. Generated from template version v1.",
                    "x-emailsdone-template-name": "Alert notification",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "message",
                        "label": "Message",
                        "type": "text",
                        "required": true,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "{{message}}",
                        "example": "There is an update in your account."
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Review",
                        "example": "Review"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "alertDetails",
                        "label": "Alert details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "time": "Time",
                          "severity": "Severity",
                          "source": "Source"
                        },
                        "detailsTable": {
                          "binding": "alertDetails",
                          "heading": "Alert details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "time",
                              "label": "Time",
                              "format": "datetime"
                            },
                            {
                              "key": "severity",
                              "label": "Severity",
                              "format": null
                            },
                            {
                              "key": "source",
                              "label": "Source",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Important alert",
                        "example": "Important alert"
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "{{message}}",
                        "example": "Message"
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Important alert",
                        "example": "Important alert"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Review",
                            "examples": [
                              "Review"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "alertDetails": {
                        "type": "object",
                        "description": "Alert details",
                        "additionalProperties": false,
                        "properties": {
                          "severity": {
                            "type": "string",
                            "description": "Severity"
                          },
                          "source": {
                            "type": "string",
                            "description": "Source"
                          },
                          "time": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Time"
                          }
                        },
                        "examples": [
                          {
                            "time": "Time",
                            "severity": "Severity",
                            "source": "Source"
                          }
                        ]
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Important alert",
                        "examples": [
                          "Important alert"
                        ],
                        "maxLength": 180
                      },
                      "message": {
                        "type": "string",
                        "description": "Message",
                        "default": "{{message}}",
                        "examples": [
                          "There is an update in your account."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "{{message}}",
                        "examples": [
                          "Message"
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Important alert",
                        "examples": [
                          "Important alert"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "message"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/notification-info": {
      "post": {
        "operationId": "sendNotificationInfo",
        "tags": [
          "Notifications"
        ],
        "summary": "Send notification-info",
        "description": "Send the EmailsDone notification-info template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Info notification data for the notification-info template. Sent for a simple informational notification. Generated from template version v1.",
                    "x-emailsdone-template-name": "Info notification",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "message",
                        "label": "Message",
                        "type": "text",
                        "required": true,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "",
                        "example": "There is an update in your account."
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View",
                        "example": "View"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "New notification",
                        "example": "New notification"
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "{{message}}",
                        "example": "Message"
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "New notification",
                        "example": "New notification"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View",
                            "examples": [
                              "View"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "New notification",
                        "examples": [
                          "New notification"
                        ],
                        "maxLength": 180
                      },
                      "message": {
                        "type": "string",
                        "description": "Message",
                        "default": "",
                        "examples": [
                          "There is an update in your account."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "{{message}}",
                        "examples": [
                          "Message"
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "New notification",
                        "examples": [
                          "New notification"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "message"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/notification-success": {
      "post": {
        "operationId": "sendNotificationSuccess",
        "tags": [
          "Notifications"
        ],
        "summary": "Send notification-success",
        "description": "Send the EmailsDone notification-success template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Success notification data for the notification-success template. Sent when something completes successfully. Generated from template version v1.",
                    "x-emailsdone-template-name": "Success notification",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "message",
                        "label": "Message",
                        "type": "text",
                        "required": true,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "{{message}}",
                        "example": "There is an update in your account."
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View",
                        "example": "View"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Completed successfully",
                        "example": "Completed successfully"
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "{{message}}",
                        "example": "Message"
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Completed successfully",
                        "example": "Completed successfully"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View",
                            "examples": [
                              "View"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Completed successfully",
                        "examples": [
                          "Completed successfully"
                        ],
                        "maxLength": 180
                      },
                      "message": {
                        "type": "string",
                        "description": "Message",
                        "default": "{{message}}",
                        "examples": [
                          "There is an update in your account."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "{{message}}",
                        "examples": [
                          "Message"
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Completed successfully",
                        "examples": [
                          "Completed successfully"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "message"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/notification-warning": {
      "post": {
        "operationId": "sendNotificationWarning",
        "tags": [
          "Notifications"
        ],
        "summary": "Send notification-warning",
        "description": "Send the EmailsDone notification-warning template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Warning notification data for the notification-warning template. Sent when something needs attention. Generated from template version v1.",
                    "x-emailsdone-template-name": "Warning notification",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "message",
                        "label": "Message",
                        "type": "text",
                        "required": true,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "{{message}}",
                        "example": "There is an update in your account."
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Review",
                        "example": "Review"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Action may be needed",
                        "example": "Action may be needed"
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "{{message}}",
                        "example": "Message"
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Action may be needed",
                        "example": "Action may be needed"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Review",
                            "examples": [
                              "Review"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Action may be needed",
                        "examples": [
                          "Action may be needed"
                        ],
                        "maxLength": 180
                      },
                      "message": {
                        "type": "string",
                        "description": "Message",
                        "default": "{{message}}",
                        "examples": [
                          "There is an update in your account."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "{{message}}",
                        "examples": [
                          "Message"
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Action may be needed",
                        "examples": [
                          "Action may be needed"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "message"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/processing-failed": {
      "post": {
        "operationId": "sendProcessingFailed",
        "tags": [
          "Notifications"
        ],
        "summary": "Send processing-failed",
        "description": "Send the EmailsDone processing-failed template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Processing failed data for the processing-failed template. Sent when background processing fails. Generated from template version v1.",
                    "x-emailsdone-template-name": "Processing failed",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Review",
                        "example": "Review"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Processing failed",
                        "example": "Processing failed"
                      },
                      {
                        "name": "message",
                        "label": "Message",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Something could not be processed.",
                        "example": "Something could not be processed."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Something could not be processed.",
                        "example": "Something could not be processed."
                      },
                      {
                        "name": "processingDetails",
                        "label": "Processing details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "failedAt": "Failed At",
                          "item": "Item",
                          "reason": "Reason",
                          "reference": "Reference"
                        },
                        "detailsTable": {
                          "binding": "processingDetails",
                          "heading": "Processing details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "failedAt",
                              "label": "Failed",
                              "format": "datetime"
                            },
                            {
                              "key": "item",
                              "label": "Item",
                              "format": null
                            },
                            {
                              "key": "reason",
                              "label": "Reason",
                              "format": null
                            },
                            {
                              "key": "reference",
                              "label": "Reference",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Processing failed",
                        "example": "Processing failed"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Review",
                            "examples": [
                              "Review"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Processing failed",
                        "examples": [
                          "Processing failed"
                        ],
                        "maxLength": 180
                      },
                      "message": {
                        "type": "string",
                        "description": "Message",
                        "default": "Something could not be processed.",
                        "examples": [
                          "Something could not be processed."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Something could not be processed.",
                        "examples": [
                          "Something could not be processed."
                        ],
                        "maxLength": 220
                      },
                      "processingDetails": {
                        "type": "object",
                        "description": "Processing details",
                        "additionalProperties": false,
                        "properties": {
                          "failedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Failed"
                          },
                          "item": {
                            "type": "string",
                            "description": "Item"
                          },
                          "reason": {
                            "type": "string",
                            "description": "Reason"
                          },
                          "reference": {
                            "type": "string",
                            "description": "Reference"
                          }
                        },
                        "examples": [
                          {
                            "failedAt": "Failed At",
                            "item": "Item",
                            "reason": "Reason",
                            "reference": "Reference"
                          }
                        ]
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Processing failed",
                        "examples": [
                          "Processing failed"
                        ],
                        "maxLength": 180
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/queued-request-ready": {
      "post": {
        "operationId": "sendQueuedRequestReady",
        "tags": [
          "Notifications"
        ],
        "summary": "Send queued-request-ready",
        "description": "Send the EmailsDone queued-request-ready template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Queued request ready data for the queued-request-ready template. Sent when a queued request is ready. Generated from template version v1.",
                    "x-emailsdone-template-name": "Queued request ready",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": true,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View result",
                        "example": "View result"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Your request is ready",
                        "example": "Your request is ready"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your queued request has completed.",
                        "example": "Your queued request has completed."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Your queued request has completed.",
                        "example": "Your queued request has completed."
                      },
                      {
                        "name": "requestDetails",
                        "label": "Request details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "requestedAt": "Requested At",
                          "completedAt": "Completed At",
                          "reference": "Reference"
                        },
                        "detailsTable": {
                          "binding": "requestDetails",
                          "heading": "Request details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "requestedAt",
                              "label": "Requested",
                              "format": "datetime"
                            },
                            {
                              "key": "completedAt",
                              "label": "Completed",
                              "format": "datetime"
                            },
                            {
                              "key": "reference",
                              "label": "Reference",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Your request is ready",
                        "example": "Your request is ready"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View result",
                            "examples": [
                              "View result"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        },
                        "required": [
                          "url"
                        ]
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Your request is ready",
                        "examples": [
                          "Your request is ready"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "Your queued request has completed.",
                        "examples": [
                          "Your queued request has completed."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Your queued request has completed.",
                        "examples": [
                          "Your queued request has completed."
                        ],
                        "maxLength": 220
                      },
                      "requestDetails": {
                        "type": "object",
                        "description": "Request details",
                        "additionalProperties": false,
                        "properties": {
                          "completedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Completed"
                          },
                          "reference": {
                            "type": "string",
                            "description": "Reference"
                          },
                          "requestedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Requested"
                          }
                        },
                        "examples": [
                          {
                            "requestedAt": "Requested At",
                            "completedAt": "Completed At",
                            "reference": "Reference"
                          }
                        ]
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Your request is ready",
                        "examples": [
                          "Your request is ready"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "actionButton"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/reminder": {
      "post": {
        "operationId": "sendReminder",
        "tags": [
          "Notifications"
        ],
        "summary": "Send reminder",
        "description": "Send the EmailsDone reminder template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Reminder data for the reminder template. Sent as a simple reminder. Generated from template version v1.",
                    "x-emailsdone-template-name": "Reminder",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "message",
                        "label": "Message",
                        "type": "text",
                        "required": true,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "",
                        "example": "There is an update in your account."
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View",
                        "example": "View"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Reminder",
                        "example": "Reminder"
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "{{message}}",
                        "example": "Message"
                      },
                      {
                        "name": "reminderDetails",
                        "label": "Reminder details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "dueAt": "Due At",
                          "reference": "Reference"
                        },
                        "detailsTable": {
                          "binding": "reminderDetails",
                          "heading": "Reminder details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "dueAt",
                              "label": "Due",
                              "format": "datetime"
                            },
                            {
                              "key": "reference",
                              "label": "Reference",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Reminder",
                        "example": "Reminder"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View",
                            "examples": [
                              "View"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Reminder",
                        "examples": [
                          "Reminder"
                        ],
                        "maxLength": 180
                      },
                      "message": {
                        "type": "string",
                        "description": "Message",
                        "default": "",
                        "examples": [
                          "There is an update in your account."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "{{message}}",
                        "examples": [
                          "Message"
                        ],
                        "maxLength": 220
                      },
                      "reminderDetails": {
                        "type": "object",
                        "description": "Reminder details",
                        "additionalProperties": false,
                        "properties": {
                          "dueAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Due"
                          },
                          "reference": {
                            "type": "string",
                            "description": "Reference"
                          }
                        },
                        "examples": [
                          {
                            "dueAt": "Due At",
                            "reference": "Reference"
                          }
                        ]
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Reminder",
                        "examples": [
                          "Reminder"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "message"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/report-ready": {
      "post": {
        "operationId": "sendReportReady",
        "tags": [
          "Notifications"
        ],
        "summary": "Send report-ready",
        "description": "Send the EmailsDone report-ready template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Report ready data for the report-ready template. Sent when a report is ready. Generated from template version v1.",
                    "x-emailsdone-template-name": "Report ready",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": true,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View report",
                        "example": "View report"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Your report is ready",
                        "example": "Your report is ready"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "The report you requested is ready.",
                        "example": "The report you requested is ready."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "View your completed report.",
                        "example": "View your completed report."
                      },
                      {
                        "name": "reportDetails",
                        "label": "Report details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "name": "Name",
                          "createdAt": "Created At",
                          "period": "Period"
                        },
                        "detailsTable": {
                          "binding": "reportDetails",
                          "heading": "Report details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "name",
                              "label": "Report",
                              "format": null
                            },
                            {
                              "key": "createdAt",
                              "label": "Created",
                              "format": "datetime"
                            },
                            {
                              "key": "period",
                              "label": "Period",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Your report is ready",
                        "example": "Your report is ready"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View report",
                            "examples": [
                              "View report"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        },
                        "required": [
                          "url"
                        ]
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Your report is ready",
                        "examples": [
                          "Your report is ready"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "The report you requested is ready.",
                        "examples": [
                          "The report you requested is ready."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "View your completed report.",
                        "examples": [
                          "View your completed report."
                        ],
                        "maxLength": 220
                      },
                      "reportDetails": {
                        "type": "object",
                        "description": "Report details",
                        "additionalProperties": false,
                        "properties": {
                          "createdAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Created"
                          },
                          "name": {
                            "type": "string",
                            "description": "Report"
                          },
                          "period": {
                            "type": "string",
                            "description": "Period"
                          }
                        },
                        "examples": [
                          {
                            "name": "Name",
                            "createdAt": "Created At",
                            "period": "Period"
                          }
                        ]
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Your report is ready",
                        "examples": [
                          "Your report is ready"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "actionButton"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/upload-complete": {
      "post": {
        "operationId": "sendUploadComplete",
        "tags": [
          "Notifications"
        ],
        "summary": "Send upload-complete",
        "description": "Send the EmailsDone upload-complete template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Upload complete data for the upload-complete template. Sent when an upload completes. Generated from template version v1.",
                    "x-emailsdone-template-name": "Upload complete",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View upload",
                        "example": "View upload"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Upload complete",
                        "example": "Upload complete"
                      },
                      {
                        "name": "message",
                        "label": "Message",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "Your upload has completed.",
                        "example": "Your upload has completed."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Your upload has completed.",
                        "example": "Your upload has completed."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Upload complete",
                        "example": "Upload complete"
                      },
                      {
                        "name": "uploadDetails",
                        "label": "Upload details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "fileName": "File Name",
                          "uploadedAt": "Uploaded At",
                          "size": "Size"
                        },
                        "detailsTable": {
                          "binding": "uploadDetails",
                          "heading": "Upload details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "fileName",
                              "label": "File",
                              "format": null
                            },
                            {
                              "key": "uploadedAt",
                              "label": "Uploaded",
                              "format": "datetime"
                            },
                            {
                              "key": "size",
                              "label": "Size",
                              "format": null
                            }
                          ]
                        }
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View upload",
                            "examples": [
                              "View upload"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Upload complete",
                        "examples": [
                          "Upload complete"
                        ],
                        "maxLength": 180
                      },
                      "message": {
                        "type": "string",
                        "description": "Message",
                        "default": "Your upload has completed.",
                        "examples": [
                          "Your upload has completed."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Your upload has completed.",
                        "examples": [
                          "Your upload has completed."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Upload complete",
                        "examples": [
                          "Upload complete"
                        ],
                        "maxLength": 180
                      },
                      "uploadDetails": {
                        "type": "object",
                        "description": "Upload details",
                        "additionalProperties": false,
                        "properties": {
                          "fileName": {
                            "type": "string",
                            "description": "File"
                          },
                          "size": {
                            "type": "string",
                            "description": "Size"
                          },
                          "uploadedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Uploaded"
                          }
                        },
                        "examples": [
                          {
                            "fileName": "File Name",
                            "uploadedAt": "Uploaded At",
                            "size": "Size"
                          }
                        ]
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/team/invitation-accepted": {
      "post": {
        "operationId": "sendInvitationAccepted",
        "tags": [
          "Team"
        ],
        "summary": "Send invitation-accepted",
        "description": "Send the EmailsDone invitation-accepted template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Invitation accepted data for the invitation-accepted template. Sent when an invitation is accepted. Generated from template version v1.",
                    "x-emailsdone-template-name": "Invitation accepted",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View team",
                        "example": "View team"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Invitation accepted",
                        "example": "Invitation accepted"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "An invitation has been accepted.",
                        "example": "An invitation has been accepted."
                      },
                      {
                        "name": "inviteDetails",
                        "label": "Invitation details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "acceptedBy": "Accepted By",
                          "acceptedAt": "Accepted At",
                          "workspace": "Workspace",
                          "role": "Role"
                        },
                        "detailsTable": {
                          "binding": "inviteDetails",
                          "heading": "Invitation details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "acceptedBy",
                              "label": "Accepted by",
                              "format": null
                            },
                            {
                              "key": "acceptedAt",
                              "label": "Accepted",
                              "format": "datetime"
                            },
                            {
                              "key": "workspace",
                              "label": "Workspace",
                              "format": null
                            },
                            {
                              "key": "role",
                              "label": "Role",
                              "format": null
                            }
                          ]
                        }
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "An invitation has been accepted.",
                        "example": "An invitation has been accepted."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Invitation accepted",
                        "example": "Invitation accepted"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View team",
                            "examples": [
                              "View team"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Invitation accepted",
                        "examples": [
                          "Invitation accepted"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "An invitation has been accepted.",
                        "examples": [
                          "An invitation has been accepted."
                        ],
                        "maxLength": 1000
                      },
                      "inviteDetails": {
                        "type": "object",
                        "description": "Invitation details",
                        "additionalProperties": false,
                        "properties": {
                          "acceptedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Accepted"
                          },
                          "acceptedBy": {
                            "type": "string",
                            "description": "Accepted by"
                          },
                          "role": {
                            "type": "string",
                            "description": "Role"
                          },
                          "workspace": {
                            "type": "string",
                            "description": "Workspace"
                          }
                        },
                        "examples": [
                          {
                            "acceptedBy": "Accepted By",
                            "acceptedAt": "Accepted At",
                            "workspace": "Workspace",
                            "role": "Role"
                          }
                        ]
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "An invitation has been accepted.",
                        "examples": [
                          "An invitation has been accepted."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Invitation accepted",
                        "examples": [
                          "Invitation accepted"
                        ],
                        "maxLength": 180
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/team/invited-to-workspace": {
      "post": {
        "operationId": "sendInvitedToWorkspace",
        "tags": [
          "Team"
        ],
        "summary": "Send invited-to-workspace",
        "description": "Send the EmailsDone invited-to-workspace template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Invited to workspace data for the invited-to-workspace template. Sent when someone is invited to a workspace or team. Generated from template version v1.",
                    "x-emailsdone-template-name": "Invited to workspace",
                    "x-emailsdone-required-fields": [
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": true,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      }
                    ],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "Accept invitation",
                        "example": "Accept invitation"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "You're invited",
                        "example": "You're invited"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "You have been invited to join.",
                        "example": "You have been invited to join."
                      },
                      {
                        "name": "inviteDetails",
                        "label": "Invitation details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "workspace": "Workspace",
                          "invitedBy": "Invited By",
                          "role": "Role",
                          "expiresAt": "Expires At"
                        },
                        "detailsTable": {
                          "binding": "inviteDetails",
                          "heading": "Invitation details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "workspace",
                              "label": "Workspace",
                              "format": null
                            },
                            {
                              "key": "invitedBy",
                              "label": "Invited by",
                              "format": null
                            },
                            {
                              "key": "role",
                              "label": "Role",
                              "format": null
                            },
                            {
                              "key": "expiresAt",
                              "label": "Expires",
                              "format": "datetime"
                            }
                          ]
                        }
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "Accept your invitation to continue.",
                        "example": "Accept your invitation to continue."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "You're invited",
                        "example": "You're invited"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "Accept invitation",
                            "examples": [
                              "Accept invitation"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        },
                        "required": [
                          "url"
                        ]
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "You're invited",
                        "examples": [
                          "You're invited"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "You have been invited to join.",
                        "examples": [
                          "You have been invited to join."
                        ],
                        "maxLength": 1000
                      },
                      "inviteDetails": {
                        "type": "object",
                        "description": "Invitation details",
                        "additionalProperties": false,
                        "properties": {
                          "expiresAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Expires"
                          },
                          "invitedBy": {
                            "type": "string",
                            "description": "Invited by"
                          },
                          "role": {
                            "type": "string",
                            "description": "Role"
                          },
                          "workspace": {
                            "type": "string",
                            "description": "Workspace"
                          }
                        },
                        "examples": [
                          {
                            "workspace": "Workspace",
                            "invitedBy": "Invited By",
                            "role": "Role",
                            "expiresAt": "Expires At"
                          }
                        ]
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "Accept your invitation to continue.",
                        "examples": [
                          "Accept your invitation to continue."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "You're invited",
                        "examples": [
                          "You're invited"
                        ],
                        "maxLength": 180
                      }
                    },
                    "required": [
                      "actionButton"
                    ]
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/team/role-changed": {
      "post": {
        "operationId": "sendRoleChanged",
        "tags": [
          "Team"
        ],
        "summary": "Send role-changed",
        "description": "Send the EmailsDone role-changed template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Role changed data for the role-changed template. Sent when a team member role changes. Generated from template version v1.",
                    "x-emailsdone-template-name": "Role changed",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View team",
                        "example": "View team"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Role changed",
                        "example": "Role changed"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "A team member's role has changed.",
                        "example": "A team member's role has changed."
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "A team member's role has changed.",
                        "example": "A team member's role has changed."
                      },
                      {
                        "name": "roleDetails",
                        "label": "Role details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "member": "Member",
                          "previousRole": "Previous Role",
                          "newRole": "New Role",
                          "changedAt": "Changed At"
                        },
                        "detailsTable": {
                          "binding": "roleDetails",
                          "heading": "Role details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "member",
                              "label": "Member",
                              "format": null
                            },
                            {
                              "key": "previousRole",
                              "label": "Previous role",
                              "format": null
                            },
                            {
                              "key": "newRole",
                              "label": "New role",
                              "format": null
                            },
                            {
                              "key": "changedAt",
                              "label": "Changed",
                              "format": "datetime"
                            }
                          ]
                        }
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Role changed",
                        "example": "Role changed"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View team",
                            "examples": [
                              "View team"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Role changed",
                        "examples": [
                          "Role changed"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "A team member's role has changed.",
                        "examples": [
                          "A team member's role has changed."
                        ],
                        "maxLength": 1000
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "A team member's role has changed.",
                        "examples": [
                          "A team member's role has changed."
                        ],
                        "maxLength": 220
                      },
                      "roleDetails": {
                        "type": "object",
                        "description": "Role details",
                        "additionalProperties": false,
                        "properties": {
                          "changedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Changed"
                          },
                          "member": {
                            "type": "string",
                            "description": "Member"
                          },
                          "newRole": {
                            "type": "string",
                            "description": "New role"
                          },
                          "previousRole": {
                            "type": "string",
                            "description": "Previous role"
                          }
                        },
                        "examples": [
                          {
                            "member": "Member",
                            "previousRole": "Previous Role",
                            "newRole": "New Role",
                            "changedAt": "Changed At"
                          }
                        ]
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Role changed",
                        "examples": [
                          "Role changed"
                        ],
                        "maxLength": 180
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/team/team-member-added": {
      "post": {
        "operationId": "sendTeamMemberAdded",
        "tags": [
          "Team"
        ],
        "summary": "Send team-member-added",
        "description": "Send the EmailsDone team-member-added template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Team member added data for the team-member-added template. Sent when a team member is added. Generated from template version v1.",
                    "x-emailsdone-template-name": "Team member added",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View team",
                        "example": "View team"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Team member added",
                        "example": "Team member added"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "A new member has been added.",
                        "example": "A new member has been added."
                      },
                      {
                        "name": "memberDetails",
                        "label": "Member details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "name": "Name",
                          "email": "Email",
                          "role": "Role",
                          "addedAt": "Added At"
                        },
                        "detailsTable": {
                          "binding": "memberDetails",
                          "heading": "Member details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "name",
                              "label": "Name",
                              "format": null
                            },
                            {
                              "key": "email",
                              "label": "Email",
                              "format": "email"
                            },
                            {
                              "key": "role",
                              "label": "Role",
                              "format": null
                            },
                            {
                              "key": "addedAt",
                              "label": "Added",
                              "format": "datetime"
                            }
                          ]
                        }
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "A new member has been added.",
                        "example": "A new member has been added."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Team member added",
                        "example": "Team member added"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View team",
                            "examples": [
                              "View team"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Team member added",
                        "examples": [
                          "Team member added"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "A new member has been added.",
                        "examples": [
                          "A new member has been added."
                        ],
                        "maxLength": 1000
                      },
                      "memberDetails": {
                        "type": "object",
                        "description": "Member details",
                        "additionalProperties": false,
                        "properties": {
                          "addedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Added"
                          },
                          "email": {
                            "type": "string",
                            "format": "email",
                            "description": "Email"
                          },
                          "name": {
                            "type": "string",
                            "description": "Name"
                          },
                          "role": {
                            "type": "string",
                            "description": "Role"
                          }
                        },
                        "examples": [
                          {
                            "name": "Name",
                            "email": "Email",
                            "role": "Role",
                            "addedAt": "Added At"
                          }
                        ]
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "A new member has been added.",
                        "examples": [
                          "A new member has been added."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Team member added",
                        "examples": [
                          "Team member added"
                        ],
                        "maxLength": 180
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/team/team-member-removed": {
      "post": {
        "operationId": "sendTeamMemberRemoved",
        "tags": [
          "Team"
        ],
        "summary": "Send team-member-removed",
        "description": "Send the EmailsDone team-member-removed template. The route injects templateId internally.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "to",
                  "data"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email",
                    "description": "Recipient email address."
                  },
                  "data": {
                    "type": "object",
                    "description": "Team member removed data for the team-member-removed template. Sent when a team member is removed. Generated from template version v1.",
                    "x-emailsdone-template-name": "Team member removed",
                    "x-emailsdone-required-fields": [],
                    "x-emailsdone-optional-fields": [
                      {
                        "name": "actionButton.label",
                        "label": "Action Button Label",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 120,
                        "defaultValue": "View team",
                        "example": "View team"
                      },
                      {
                        "name": "actionButton.url",
                        "label": "Action Button URL",
                        "type": "url",
                        "required": false,
                        "description": "",
                        "maxLength": 2048,
                        "example": "https://example.com/app"
                      },
                      {
                        "name": "heading",
                        "label": "Heading",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Team member removed",
                        "example": "Team member removed"
                      },
                      {
                        "name": "intro",
                        "label": "Intro",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 1000,
                        "defaultValue": "A member has been removed.",
                        "example": "A member has been removed."
                      },
                      {
                        "name": "memberDetails",
                        "label": "Member details",
                        "type": "detailsTable",
                        "required": false,
                        "description": "",
                        "maxLength": null,
                        "example": {
                          "name": "Name",
                          "email": "Email",
                          "removedAt": "Removed At"
                        },
                        "detailsTable": {
                          "binding": "memberDetails",
                          "heading": "Member details",
                          "labelWidth": null,
                          "fields": [
                            {
                              "key": "name",
                              "label": "Name",
                              "format": null
                            },
                            {
                              "key": "email",
                              "label": "Email",
                              "format": "email"
                            },
                            {
                              "key": "removedAt",
                              "label": "Removed",
                              "format": "datetime"
                            }
                          ]
                        }
                      },
                      {
                        "name": "preheader",
                        "label": "Preheader",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 220,
                        "defaultValue": "A member has been removed.",
                        "example": "A member has been removed."
                      },
                      {
                        "name": "subject",
                        "label": "Subject",
                        "type": "text",
                        "required": false,
                        "description": "",
                        "maxLength": 180,
                        "defaultValue": "Team member removed",
                        "example": "Team member removed"
                      }
                    ],
                    "properties": {
                      "actionButton": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string",
                            "description": "Action Button Label",
                            "default": "View team",
                            "examples": [
                              "View team"
                            ],
                            "maxLength": 120
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Action Button URL",
                            "examples": [
                              "https://example.com/app"
                            ],
                            "maxLength": 2048
                          }
                        }
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading",
                        "default": "Team member removed",
                        "examples": [
                          "Team member removed"
                        ],
                        "maxLength": 180
                      },
                      "intro": {
                        "type": "string",
                        "description": "Intro",
                        "default": "A member has been removed.",
                        "examples": [
                          "A member has been removed."
                        ],
                        "maxLength": 1000
                      },
                      "memberDetails": {
                        "type": "object",
                        "description": "Member details",
                        "additionalProperties": false,
                        "properties": {
                          "email": {
                            "type": "string",
                            "format": "email",
                            "description": "Email"
                          },
                          "name": {
                            "type": "string",
                            "description": "Name"
                          },
                          "removedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Removed"
                          }
                        },
                        "examples": [
                          {
                            "name": "Name",
                            "email": "Email",
                            "removedAt": "Removed At"
                          }
                        ]
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Preheader",
                        "default": "A member has been removed.",
                        "examples": [
                          "A member has been removed."
                        ],
                        "maxLength": 220
                      },
                      "subject": {
                        "type": "string",
                        "description": "Subject",
                        "default": "Team member removed",
                        "examples": [
                          "Team member removed"
                        ],
                        "maxLength": 180
                      }
                    }
                  },
                  "templateVersion": {
                    "type": "string",
                    "default": "v1",
                    "description": "Optional template version override."
                  },
                  "from": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional verified sender email address."
                  },
                  "fromName": {
                    "type": "string",
                    "description": "Optional sender display name."
                  },
                  "replyTo": {
                    "type": "string",
                    "format": "email",
                    "description": "Optional reply-to email address."
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "description": "Stable key for retry-safe sends."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email accepted by EmailsDone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Send failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SendEmailResponse": {
        "type": "object",
        "required": [
          "ok",
          "status",
          "messageId",
          "idempotent"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "example": true
          },
          "status": {
            "type": "string",
            "enum": [
              "accepted"
            ],
            "example": "accepted"
          },
          "messageId": {
            "type": "string",
            "example": "msg_example"
          },
          "idempotent": {
            "type": "boolean",
            "example": false
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "ok",
          "error",
          "message"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "error": {
            "type": "string",
            "example": "invalid_request"
          },
          "message": {
            "type": "string",
            "example": "Request body must include to and data."
          }
        }
      }
    }
  }
}
