{
  "openapi": "3.1.0",
  "info": {
    "title": "SambhavTech AI WhatsApp API",
    "version": "1.0.0",
    "description": "Send and track WhatsApp messages and manage tenant-isolated reminder commitments. All requests and responses use JSON unless a successful operation has no request body."
  },
  "servers": [
    {
      "url": "https://whatsapp.sambhavtech.in",
      "description": "Production"
    }
  ],
  "security": [
    {
      "ApiKeyBearer": []
    }
  ],
  "tags": [
    {
      "name": "Messages",
      "description": "Send and track WhatsApp messages."
    },
    {
      "name": "Reminders",
      "description": "Create and manage reminder commitments."
    }
  ],
  "paths": {
    "/api/v1/messages": {
      "post": {
        "tags": ["Messages"],
        "operationId": "sendMessage",
        "summary": "Send a WhatsApp message",
        "description": "Send either an approved template or free-form session text, never both. A template is accepted into the queue and returns 202 with a numeric queue ID. Session text is sent immediately inside the contact's 24-hour customer-service window and returns 200 with a WhatsApp wamid ID. Use the returned ID with the message-status operation.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageSendRequest"
              },
              "examples": {
                "template": {
                  "summary": "Queue an approved template",
                  "value": {
                    "to": "919876543210",
                    "template": "appointment_reminder",
                    "language": "en_US",
                    "params": ["Asha", "10 September, 3:30 PM"]
                  }
                },
                "sessionText": {
                  "summary": "Send text in an open service window",
                  "value": {
                    "to": "919876543210",
                    "text": "Your appointment is confirmed."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session message sent immediately.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionMessageResponse"
                }
              }
            }
          },
          "202": {
            "description": "Template message accepted and queued; this does not mean delivered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueuedMessageResponse"
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "402": { "$ref": "#/components/responses/PaymentRequired" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "409": { "$ref": "#/components/responses/Conflict" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" },
          "503": { "$ref": "#/components/responses/ServiceUnavailable" }
        }
      }
    },
    "/api/v1/messages/{id}": {
      "get": {
        "tags": ["Messages"],
        "operationId": "getMessage",
        "summary": "Get message status",
        "description": "Returns only a message owned by the API key's workspace. Cross-workspace IDs are reported as not found.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The numeric queue ID returned for a template send or the wamid ID returned for a session send.",
            "schema": {
              "type": "string",
              "pattern": "^(?:[0-9]+|wamid\\..+)$"
            },
            "examples": {
              "template": { "value": "48213" },
              "session": { "value": "wamid.HBgMOTEexample" }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current message and delivery status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageStatus"
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" },
          "503": { "$ref": "#/components/responses/ServiceUnavailable" }
        }
      }
    },
    "/api/v1/reminders": {
      "post": {
        "tags": ["Reminders"],
        "operationId": "createReminder",
        "summary": "Create or replay a reminder commitment",
        "description": "Creates a tenant-isolated reminder event from an existing active schedule in the API key's workspace. A stable external_id is the idempotency key within that workspace: replaying identical material returns the existing generation, while changed material creates a new generation. The referenced schedule owns its reminder rules; a daily rule may use at_local_time for DST-safe wall-clock delivery in the event timezone. Event creation does not accept schedule rules.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReminderCreateRequest"
              },
              "example": {
                "schedule_id": "df75125c-2138-47c8-bc85-34080305dc59",
                "external_id": "booking-1042",
                "event_type": "meeting",
                "to": "+919876543210",
                "name": "Asha",
                "title": "Product consultation",
                "scheduled_at": "2030-09-10T15:30:00+05:30",
                "timezone": "Asia/Kolkata",
                "meeting_link": "https://example.com/meet/1042",
                "source": "api",
                "metadata": { "company_name": "Example Ltd" }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Idempotent replay of an identical event; no duplicate jobs were created.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ReminderMutationResponse" }
              }
            }
          },
          "201": {
            "description": "Reminder event and its jobs were created.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ReminderMutationResponse" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "402": { "$ref": "#/components/responses/PaymentRequired" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "409": { "$ref": "#/components/responses/Conflict" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" }
        }
      }
    },
    "/api/v1/reminders/{id}": {
      "get": {
        "tags": ["Reminders"],
        "operationId": "getReminder",
        "summary": "Get a reminder commitment",
        "description": "Returns the tenant-owned event and every job generation. An unknown or cross-workspace UUID returns 404.",
        "parameters": [
          { "$ref": "#/components/parameters/ReminderId" }
        ],
        "responses": {
          "200": {
            "description": "Reminder event and jobs.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ReminderDetailResponse" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "402": { "$ref": "#/components/responses/PaymentRequired" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" }
        }
      }
    },
    "/api/v1/reminders/{id}/cancel": {
      "post": {
        "tags": ["Reminders"],
        "operationId": "cancelReminder",
        "summary": "Cancel a reminder commitment",
        "description": "Idempotently marks the tenant-owned event cancelled and cancels pending jobs. A message already submitted to WhatsApp cannot be recalled.",
        "parameters": [
          { "$ref": "#/components/parameters/ReminderId" }
        ],
        "responses": {
          "200": {
            "description": "Reminder is cancelled.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ReminderMutationResponse" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "402": { "$ref": "#/components/responses/PaymentRequired" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" }
        }
      }
    },
    "/api/v1/reminders/{id}/reschedule": {
      "post": {
        "tags": ["Reminders"],
        "operationId": "rescheduleReminder",
        "summary": "Reschedule a reminder commitment",
        "description": "Replaces the event time, cancels pending jobs from the prior generation, and materializes a new generation from the same existing schedule. Wall-clock schedule rules are recalculated in the replacement IANA timezone.",
        "parameters": [
          { "$ref": "#/components/parameters/ReminderId" }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/ReminderRescheduleRequest" },
              "example": {
                "scheduled_at": "2030-09-11T16:00:00+05:30",
                "timezone": "Asia/Kolkata"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reminder was rescheduled into a new generation.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ReminderMutationResponse" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "402": { "$ref": "#/components/responses/PaymentRequired" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "409": { "$ref": "#/components/responses/Conflict" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" }
        }
      }
    },
    "/api/v1/reminders/{id}/outcome": {
      "post": {
        "tags": ["Reminders"],
        "operationId": "setReminderOutcome",
        "summary": "Record a reminder outcome",
        "description": "Records what happened for the tenant-owned event. Attended and no_show complete the event. Cancelled cancels remaining pending jobs and marks the event cancelled.",
        "parameters": [
          { "$ref": "#/components/parameters/ReminderId" }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/ReminderOutcomeRequest" },
              "example": { "outcome": "no_show" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Outcome recorded.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ReminderOutcomeResponse" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "402": { "$ref": "#/components/responses/PaymentRequired" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/InternalError" }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Workspace API key",
        "description": "A server-side workspace API key. Never expose it in browser or mobile code."
      }
    },
    "parameters": {
      "ReminderId": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "Tenant-owned reminder event UUID. Cross-workspace IDs return 404.",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "7282ea21-f012-4db3-a9f3-11cb14cb2491"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": { "type": "string" },
          "code": {
            "type": "string",
            "description": "Stable machine-readable code when the route supplies one."
          },
          "limit": {
            "type": "integer",
            "description": "Configured daily send limit when code is daily_limit_reached."
          },
          "used": {
            "type": "integer",
            "description": "Daily sends consumed when code is daily_limit_reached."
          }
        }
      },
      "MessageSendRequest": {
        "oneOf": [
          { "$ref": "#/components/schemas/TemplateMessageRequest" },
          { "$ref": "#/components/schemas/SessionMessageRequest" }
        ]
      },
      "TemplateMessageRequest": {
        "type": "object",
        "required": ["to", "template"],
        "properties": {
          "to": {
            "type": "string",
            "description": "Recipient phone number; punctuation is normalized and the result must be valid."
          },
          "template": {
            "type": "string",
            "minLength": 1,
            "description": "Approved WhatsApp template name."
          },
          "language": {
            "type": "string",
            "minLength": 1,
            "default": "en",
            "description": "Approved template language."
          },
          "params": {
            "type": "array",
            "items": { "type": "string", "minLength": 1 },
            "default": [],
            "description": "Positional template body parameters."
          },
          "header_image_url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://",
            "description": "Public HTTPS image URL. Mutually exclusive with header_image_id."
          },
          "header_image_id": {
            "type": "string",
            "minLength": 1,
            "description": "Uploaded WhatsApp media ID. Mutually exclusive with header_image_url."
          }
        },
        "allOf": [
          { "not": { "required": ["text"] } },
          { "not": { "required": ["header_image_url", "header_image_id"] } }
        ]
      },
      "SessionMessageRequest": {
        "type": "object",
        "required": ["to", "text"],
        "properties": {
          "to": {
            "type": "string",
            "description": "Recipient phone number."
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "description": "Free-form text sent only while the contact's 24-hour service window is open."
          }
        },
        "not": { "required": ["template"] }
      },
      "QueuedMessageResponse": {
        "type": "object",
        "required": ["id", "status"],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9]+$",
            "description": "Numeric queue ID represented as a string."
          },
          "status": { "const": "queued" }
        },
        "example": { "id": "48213", "status": "queued" }
      },
      "SessionMessageResponse": {
        "type": "object",
        "required": ["id", "status", "message_id", "to"],
        "properties": {
          "id": { "type": "string", "pattern": "^wamid\\." },
          "status": { "const": "sent" },
          "message_id": { "type": "string", "pattern": "^wamid\\." },
          "to": { "type": "string" }
        },
        "example": {
          "id": "wamid.HBgMOTEexample",
          "status": "sent",
          "message_id": "wamid.HBgMOTEexample",
          "to": "919876543210"
        }
      },
      "MessageStatus": {
        "type": "object",
        "required": [
          "id", "status", "to", "template", "language", "attempts", "error",
          "created_at", "sent_at", "delivered_at", "read_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Numeric queue ID for a template or wamid ID for a session message."
          },
          "status": {
            "type": "string",
            "enum": ["queued", "sending", "sent", "delivered", "read", "failed", "canceled"]
          },
          "to": { "type": "string" },
          "template": { "type": ["string", "null"] },
          "language": { "type": ["string", "null"] },
          "attempts": { "type": "integer", "minimum": 0 },
          "error": { "type": ["string", "null"] },
          "created_at": { "type": "string", "format": "date-time" },
          "sent_at": { "type": ["string", "null"], "format": "date-time" },
          "delivered_at": { "type": ["string", "null"], "format": "date-time" },
          "read_at": { "type": ["string", "null"], "format": "date-time" }
        }
      },
      "ReminderCreateRequest": {
        "type": "object",
        "required": ["schedule_id", "event_type", "to", "title", "scheduled_at"],
        "properties": {
          "schedule_id": {
            "type": "string",
            "format": "uuid",
            "description": "An existing active schedule in this workspace. The schedule supplies template and timing rules; daily rules can use at_local_time for wall-clock delivery."
          },
          "external_id": {
            "type": "string",
            "minLength": 1,
            "description": "Optional tenant-scoped idempotency key. Identical replays return 200 without duplicate jobs; changed material creates a new generation."
          },
          "event_type": {
            "type": "string",
            "enum": ["meeting", "webinar", "appointment", "site_visit", "follow_up", "custom"]
          },
          "to": {
            "type": "string",
            "description": "Recipient phone number containing 8 to 15 digits after normalization."
          },
          "title": { "type": "string", "minLength": 1 },
          "scheduled_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "(?:Z|[+-]\\d{2}:\\d{2})$",
            "description": "Future timestamp with Z or an explicit numeric UTC offset."
          },
          "timezone": {
            "type": "string",
            "description": "IANA timezone used for human-readable parameters and wall-clock rules. Defaults to the tenant timezone, or Asia/Kolkata when the tenant has no value."
          },
          "name": { "type": "string", "minLength": 1 },
          "email": { "type": "string", "minLength": 1 },
          "description": { "type": "string", "minLength": 1 },
          "meeting_link": { "type": "string", "minLength": 1 },
          "source": {
            "type": "string",
            "enum": ["api", "manual", "calendly", "hubspot", "zoho", "google_calendar", "google_sheets", "custom_webhook"],
            "default": "api"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "default": {},
            "description": "JSON object limited to 16 KiB after serialization."
          }
        }
      },
      "ReminderRescheduleRequest": {
        "type": "object",
        "required": ["scheduled_at"],
        "properties": {
          "scheduled_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "(?:Z|[+-]\\d{2}:\\d{2})$",
            "description": "Replacement future timestamp with Z or a numeric UTC offset."
          },
          "timezone": {
            "type": "string",
            "description": "Replacement IANA timezone. Defaults to the event's current timezone."
          }
        }
      },
      "ReminderOutcome": {
        "type": "string",
        "enum": ["attended", "no_show", "cancelled"]
      },
      "ReminderOutcomeRequest": {
        "type": "object",
        "required": ["outcome"],
        "properties": {
          "outcome": {
            "type": "string",
            "enum": ["attended", "no_show", "cancelled"]
          }
        }
      },
      "ReminderEventStatus": {
        "type": "string",
        "enum": ["scheduled", "completed", "cancelled", "failed"]
      },
      "ReminderJobStatus": {
        "type": "string",
        "enum": ["scheduled", "queued", "sent", "delivered", "read", "failed", "cancelled", "skipped"]
      },
      "ReminderResponseValue": {
        "type": ["string", "null"],
        "enum": ["confirmed", "cancelled", null]
      },
      "ReminderJob": {
        "type": "object",
        "required": ["id", "label", "scheduled_for", "status", "skip_reason"],
        "properties": {
          "id": { "type": "string", "format": "uuid" },
          "label": { "type": "string" },
          "scheduled_for": { "type": "string", "format": "date-time" },
          "status": { "$ref": "#/components/schemas/ReminderJobStatus" },
          "skip_reason": {
            "type": ["string", "null"],
            "enum": ["missed_offset", "opted_out", null]
          }
        }
      },
      "ReminderMutationResponse": {
        "type": "object",
        "required": ["id", "status", "generation", "created", "jobs_created", "jobs"],
        "properties": {
          "id": { "type": "string", "format": "uuid" },
          "status": { "$ref": "#/components/schemas/ReminderEventStatus" },
          "generation": { "type": "integer", "minimum": 1 },
          "created": {
            "type": "boolean",
            "description": "True only when a new event row was created."
          },
          "jobs_created": { "type": "integer", "minimum": 0 },
          "jobs": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/ReminderJob" },
            "description": "Jobs in the event's current generation."
          }
        }
      },
      "ReminderOutcomeResponse": {
        "allOf": [
          { "$ref": "#/components/schemas/ReminderMutationResponse" },
          {
            "type": "object",
            "required": ["outcome", "response"],
            "properties": {
              "outcome": { "$ref": "#/components/schemas/ReminderOutcome" },
              "response": { "$ref": "#/components/schemas/ReminderResponseValue" }
            }
          }
        ]
      },
      "ReminderEventRecord": {
        "type": "object",
        "required": [
          "id", "tenant_id", "schedule_id", "event_type", "contact_phone", "title",
          "scheduled_at", "timezone", "source", "status", "generation", "material_hash",
          "metadata", "created_at", "updated_at"
        ],
        "properties": {
          "id": { "type": "string", "format": "uuid" },
          "tenant_id": { "type": "string", "format": "uuid" },
          "schedule_id": { "type": "string", "format": "uuid" },
          "external_id": { "type": ["string", "null"] },
          "event_type": {
            "type": "string",
            "enum": ["meeting", "webinar", "appointment", "site_visit", "follow_up", "custom"]
          },
          "contact_id": { "type": ["string", "null"], "format": "uuid" },
          "contact_phone": { "type": "string" },
          "contact_name": { "type": ["string", "null"] },
          "contact_email": { "type": ["string", "null"] },
          "title": { "type": "string" },
          "description": { "type": ["string", "null"] },
          "scheduled_at": { "type": "string", "format": "date-time" },
          "timezone": { "type": "string" },
          "meeting_link": { "type": ["string", "null"] },
          "source": {
            "type": "string",
            "enum": ["api", "manual", "calendly", "hubspot", "zoho", "google_calendar", "google_sheets", "custom_webhook"]
          },
          "status": { "$ref": "#/components/schemas/ReminderEventStatus" },
          "generation": { "type": "integer", "minimum": 1 },
          "material_hash": { "type": "string" },
          "metadata": { "type": "object", "additionalProperties": true },
          "response": { "$ref": "#/components/schemas/ReminderResponseValue" },
          "responded_at": { "type": ["string", "null"], "format": "date-time" },
          "outcome": {
            "oneOf": [
              { "$ref": "#/components/schemas/ReminderOutcome" },
              { "type": "null" }
            ]
          },
          "outcome_at": { "type": ["string", "null"], "format": "date-time" },
          "outcome_source": {
            "type": ["string", "null"],
            "enum": ["api", "manual", "auto", null]
          },
          "created_at": { "type": "string", "format": "date-time" },
          "updated_at": { "type": "string", "format": "date-time" }
        },
        "additionalProperties": true
      },
      "ReminderJobRecord": {
        "type": "object",
        "required": [
          "id", "tenant_id", "event_id", "generation", "offset_key", "attempt", "label",
          "scheduled_for", "status", "created_at", "updated_at"
        ],
        "properties": {
          "id": { "type": "string", "format": "uuid" },
          "tenant_id": { "type": "string", "format": "uuid" },
          "event_id": { "type": "string", "format": "uuid" },
          "generation": { "type": "integer", "minimum": 1 },
          "offset_key": { "type": "string" },
          "attempt": { "type": "integer", "minimum": 1 },
          "label": { "type": "string" },
          "scheduled_for": { "type": "string", "format": "date-time" },
          "status": { "$ref": "#/components/schemas/ReminderJobStatus" },
          "skip_reason": {
            "type": ["string", "null"],
            "enum": ["missed_offset", "opted_out", null]
          },
          "error": { "type": ["string", "null"] },
          "branch_path": {
            "type": ["array", "null"],
            "items": { "type": "string", "enum": ["confirmed", "no_reply"] }
          },
          "sent_at": { "type": ["string", "null"], "format": "date-time" },
          "delivered_at": { "type": ["string", "null"], "format": "date-time" },
          "read_at": { "type": ["string", "null"], "format": "date-time" },
          "created_at": { "type": "string", "format": "date-time" },
          "updated_at": { "type": "string", "format": "date-time" }
        },
        "additionalProperties": true
      },
      "ReminderDetailResponse": {
        "type": "object",
        "required": ["event", "jobs"],
        "properties": {
          "event": { "$ref": "#/components/schemas/ReminderEventRecord" },
          "jobs": {
            "type": "array",
            "description": "All generations, newest generation first and then scheduled time ascending.",
            "items": { "$ref": "#/components/schemas/ReminderJobRecord" }
          }
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Malformed JSON, identifier, field, timestamp, timezone, or mutually exclusive input.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing, invalid, revoked, or unlinked bearer API key.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" }
          }
        }
      },
      "PaymentRequired": {
        "description": "The workspace plan is inactive, suspended, expired, or unavailable.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" }
          }
        }
      },
      "Forbidden": {
        "description": "The workspace plan does not include the requested feature.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" }
          }
        }
      },
      "NotFound": {
        "description": "The tenant-owned resource or active reminder schedule was not found.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" }
          }
        }
      },
      "Conflict": {
        "description": "Recipient opt-out, closed service window, reminder lifecycle conflict, or database idempotency conflict.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" }
          }
        }
      },
      "RateLimited": {
        "description": "Per-minute API rate limit or daily API send limit exceeded.",
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait when the per-minute rate limit is exceeded.",
            "schema": { "type": "integer", "minimum": 0 }
          }
        },
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" }
          }
        }
      },
      "InternalError": {
        "description": "Sanitized internal server error.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "Message storage is temporarily unavailable.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" }
          }
        }
      }
    }
  }
}
