{
  "openapi": "3.1.0",
  "info": {
    "title": "Sweeppea API v3",
    "version": "3.0.0",
    "description": "Complete REST API for managing sweepstakes, participants, winners, rules, notes, calendar events, billing, and more. All endpoints require Bearer token authentication via the Authorization header. Base URL: https://api-v3.sweeppea.com",
    "contact": {
      "name": "Sweeppea Support",
      "url": "https://www.sweeppea.com"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://www.sweeppea.com"
    }
  },
  "externalDocs": {
    "description": "Full API Documentation",
    "url": "https://apidocs.sweeppea.com/"
  },
  "servers": [
    {
      "url": "https://api-v3.sweeppea.com",
      "description": "Production server"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Token",
        "description": "API token obtained from your Sweeppea account. Include as: Authorization: Bearer YOUR_API_TOKEN"
      }
    },
    "schemas": {
      "SuccessResponse": {
        "type": "object",
        "properties": {
          "Response": {
            "type": "boolean",
            "example": true
          },
          "Message": {
            "type": "string"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "Response": {
            "type": "boolean",
            "example": false
          },
          "Message": {
            "type": "string"
          }
        }
      },
      "Pagination": {
        "type": "object",
        "properties": {
          "Page": {
            "type": "integer"
          },
          "Limit": {
            "type": "integer"
          },
          "Total": {
            "type": "integer"
          },
          "TotalPages": {
            "type": "integer"
          }
        }
      },
      "Sweepstakes": {
        "type": "object",
        "properties": {
          "SweepstakesToken": {
            "type": "string",
            "format": "uuid"
          },
          "UserToken": {
            "type": "string",
            "format": "uuid"
          },
          "SweepstakesName": {
            "type": "string"
          },
          "SweepstakesType": {
            "type": "integer",
            "description": "1=SMS, 2=Email, 3=Social"
          },
          "Handler": {
            "type": "string",
            "maxLength": 20
          },
          "Settings": {
            "type": "object"
          },
          "Notes": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "AdminChecklist": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "Score": {
            "type": "integer"
          },
          "Archived": {
            "type": "boolean"
          },
          "Status": {
            "type": "boolean"
          },
          "CreationDate": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Participant": {
        "type": "object",
        "properties": {
          "ParticipantToken": {
            "type": "string",
            "format": "uuid"
          },
          "UserToken": {
            "type": "string",
            "format": "uuid"
          },
          "SweepstakesToken": {
            "type": "string",
            "format": "uuid"
          },
          "KeyEmail": {
            "type": "string",
            "format": "email"
          },
          "KeyPhoneNumber": {
            "type": "string",
            "description": "US or Canada phone number. Accepted: \"2025550100\", \"+12025550100\" (E.164), \"(202) 555-0100\", \"202-555-0100\", \"12025550100\". Normalized to 10 digits before storage. A non-+1 country code is rejected."
          },
          "FirstName": {
            "type": "string"
          },
          "LastName": {
            "type": "string"
          },
          "BonusEntries": {
            "type": "integer"
          },
          "CreationDate": {
            "type": "string",
            "format": "date-time"
          },
          "Status": {
            "type": "boolean"
          },
          "Collection": {
            "type": "string",
            "enum": [
              "Participants",
              "ParticipantsAmoe",
              "OptOuts"
            ]
          }
        }
      },
      "Winner": {
        "type": "object",
        "properties": {
          "ParticipantToken": {
            "type": "string",
            "format": "uuid"
          },
          "FirstName": {
            "type": "string"
          },
          "LastName": {
            "type": "string"
          },
          "Email": {
            "type": "string",
            "format": "email"
          },
          "PhoneNumber": {
            "type": "string"
          }
        }
      },
      "Rule": {
        "type": "object",
        "properties": {
          "RulesToken": {
            "type": "string",
            "format": "uuid"
          },
          "SweepstakesToken": {
            "type": "string",
            "format": "uuid"
          },
          "Title": {
            "type": "string",
            "maxLength": 100
          },
          "Primary": {
            "type": "boolean"
          },
          "CreationDate": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Note": {
        "type": "object",
        "properties": {
          "NoteToken": {
            "type": "string",
            "format": "uuid"
          },
          "Title": {
            "type": "string",
            "maxLength": 100
          },
          "Pinned": {
            "type": "boolean"
          },
          "CreationDate": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CalendarEvent": {
        "type": "object",
        "properties": {
          "EventToken": {
            "type": "string",
            "format": "uuid"
          },
          "EventTitle": {
            "type": "string"
          },
          "EventStartDate": {
            "type": "string",
            "format": "date-time"
          },
          "EventEndDate": {
            "type": "string",
            "format": "date-time"
          },
          "EventDescription": {
            "type": "string"
          },
          "EventLocation": {
            "type": "string"
          },
          "EventColor": {
            "type": "string"
          },
          "EventAllDay": {
            "type": "boolean"
          },
          "EventStatus": {
            "type": "boolean"
          },
          "PrivateEvent": {
            "type": "boolean"
          },
          "Completed": {
            "type": "boolean"
          },
          "CreationDate": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Group": {
        "type": "object",
        "properties": {
          "GroupToken": {
            "type": "string",
            "format": "uuid"
          },
          "UserToken": {
            "type": "string",
            "format": "uuid"
          },
          "SweepstakesToken": {
            "type": "string",
            "format": "uuid"
          },
          "GroupName": {
            "type": "string"
          },
          "Primary": {
            "type": "boolean"
          },
          "Locked": {
            "type": "boolean"
          },
          "CreationDate": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Ticket": {
        "type": "object",
        "properties": {
          "TicketToken": {
            "type": "string",
            "format": "uuid"
          },
          "CaseNumber": {
            "type": "string"
          },
          "Subject": {
            "type": "string"
          },
          "Priority": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "Status": {
            "type": "string",
            "enum": [
              "open",
              "closed"
            ]
          },
          "CreationDate": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Invalid or missing Bearer token",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "Response": false,
              "Message": "Unauthorized. Invalid or missing API token."
            }
          }
        }
      },
      "Forbidden": {
        "description": "Access denied (invalid API token, account disabled, or domain restriction)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "Response": false,
              "Message": "Forbidden. Access denied."
            }
          }
        }
      },
      "NotFound": {
        "description": "Resource not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "Response": false,
              "Message": "Resource not found."
            }
          }
        }
      },
      "BadRequest": {
        "description": "Invalid or missing parameters",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "Response": false,
              "Message": "Missing required field: SweepstakesToken."
            }
          }
        }
      },
      "RateLimited": {
        "description": "Too many concurrent requests. Use exponential backoff.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "Response": false,
              "Message": "Too many requests. Please retry later."
            }
          }
        }
      },
      "InternalError": {
        "description": "Internal server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Account",
      "description": "Account profile, business info, and plan details"
    },
    {
      "name": "Entry Page",
      "description": "Entry page fields for sweepstakes"
    },
    {
      "name": "Sweepstakes",
      "description": "Create, manage, and control sweepstakes campaigns"
    },
    {
      "name": "Participants",
      "description": "Add and manage sweepstakes participants"
    },
    {
      "name": "Groups",
      "description": "Participant group management"
    },
    {
      "name": "Winners",
      "description": "Draw and manage winners"
    },
    {
      "name": "Codes & Coupons",
      "description": "Create, generate, assign, redeem and send coupon codes of a sweepstakes, and configure how its entry and AMOE pages hand them out. Write endpoints require the Codes & Coupons module."
    },
    {
      "name": "Rules",
      "description": "Official rules documents management"
    },
    {
      "name": "Notes",
      "description": "Encrypted personal notes"
    },
    {
      "name": "Calendar",
      "description": "Calendar events management"
    },
    {
      "name": "Billing",
      "description": "Billing transactions and consumptions"
    },
    {
      "name": "Wallet",
      "description": "Wallet transaction history"
    },
    {
      "name": "Invoices",
      "description": "Create, publish, track and cancel invoices with a public payment link"
    },
    {
      "name": "Messaging",
      "description": "Read email and SMS campaigns, their reports and recipients; pause, resume or cancel them; read drip campaigns (automated sequences), their reports and enrollments, pause or resume them and take a contact out; manage the do-not-contact list; and queue a direct message to one participant. Campaigns and drips are created and launched only in the Sweeppea app."
    },
    {
      "name": "Surveys",
      "description": "Build surveys, collect answers on the public HUB form and read the aggregated report"
    },
    {
      "name": "Todos",
      "description": "To-Do task management"
    },
    {
      "name": "Support",
      "description": "Support ticket management"
    },
    {
      "name": "Help",
      "description": "Fetch API documentation programmatically"
    },
    {
      "name": "Tools",
      "description": "Utility data: timezones, states, zipcodes, area codes, countries"
    }
  ],
  "paths": {
    "/account/health-check": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Health Check",
        "description": "Verify that the API is healthy and the provided Bearer token is valid.",
        "operationId": "accountHealthCheck",
        "responses": {
          "200": {
            "description": "API is healthy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean",
                      "example": true
                    },
                    "Message": {
                      "type": "string",
                      "example": "API is healthy"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/account/profile": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Fetch Profile Info",
        "description": "Retrieve the authenticated user's profile information including personal data and account status.",
        "operationId": "accountProfile",
        "responses": {
          "200": {
            "description": "Profile data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Data": {
                      "type": "object",
                      "properties": {
                        "UserToken": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "Nickname": {
                          "type": "string"
                        },
                        "Email": {
                          "type": "string",
                          "format": "email"
                        },
                        "UserType": {
                          "type": "integer"
                        },
                        "Status": {
                          "type": "boolean"
                        },
                        "CreationDate": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "LastLogin": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "IsShopifyAccount": {
                          "type": "boolean"
                        },
                        "ProfileData": {
                          "type": "object",
                          "properties": {
                            "FullName": {
                              "type": "string"
                            },
                            "MobilePhone": {
                              "type": "string"
                            },
                            "Address": {
                              "type": "string"
                            },
                            "City": {
                              "type": "string"
                            },
                            "State": {
                              "type": "string"
                            },
                            "ZipCode": {
                              "type": "string"
                            },
                            "Country": {
                              "type": "string"
                            },
                            "Avatar": {
                              "type": "string"
                            },
                            "BirthDate": {
                              "type": "string",
                              "format": "date-time"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/account/business": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Fetch Business Info",
        "description": "Retrieve the authenticated user's business information.",
        "operationId": "accountBusiness",
        "responses": {
          "200": {
            "description": "Business data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Data": {
                      "type": "object",
                      "properties": {
                        "BusinessName": {
                          "type": "string"
                        },
                        "BusinessTelephone": {
                          "type": "string"
                        },
                        "BusinessAddress": {
                          "type": "string"
                        },
                        "BusinessCity": {
                          "type": "string"
                        },
                        "BusinessState": {
                          "type": "string"
                        },
                        "BusinessZipCode": {
                          "type": "string"
                        },
                        "BusinessCountry": {
                          "type": "string"
                        },
                        "BusinessWebsite": {
                          "type": "string"
                        },
                        "EIN": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/account/plan": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Fetch Plan Details",
        "description": "Retrieve the current subscription plan details including limits, pricing, and enabled modules. Requires a wildcard (*) domain in API domains.",
        "operationId": "accountPlan",
        "responses": {
          "200": {
            "description": "Plan details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Data": {
                      "type": "object",
                      "properties": {
                        "PlanToken": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "Name": {
                          "type": "string"
                        },
                        "Description": {
                          "type": "string"
                        },
                        "Primary": {
                          "type": "boolean"
                        },
                        "Locked": {
                          "type": "boolean"
                        },
                        "CreationDate": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "Settings": {
                          "type": "object",
                          "properties": {
                            "ChargePerSweepstakes": {
                              "type": "boolean"
                            },
                            "Frequency": {
                              "type": "string"
                            },
                            "SubscriptionPrice": {
                              "type": "number"
                            },
                            "FixedPrice": {
                              "type": "number"
                            },
                            "CostPerGigaByte": {
                              "type": "number"
                            },
                            "ExtraCredits": {
                              "type": "number"
                            },
                            "WalletMinToDeposit": {
                              "type": "number"
                            },
                            "WalletMinToWithdraw": {
                              "type": "number"
                            },
                            "MaxSweepstakesAllowed": {
                              "type": "integer"
                            },
                            "MaxStorageSize": {
                              "type": "integer"
                            },
                            "MaxParticipantsAllowed": {
                              "type": "integer"
                            },
                            "MaxApiCallsAllowed": {
                              "type": "integer",
                              "description": "Monthly API call allowance for the whole account. Resets on the first day of each month."
                            },
                            "MaxApiCallsPerMinute": {
                              "type": "integer",
                              "description": "API RATE limit: how many calls this account may make in any sixty second window, across every endpoint. This is a rate, not an allowance - it never resets and there is no unlimited, so it is never reported as 0. Going over it returns HTTP 429 with a Retry-After header; a refused call is not logged and therefore does not consume MaxApiCallsAllowed. Plans created before this setting default to 150. Range 50 to 10000."
                            },
                            "MaxInvoicesAllowed": {
                              "type": "integer",
                              "description": "Maximum invoices allowed across the whole account. 0 means unlimited. Plans created before the Invoices module default to 100."
                            },
                            "MaxSurveysAllowed": {
                              "type": "integer",
                              "description": "Maximum surveys allowed across the whole account. 0 means unlimited. Plans created before the Surveys module default to 3."
                            },
                            "MaxAiTokensAllowed": {
                              "type": "integer",
                              "description": "Monthly, account-wide AI token allowance shared by every AI surface of the ecosystem (assistants, widgets, entry page, marketing assets, prize ideas, surveys AI, rules analyzer, the API v1 assistant and AI Studio in STUDIO mode). Resets on the first day of each month. 0 means unlimited. Plans created before the AI token cap default to 1,000,000."
                            },
                            "MaxAgentsAllowed": {
                              "type": "integer",
                              "description": "Agents (assistants) the account may create. Account-wide and historical. 0 means unlimited. Plans created before the Agents module default to 3."
                            },
                            "MaxEmailsPerMonth": {
                              "type": "integer",
                              "description": "Monthly, account-wide allowance of client-originated emails sent through the Messaging Engine (campaigns, registration confirmations, coupons, winner notices, agent actions). Platform mail such as password resets is not counted. Resets on the first day of the month in the ACCOUNT'S timezone. 0 means unlimited. Plans created before the Messaging Engine default to 1000."
                            },
                            "MaxSmsPerMonth": {
                              "type": "integer",
                              "description": "Monthly, account-wide SMS allowance counted in SEGMENTS, not messages: a text longer than 160 characters, or one carrying a single emoji, is billed as more than one segment, so presenting this as a message count overstates it by up to 3x. 0 means unlimited. Plans created before the Messaging Engine default to 1000."
                            },
                            "MaxEmailTemplatesAllowed": {
                              "type": "integer",
                              "description": "Saved email LAYOUTS the account may keep (header/body/footer chrome), not the mail sent through them. Account-wide. 0 means unlimited. Plans created before the Messaging Engine default to 5."
                            },
                            "AllowEmailMessaging": {
                              "type": "boolean",
                              "description": "Whether the plan lets the account send email through the Messaging Engine at all. Separate from AllowSmsMessaging on purpose. A plan that does not carry the key reports false."
                            },
                            "AllowSmsMessaging": {
                              "type": "boolean",
                              "description": "Whether the plan lets the account send SMS. Separate from AllowEmailMessaging because SMS carries 10DLC registration, per-carrier daily caps and a quiet-hours regime email does not. A plan that does not carry the key reports false."
                            },
                            "PaidModuleCreateSweepstakes": {
                              "type": "boolean"
                            },
                            "PaidModuleCreateEntryPage": {
                              "type": "boolean"
                            },
                            "PaidModuleCreateOfficialRules": {
                              "type": "boolean"
                            },
                            "PaidModuleManageParticipants": {
                              "type": "boolean"
                            },
                            "PaidModuleSendMessages": {
                              "type": "boolean"
                            },
                            "PaidModuleDrawWinners": {
                              "type": "boolean"
                            },
                            "PaidModuleSeeReports": {
                              "type": "boolean"
                            },
                            "PaidModuleManageDomains": {
                              "type": "boolean"
                            },
                            "PaidModuleManageCoupons": {
                              "type": "boolean"
                            },
                            "PaidModuleAccessDrive": {
                              "type": "boolean"
                            },
                            "PaidModuleAccessCalendar": {
                              "type": "boolean"
                            },
                            "PaidModuleManageNotes": {
                              "type": "boolean"
                            },
                            "PaidModuleCreateSurveys": {
                              "type": "boolean"
                            },
                            "PaidModuleAccessAPI": {
                              "type": "boolean"
                            },
                            "PaidModuleManageDripMarketing": {
                              "type": "boolean"
                            },
                            "MaxDripCampaignsAllowed": {
                              "type": "integer",
                              "description": "Drip campaigns the account may create (drafts and archived count). 0 = unlimited"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/entrypage/fields": {
      "post": {
        "tags": [
          "Entry Page"
        ],
        "summary": "Fetch Entry Page Fields",
        "description": "Retrieve the form fields configured for a sweepstakes entry page. Use this to know the exact field names and types before adding participants.",
        "operationId": "entrypageFields",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SweepstakesToken"
                ],
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of the sweepstakes"
                  }
                }
              },
              "example": {
                "SweepstakesToken": "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Entry page fields",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Data": {
                      "type": "object",
                      "properties": {
                        "SweepstakesToken": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "EntryPageToken": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "KeyEmail": {
                          "type": "string"
                        },
                        "KeyPhoneNumber": {
                          "type": "string",
                          "description": "US or Canada phone number. Accepted: \"2025550100\", \"+12025550100\" (E.164), \"(202) 555-0100\", \"202-555-0100\", \"12025550100\". Normalized to 10 digits before storage. A non-+1 country code is rejected."
                        },
                        "FormFields": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "FieldID": {
                                "type": "string"
                              },
                              "FieldType": {
                                "type": "string"
                              },
                              "FieldName": {
                                "type": "string"
                              },
                              "FieldPlaceholder": {
                                "type": "string"
                              },
                              "FieldRequired": {
                                "type": "boolean"
                              },
                              "PrimaryField": {
                                "type": "boolean"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/sweepstakes/create": {
      "post": {
        "tags": [
          "Sweepstakes"
        ],
        "summary": "Create Sweepstakes",
        "description": "Create a new sweepstakes campaign. Automatically generates an entry page, S3 folder, short links, QR codes, and a primary participant group. Also awards +3 user scoring points.",
        "operationId": "sweepstakesCreate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SweepstakesName",
                  "SweepstakesType",
                  "Handler",
                  "StartDate",
                  "EndDate",
                  "StartTime",
                  "EndTime"
                ],
                "properties": {
                  "SweepstakesName": {
                    "type": "string",
                    "description": "Name of the sweepstakes (max 200 characters)",
                    "maxLength": 200
                  },
                  "SweepstakesType": {
                    "type": "integer",
                    "enum": [
                      1,
                      2,
                      3
                    ],
                    "description": "1=SMS, 2=Email, 3=Social"
                  },
                  "Handler": {
                    "type": "string",
                    "maxLength": 20,
                    "pattern": "^[A-Z0-9]+$",
                    "description": "Unique alphanumeric identifier (auto-uppercased, max 20 chars)"
                  },
                  "StartDate": {
                    "type": "string",
                    "format": "date",
                    "description": "Start date (YYYY-MM-DD). Must be today or future."
                  },
                  "EndDate": {
                    "type": "string",
                    "format": "date",
                    "description": "End date (YYYY-MM-DD). Must be >= StartDate."
                  },
                  "StartTime": {
                    "type": "string",
                    "pattern": "^[0-2][0-9]:[0-5][0-9]$",
                    "description": "Start time in HH:MM 24-hour format"
                  },
                  "EndTime": {
                    "type": "string",
                    "pattern": "^[0-2][0-9]:[0-5][0-9]$",
                    "description": "End time in HH:MM 24-hour format"
                  },
                  "CreateInCalendar": {
                    "type": "boolean",
                    "default": false,
                    "description": "Auto-create calendar event"
                  },
                  "SyncWithWinners": {
                    "type": "boolean",
                    "default": false
                  },
                  "DeleteIfDeleted": {
                    "type": "boolean",
                    "default": false
                  },
                  "DeleteIfAcctDeleted": {
                    "type": "boolean",
                    "default": false
                  }
                }
              },
              "example": {
                "SweepstakesName": "Summer Giveaway 2026",
                "SweepstakesType": 2,
                "Handler": "SUMMER2026",
                "StartDate": "2026-03-01",
                "EndDate": "2026-03-31",
                "StartTime": "00:00",
                "EndTime": "23:59",
                "CreateInCalendar": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sweepstakes created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Message": {
                      "type": "string"
                    },
                    "Data": {
                      "$ref": "#/components/schemas/Sweepstakes"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/sweepstakes/clone": {
      "post": {
        "tags": [
          "Sweepstakes"
        ],
        "summary": "Clone Sweepstakes",
        "description": "Clone an existing sweepstakes into a new one with a new handler, name, and dates.",
        "operationId": "sweepstakesClone",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "Handler",
                  "HandlerNew",
                  "SweepstakesName",
                  "StartDate",
                  "EndDate",
                  "StartTime",
                  "EndTime"
                ],
                "properties": {
                  "Handler": {
                    "type": "string",
                    "description": "Handler of the original sweepstakes to clone"
                  },
                  "HandlerNew": {
                    "type": "string",
                    "maxLength": 20,
                    "description": "Handler for the new cloned sweepstakes"
                  },
                  "SweepstakesName": {
                    "type": "string",
                    "description": "Name for the new sweepstakes"
                  },
                  "StartDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "EndDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "StartTime": {
                    "type": "string",
                    "pattern": "^[0-2][0-9]:[0-5][0-9]$"
                  },
                  "EndTime": {
                    "type": "string",
                    "pattern": "^[0-2][0-9]:[0-5][0-9]$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sweepstakes cloned",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Message": {
                      "type": "string"
                    },
                    "SweepstakesToken": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "SweepstakesType": {
                      "type": "integer"
                    },
                    "SweepstakesName": {
                      "type": "string"
                    },
                    "Handler": {
                      "type": "string"
                    },
                    "StartDate": {
                      "type": "string",
                      "format": "date"
                    },
                    "EndDate": {
                      "type": "string",
                      "format": "date"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "New handler already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/sweepstakes/fetch": {
      "post": {
        "tags": [
          "Sweepstakes"
        ],
        "summary": "Fetch All Sweepstakes",
        "description": "Retrieve all sweepstakes belonging to the authenticated user, including full settings.",
        "operationId": "sweepstakesFetch",
        "responses": {
          "200": {
            "description": "List of sweepstakes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Sweepstakes"
                      }
                    },
                    "Count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/sweepstakes/update": {
      "post": {
        "tags": [
          "Sweepstakes"
        ],
        "summary": "Update Sweepstakes",
        "description": "Update one or more fields of an existing sweepstakes. At least one optional field must be provided.",
        "operationId": "sweepstakesUpdate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SweepstakesToken"
                ],
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "SweepstakesName": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "StartDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "EndDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "StartTime": {
                    "type": "string",
                    "pattern": "^[0-2][0-9]:[0-5][0-9]$"
                  },
                  "EndTime": {
                    "type": "string",
                    "pattern": "^[0-2][0-9]:[0-5][0-9]$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sweepstakes updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Message": {
                      "type": "string"
                    },
                    "Data": {
                      "$ref": "#/components/schemas/Sweepstakes"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/sweepstakes/delete": {
      "post": {
        "tags": [
          "Sweepstakes"
        ],
        "summary": "Delete Sweepstakes",
        "description": "Permanently delete a sweepstakes and all associated data (participants, entry pages, statistics, groups, rules, calendar events, short links, coupons, automations).",
        "operationId": "sweepstakesDelete",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SweepstakesToken"
                ],
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/sweepstakes/pause": {
      "post": {
        "tags": [
          "Sweepstakes"
        ],
        "summary": "Pause Sweepstakes",
        "description": "Pause an active sweepstakes, temporarily stopping new entries.",
        "operationId": "sweepstakesPause",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SweepstakesToken"
                ],
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Paused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/sweepstakes/unpause": {
      "post": {
        "tags": [
          "Sweepstakes"
        ],
        "summary": "Unpause Sweepstakes",
        "description": "Resume a previously paused sweepstakes.",
        "operationId": "sweepstakesUnpause",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SweepstakesToken"
                ],
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Unpaused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/participants/add": {
      "post": {
        "tags": [
          "Participants"
        ],
        "summary": "Add Participant",
        "description": "Add a new participant to a sweepstakes. Field names with spaces must use underscores (e.g., 'First_Name'). Use the /entrypage/fields endpoint first to get the correct field names.",
        "operationId": "participantsAdd",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "lang",
                  "source",
                  "sweepstakesToken",
                  "entryPageFields"
                ],
                "properties": {
                  "lang": {
                    "type": "string",
                    "example": "EN",
                    "description": "Language code (e.g., EN)"
                  },
                  "source": {
                    "type": "string",
                    "example": "api",
                    "description": "Entry source identifier"
                  },
                  "sweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "entryPageFields": {
                    "type": "object",
                    "properties": {
                      "KeyPhoneNumber": {
                        "type": "string",
                        "description": "US or Canada phone number. Accepted: \"2025550100\", \"+12025550100\" (E.164), \"(202) 555-0100\", \"202-555-0100\", \"12025550100\". Normalized to 10 digits before storage. A non-+1 country code is rejected."
                      },
                      "KeyEmail": {
                        "type": "string",
                        "format": "email"
                      },
                      "BonusEntries": {
                        "type": "integer",
                        "default": 0,
                        "description": "Additional entries to give this participant"
                      },
                      "Fields": {
                        "type": "object",
                        "description": "Custom form fields. Replace spaces in field names with underscores (e.g., First_Name, Last_Name)."
                      }
                    }
                  }
                }
              },
              "example": {
                "lang": "EN",
                "source": "api",
                "sweepstakesToken": "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",
                "entryPageFields": {
                  "KeyEmail": "john@example.com",
                  "KeyPhoneNumber": "+15551234567",
                  "BonusEntries": 0,
                  "Fields": {
                    "First_Name": "John",
                    "Last_Name": "Doe"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Participant added",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/participants/fetch": {
      "post": {
        "tags": [
          "Participants"
        ],
        "summary": "Fetch Participants",
        "description": "Retrieve participants for a sweepstakes with pagination, search, and date filtering. Returns 20 results per page sorted by newest first. Searches across Participants, ParticipantsAmoe, and OptOuts collections.",
        "operationId": "participantsFetch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sweepstakesToken"
                ],
                "properties": {
                  "sweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "page": {
                    "type": "integer",
                    "default": 1,
                    "description": "Page number"
                  },
                  "search": {
                    "type": "string",
                    "description": "Search term (matches FirstName, LastName, Email, Phone)"
                  },
                  "optInDate": {
                    "type": "string",
                    "format": "date",
                    "description": "Filter by specific opt-in date (YYYY-MM-DD)"
                  },
                  "startDate": {
                    "type": "string",
                    "format": "date",
                    "description": "Date range start (requires endDate)"
                  },
                  "endDate": {
                    "type": "string",
                    "format": "date",
                    "description": "Date range end (requires startDate)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Participants list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Participants": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Participant"
                      }
                    },
                    "Pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/participants/count": {
      "post": {
        "tags": [
          "Participants"
        ],
        "summary": "Count Participants",
        "description": "Get participant counts for a sweepstakes, broken down by collection type (Participants, AMOE, OptOuts) with optional date range filtering.",
        "operationId": "participantsCount",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SweepstakesToken"
                ],
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "FilterType": {
                    "type": "string",
                    "enum": [
                      "all",
                      "participants",
                      "amoe",
                      "optouts"
                    ],
                    "default": "all"
                  },
                  "StartDate": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "EndDate": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Participant counts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Data": {
                      "type": "object",
                      "properties": {
                        "SweepstakesToken": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "FilterType": {
                          "type": "string"
                        },
                        "DateRange": {
                          "type": "object"
                        },
                        "Counts": {
                          "type": "object",
                          "properties": {
                            "Participants": {
                              "type": "integer"
                            },
                            "AmoeParticipants": {
                              "type": "integer"
                            },
                            "OptOuts": {
                              "type": "integer"
                            },
                            "Total": {
                              "type": "integer"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/participants/single": {
      "post": {
        "tags": [
          "Participants"
        ],
        "summary": "Fetch Single Participant",
        "description": "Retrieve a single participant by token, email, or phone number. At least one search parameter (ParticipantToken, KeyEmail, or KeyPhoneNumber) is required.",
        "operationId": "participantsSingle",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SweepstakesToken"
                ],
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "ParticipantToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Search by participant token"
                  },
                  "KeyEmail": {
                    "type": "string",
                    "format": "email",
                    "description": "Search by email"
                  },
                  "KeyPhoneNumber": {
                    "type": "string",
                    "description": "US or Canada phone number. Accepted: \"2025550100\", \"+12025550100\" (E.164), \"(202) 555-0100\", \"202-555-0100\", \"12025550100\". Normalized to 10 digits before storage. A non-+1 country code is rejected."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Participant data with all entries across collections",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Data": {
                      "type": "object",
                      "properties": {
                        "SweepstakesToken": {
                          "type": "string"
                        },
                        "SweepstakesName": {
                          "type": "string"
                        },
                        "TotalEntries": {
                          "type": "integer"
                        },
                        "Collections": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "Entries": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Participant"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/participants/delete": {
      "delete": {
        "tags": [
          "Participants"
        ],
        "summary": "Delete Participant",
        "description": "Permanently delete a participant from all collections (Participants, AMOE, OptOuts) within a sweepstakes.",
        "operationId": "participantsDelete",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SweepstakesToken",
                  "ParticipantToken"
                ],
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "ParticipantToken": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Participant deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Message": {
                      "type": "string"
                    },
                    "Data": {
                      "type": "object",
                      "properties": {
                        "ParticipantToken": {
                          "type": "string"
                        },
                        "SweepstakesToken": {
                          "type": "string"
                        },
                        "DeletedFrom": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "DeletedCount": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/groups/create": {
      "post": {
        "tags": [
          "Groups"
        ],
        "summary": "Create Group",
        "description": "Create a new participant group within a sweepstakes. Group names must be unique within the sweepstakes.",
        "operationId": "groupsCreate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sweepstakesToken",
                  "groupName"
                ],
                "properties": {
                  "sweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "groupName": {
                    "type": "string",
                    "description": "Unique name for this group within the sweepstakes (max 100 characters)",
                    "maxLength": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Group created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Message": {
                      "type": "string"
                    },
                    "Data": {
                      "$ref": "#/components/schemas/Group"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/groups/fetch": {
      "post": {
        "tags": [
          "Groups"
        ],
        "summary": "Fetch Groups",
        "description": "Retrieve all participant groups for a sweepstakes.",
        "operationId": "groupsFetch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sweepstakesToken"
                ],
                "properties": {
                  "sweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Groups list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Group"
                      }
                    },
                    "Count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/groups/update": {
      "post": {
        "tags": [
          "Groups"
        ],
        "summary": "Update Group",
        "description": "Rename a participant group. The new name must be unique within the sweepstakes.",
        "operationId": "groupsUpdate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sweepstakesToken",
                  "groupToken",
                  "groupName"
                ],
                "properties": {
                  "sweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "groupToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "groupName": {
                    "type": "string",
                    "description": "New unique name for the group"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Group updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/groups/delete": {
      "post": {
        "tags": [
          "Groups"
        ],
        "summary": "Delete Group",
        "description": "Delete a participant group. Cannot delete primary groups, locked groups, or groups that contain participants.",
        "operationId": "groupsDelete",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sweepstakesToken",
                  "groupToken"
                ],
                "properties": {
                  "sweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "groupToken": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Group deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/winners/draw": {
      "post": {
        "tags": [
          "Winners"
        ],
        "summary": "Draw Winners",
        "description": "Randomly draw winners from eligible participants using a weighted algorithm (bonus entries increase selection probability). The sweepstakes must not be paused or archived.",
        "operationId": "winnersDraw",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sweepstakesToken",
                  "howManyWinnersToPick",
                  "group"
                ],
                "properties": {
                  "sweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "howManyWinnersToPick": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "group": {
                    "type": "string",
                    "description": "Use 'allgroups' or a specific GroupToken"
                  },
                  "completedEntries": {
                    "type": "boolean",
                    "default": false
                  },
                  "includeOptedOutParticipants": {
                    "type": "boolean",
                    "default": false
                  },
                  "doNotIncludeSpamParticipants": {
                    "type": "boolean",
                    "default": true
                  }
                }
              },
              "example": {
                "sweepstakesToken": "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",
                "howManyWinnersToPick": 3,
                "group": "allgroups",
                "doNotIncludeSpamParticipants": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Winners drawn",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Message": {
                      "type": "string"
                    },
                    "Winners": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Winner"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/winners/fetch": {
      "post": {
        "tags": [
          "Winners"
        ],
        "summary": "Fetch Winners",
        "description": "Retrieve all drawn winners for a sweepstakes with pagination and search.",
        "operationId": "winnersFetch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sweepstakesToken"
                ],
                "properties": {
                  "sweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "page": {
                    "type": "integer",
                    "default": 1
                  },
                  "itemsPerPage": {
                    "type": "integer",
                    "default": 10
                  },
                  "search": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Winners list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Message": {
                      "type": "string"
                    },
                    "TotalWinners": {
                      "type": "integer"
                    },
                    "Winners": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/winners/schedule": {
      "post": {
        "tags": [
          "Winners"
        ],
        "summary": "Schedule Drawing",
        "description": "Schedule an automated winner drawing for a future date and time, with optional recurring frequency.",
        "operationId": "winnersSchedule",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sweepstakesToken",
                  "group",
                  "selectedAction",
                  "scheduleMode",
                  "howManyWinnersToPick",
                  "endDate",
                  "endTime",
                  "timezone"
                ],
                "properties": {
                  "sweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "group": {
                    "type": "string"
                  },
                  "selectedAction": {
                    "type": "integer",
                    "enum": [
                      1,
                      2
                    ],
                    "description": "1=Draw only, 2=Draw & Notify"
                  },
                  "scheduleMode": {
                    "type": "string",
                    "enum": [
                      "schedule",
                      "settime"
                    ]
                  },
                  "howManyWinnersToPick": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "frequency": {
                    "type": "integer",
                    "enum": [
                      0,
                      1,
                      2,
                      3,
                      4
                    ],
                    "description": "0=None, 1=Hourly, 2=Daily, 3=Weekly, 4=Monthly"
                  },
                  "dayOfTheWeek": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 7,
                    "description": "1=Sunday...7=Saturday"
                  },
                  "weekOfTheMonth": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 4
                  },
                  "endDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "endTime": {
                    "type": "string",
                    "pattern": "^[0-2][0-9]:[0-5][0-9]$"
                  },
                  "timezone": {
                    "type": "integer"
                  },
                  "message": {
                    "type": "string"
                  },
                  "includeOptedOutParticipants": {
                    "type": "boolean"
                  },
                  "publishToWinnersPage": {
                    "type": "boolean"
                  },
                  "sendCopyToMe": {
                    "type": "boolean"
                  },
                  "doNotIncludeSpamParticipants": {
                    "type": "boolean"
                  },
                  "addDrawingToCalendar": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Drawing scheduled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/winners/fetchscheduled": {
      "get": {
        "tags": [
          "Winners"
        ],
        "summary": "Fetch Scheduled Drawings",
        "description": "Retrieve all scheduled drawings for a sweepstakes.",
        "operationId": "winnersFetchScheduled",
        "parameters": [
          {
            "name": "sweepstakesToken",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "UUID v4 of the sweepstakes"
          }
        ],
        "responses": {
          "200": {
            "description": "Scheduled drawings list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/winners/deletescheduled": {
      "delete": {
        "tags": [
          "Winners"
        ],
        "summary": "Delete Scheduled Drawing",
        "description": "Cancel and delete a previously scheduled winner drawing.",
        "operationId": "winnersDeleteScheduled",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sweepstakesToken",
                  "scheduledToken"
                ],
                "properties": {
                  "sweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "scheduledToken": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Scheduled drawing deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/codes/stats": {
      "post": {
        "tags": [
          "Codes & Coupons"
        ],
        "summary": "Fetch Code Statistics",
        "description": "Count the codes of a sweepstakes: total, assigned, unassigned, redeemed, voided and available.",
        "operationId": "codesStats",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SweepstakesToken"
                ],
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of a sweepstakes of your account"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Code Statistics — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "SweepstakesToken": "uuid-v4-string",
                    "Total": 5000,
                    "Assigned": 1320,
                    "Unassigned": 3680,
                    "Redeemed": 410,
                    "Voided": 12,
                    "Available": 3668
                  },
                  "Message": "Code statistics fetched successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/codes/fetch": {
      "post": {
        "tags": [
          "Codes & Coupons"
        ],
        "summary": "Fetch Codes",
        "description": "One page of a sweepstakes' codes, filtered, searched and sorted on the server, with the participant each code is assigned to.",
        "operationId": "codesFetch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SweepstakesToken"
                ],
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of a sweepstakes of your account"
                  },
                  "Filter": {
                    "type": "string",
                    "enum": [
                      "all",
                      "assigned",
                      "unassigned",
                      "redeemed",
                      "not-redeemed",
                      "voided",
                      "available"
                    ],
                    "description": "all, assigned, unassigned, redeemed, not-redeemed, voided, available. Defaults to all. available = not redeemed and not assigned"
                  },
                  "Search": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "Part of a code, or of the email / phone of the assigned participant (case-insensitive, max 100 characters)"
                  },
                  "SortBy": {
                    "type": "string",
                    "enum": [
                      "CouponCode",
                      "ExpirationDate",
                      "Status",
                      "CreationDate",
                      "RedemptionDate"
                    ],
                    "description": "CouponCode, ExpirationDate, Status, CreationDate, RedemptionDate. Defaults to CreationDate, newest first"
                  },
                  "SortDesc": {
                    "type": "boolean",
                    "description": "true for descending order (applies with SortBy)"
                  },
                  "Page": {
                    "type": "integer",
                    "minimum": 1,
                    "default": 1,
                    "description": "Page number, starting at 1. Defaults to 1"
                  },
                  "ItemsPerPage": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 500,
                    "default": 25,
                    "description": "1 to 500. Defaults to 25"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fetch Codes — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Codes": [
                      {
                        "CouponToken": "uuid-v4-string",
                        "SweepstakesToken": "uuid-v4-string",
                        "CouponCode": "SUMMER-7QK2P9",
                        "Description": "$10 off your next order",
                        "Value": "$10",
                        "ExternalURL": "https://shop.example.com/redeem",
                        "ExpirationDate": "2026-12-31T00:00:00.000Z",
                        "ExpirationTime": "23:59",
                        "Status": "not-redeemed",
                        "ParticipantToken": "uuid-v4-string",
                        "AssignedTo": "jane.doe@example.com",
                        "RedemptionDate": null,
                        "RedemptionTime": null,
                        "CreationDate": "2026-09-20T14:02:11.004Z"
                      }
                    ],
                    "TotalResults": 1320,
                    "Page": 1,
                    "ItemsPerPage": 25,
                    "TotalPages": 53,
                    "SearchTruncated": false
                  },
                  "Message": "Codes fetched successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/codes/single": {
      "post": {
        "tags": [
          "Codes & Coupons"
        ],
        "summary": "Fetch Single Code",
        "description": "Fetch one code by its CouponToken, or by the code itself within a sweepstakes (what a point-of-sale system has in hand).",
        "operationId": "codesSingle",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "CouponToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of the code. Required unless CouponCode is sent; takes precedence when both are sent"
                  },
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of the sweepstakes. Required with CouponCode"
                  },
                  "CouponCode": {
                    "type": "string",
                    "maxLength": 20,
                    "pattern": "^[A-Za-z0-9_-]+$",
                    "description": "The code itself — up to 20 letters, digits, - or _; whitespace is removed; matched exactly and case-sensitively"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Single Code — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Code": {
                      "CouponToken": "uuid-v4-string",
                      "SweepstakesToken": "uuid-v4-string",
                      "CouponCode": "SUMMER-7QK2P9",
                      "Description": "$10 off your next order",
                      "Value": "$10",
                      "ExternalURL": "https://shop.example.com/redeem",
                      "ExpirationDate": "2026-12-31T00:00:00.000Z",
                      "ExpirationTime": "23:59",
                      "Status": "not-redeemed",
                      "ParticipantToken": "uuid-v4-string",
                      "AssignedTo": "jane.doe@example.com",
                      "RedemptionDate": null,
                      "RedemptionTime": null,
                      "CreationDate": "2026-09-20T14:02:11.004Z"
                    }
                  },
                  "Message": "Code fetched successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/codes/create": {
      "post": {
        "tags": [
          "Codes & Coupons"
        ],
        "summary": "Create Codes",
        "description": "Add 1 to 1,000 codes you already have (from a POS, a CRM or a printed batch) to a sweepstakes, with shared attributes.",
        "operationId": "codesCreate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SweepstakesToken",
                  "Codes"
                ],
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of a sweepstakes of your account"
                  },
                  "Codes": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "minItems": 1,
                    "maxItems": 1000,
                    "description": "1 to 1,000 codes — up to 20 letters, digits, - or _; whitespace is removed; matched exactly and case-sensitively"
                  },
                  "Description": {
                    "type": "string",
                    "maxLength": 5000,
                    "description": "Applied to every code, max 5,000 characters"
                  },
                  "Value": {
                    "type": "string",
                    "maxLength": 10,
                    "description": "Applied to every code, max 10 characters (e.g. $10, 15%). A number is accepted too"
                  },
                  "ExternalURL": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 500,
                    "description": "https:// link applied to every code, max 500 characters"
                  },
                  "ExpirationDate": {
                    "type": "string",
                    "format": "date",
                    "description": "YYYY-MM-DD, not in the past"
                  },
                  "ExpirationTime": {
                    "type": "string",
                    "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
                    "description": "HH:mm, 24-hour clock"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create Codes — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "SweepstakesToken": "uuid-v4-string",
                    "Received": 4,
                    "Created": 2,
                    "Codes": [
                      {
                        "CouponToken": "uuid-v4-string",
                        "CouponCode": "STORE-0001"
                      },
                      {
                        "CouponToken": "uuid-v4-string",
                        "CouponCode": "STORE-0002"
                      }
                    ],
                    "Duplicates": [
                      "STORE-0002"
                    ],
                    "DuplicateCount": 1,
                    "Invalid": [
                      "bad code!"
                    ],
                    "InvalidCount": 1
                  },
                  "Message": "2 code(s) created"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Codes & Coupons module not enabled"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "422": {
            "description": "Refused by a capacity or delivery check (Data.Code / Data.Channels say why)"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60); or the endpoint daily ceiling (Data.Code)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/codes/generate": {
      "post": {
        "tags": [
          "Codes & Coupons"
        ],
        "summary": "Generate Codes",
        "description": "Generate 1 to 5,000 unique random codes in a sweepstakes, with a chosen length, character set, case, prefix and suffix.",
        "operationId": "codesGenerate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SweepstakesToken",
                  "Quantity",
                  "Length"
                ],
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of a sweepstakes of your account"
                  },
                  "Quantity": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5000,
                    "description": "Whole number, 1 to 5000"
                  },
                  "Length": {
                    "type": "integer",
                    "minimum": 4,
                    "maximum": 20,
                    "description": "Random characters per code, 4 to 20. Prefix + Length + Suffix must not exceed 20"
                  },
                  "Type": {
                    "type": "string",
                    "enum": [
                      "alphanumeric",
                      "numeric"
                    ],
                    "description": "alphanumeric or numeric. Defaults to alphanumeric"
                  },
                  "Case": {
                    "type": "string",
                    "enum": [
                      "upper",
                      "lower",
                      "mixed"
                    ],
                    "description": "upper, lower or mixed (alphanumeric only). Defaults to upper"
                  },
                  "Prefix": {
                    "type": "string",
                    "maxLength": 20,
                    "pattern": "^[A-Za-z0-9_-]+$",
                    "description": "Letters, digits, - or _ placed before every code"
                  },
                  "Suffix": {
                    "type": "string",
                    "maxLength": 20,
                    "pattern": "^[A-Za-z0-9_-]+$",
                    "description": "Letters, digits, - or _ placed after every code"
                  },
                  "Description": {
                    "type": "string",
                    "maxLength": 5000,
                    "description": "Applied to every code, max 5,000 characters"
                  },
                  "Value": {
                    "type": "string",
                    "maxLength": 10,
                    "description": "Applied to every code, max 10 characters (e.g. $10, 15%). A number is accepted too"
                  },
                  "ExternalURL": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 500,
                    "description": "https:// link applied to every code, max 500 characters"
                  },
                  "ExpirationDate": {
                    "type": "string",
                    "format": "date",
                    "description": "YYYY-MM-DD, not in the past"
                  },
                  "ExpirationTime": {
                    "type": "string",
                    "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
                    "description": "HH:mm, 24-hour clock"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generate Codes — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "SweepstakesToken": "uuid-v4-string",
                    "Generated": 3,
                    "Codes": [
                      {
                        "CouponToken": "uuid-v4-string",
                        "CouponCode": "FALL-7QK2P9XA"
                      },
                      {
                        "CouponToken": "uuid-v4-string",
                        "CouponCode": "FALL-M3T8ZC1R"
                      },
                      {
                        "CouponToken": "uuid-v4-string",
                        "CouponCode": "FALL-0HW5JD6N"
                      }
                    ]
                  },
                  "Message": "3 code(s) generated"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Codes & Coupons module not enabled"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "422": {
            "description": "Refused by a capacity or delivery check (Data.Code / Data.Channels say why)"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60); or the endpoint daily ceiling (Data.Code)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/codes/update": {
      "post": {
        "tags": [
          "Codes & Coupons"
        ],
        "summary": "Update Code",
        "description": "Change the attributes of one code. Only the fields sent change; the code itself can be renamed only while unassigned and not redeemed.",
        "operationId": "codesUpdate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "CouponToken"
                ],
                "properties": {
                  "CouponToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of the code"
                  },
                  "CouponCode": {
                    "type": "string",
                    "maxLength": 20,
                    "pattern": "^[A-Za-z0-9_-]+$",
                    "description": "New code — up to 20 letters, digits, - or _; whitespace is removed; matched exactly and case-sensitively. Only while unassigned and not redeemed; unique in the sweepstakes"
                  },
                  "Description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 5000,
                    "description": "Max 5,000 characters"
                  },
                  "Value": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 10,
                    "description": "Max 10 characters"
                  },
                  "ExternalURL": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uri",
                    "maxLength": 500,
                    "description": "https:// link, max 500 characters"
                  },
                  "ExpirationDate": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "YYYY-MM-DD, not in the past"
                  },
                  "ExpirationTime": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
                    "description": "HH:mm, 24-hour clock"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update Code — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Code": {
                      "CouponToken": "uuid-v4-string",
                      "SweepstakesToken": "uuid-v4-string",
                      "CouponCode": "SUMMER-7QK2P9",
                      "Description": "$10 off your next order",
                      "Value": "$15",
                      "ExternalURL": "https://shop.example.com/redeem",
                      "ExpirationDate": "2027-01-31T00:00:00.000Z",
                      "ExpirationTime": "23:59",
                      "Status": "not-redeemed",
                      "ParticipantToken": null,
                      "AssignedTo": null,
                      "RedemptionDate": null,
                      "RedemptionTime": null,
                      "CreationDate": "2026-09-20T14:02:11.004Z"
                    }
                  },
                  "Message": "Code updated successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Codes & Coupons module not enabled"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "409": {
            "description": "The code's current state does not allow the action (Data.Code says why)"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/codes/delete": {
      "post": {
        "tags": [
          "Codes & Coupons"
        ],
        "summary": "Delete Codes",
        "description": "Delete 1 to 1,000 codes that nobody holds yet. Assigned, redeemed and voided codes are never deleted and are reported in Skipped.",
        "operationId": "codesDelete",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "CouponTokens"
                ],
                "properties": {
                  "CouponTokens": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "minItems": 1,
                    "maxItems": 1000,
                    "description": "1 to 1,000 UUID v4 code tokens (duplicates are collapsed)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Delete Codes — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Requested": 2,
                    "Deleted": 1,
                    "Skipped": [
                      "uuid-v4-string"
                    ],
                    "SkippedCount": 1
                  },
                  "Message": "1 code(s) deleted"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Codes & Coupons module not enabled"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/codes/assign": {
      "post": {
        "tags": [
          "Codes & Coupons"
        ],
        "summary": "Assign Code",
        "description": "Assign one available code to one named participant (regular or AMOE) of the same sweepstakes who holds no code yet.",
        "operationId": "codesAssign",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "CouponToken",
                  "ParticipantToken"
                ],
                "properties": {
                  "CouponToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of an unassigned, not-redeemed code"
                  },
                  "ParticipantToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of a participant (regular or AMOE) of the same sweepstakes who holds no code"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Assign Code — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Code": {
                      "CouponToken": "uuid-v4-string",
                      "SweepstakesToken": "uuid-v4-string",
                      "CouponCode": "SUMMER-7QK2P9",
                      "Description": "$10 off your next order",
                      "Value": "$10",
                      "ExternalURL": "https://shop.example.com/redeem",
                      "ExpirationDate": "2026-12-31T00:00:00.000Z",
                      "ExpirationTime": "23:59",
                      "Status": "not-redeemed",
                      "ParticipantToken": "uuid-v4-string",
                      "AssignedTo": null,
                      "RedemptionDate": null,
                      "RedemptionTime": null,
                      "CreationDate": "2026-09-20T14:02:11.004Z"
                    }
                  },
                  "Message": "Code assigned successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Codes & Coupons module not enabled"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "409": {
            "description": "The code's current state does not allow the action (Data.Code says why)"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/codes/unassign": {
      "post": {
        "tags": [
          "Codes & Coupons"
        ],
        "summary": "Unassign Code",
        "description": "Take a code back from its participant and make it available again; any redemption is cleared with it. Voided codes are never released.",
        "operationId": "codesUnassign",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "CouponToken"
                ],
                "properties": {
                  "CouponToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of an assigned code"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Unassign Code — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "CouponToken": "uuid-v4-string",
                    "CouponCode": "SUMMER-7QK2P9",
                    "PreviousParticipantToken": "uuid-v4-string",
                    "Status": "not-redeemed"
                  },
                  "Message": "Code unassigned and available again"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Codes & Coupons module not enabled"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "409": {
            "description": "The code's current state does not allow the action (Data.Code says why)"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/codes/redeem": {
      "post": {
        "tags": [
          "Codes & Coupons"
        ],
        "summary": "Redeem Code",
        "description": "Mark one code as redeemed — exactly once — by its token or by the code a customer presented (point of sale). Voided codes are never redeemable.",
        "operationId": "codesRedeem",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "CouponToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of the code. Required unless CouponCode is sent; takes precedence when both are sent"
                  },
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of the sweepstakes. Required with CouponCode"
                  },
                  "CouponCode": {
                    "type": "string",
                    "maxLength": 20,
                    "pattern": "^[A-Za-z0-9_-]+$",
                    "description": "The code itself — up to 20 letters, digits, - or _; whitespace is removed; matched exactly and case-sensitively"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Redeem Code — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Code": {
                      "CouponToken": "uuid-v4-string",
                      "SweepstakesToken": "uuid-v4-string",
                      "CouponCode": "SUMMER-7QK2P9",
                      "Description": "$10 off your next order",
                      "Value": "$10",
                      "ExternalURL": "https://shop.example.com/redeem",
                      "ExpirationDate": "2026-12-31T00:00:00.000Z",
                      "ExpirationTime": "23:59",
                      "Status": "redeemed",
                      "ParticipantToken": "uuid-v4-string",
                      "AssignedTo": null,
                      "RedemptionDate": "2026-09-29T15:04:22.118Z",
                      "RedemptionTime": "15:04 pm",
                      "CreationDate": "2026-09-20T14:02:11.004Z"
                    }
                  },
                  "Message": "Code redeemed successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Codes & Coupons module not enabled"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "409": {
            "description": "The code's current state does not allow the action (Data.Code says why)"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/codes/unredeem": {
      "post": {
        "tags": [
          "Codes & Coupons"
        ],
        "summary": "Unredeem Code",
        "description": "Reverse a redemption made by mistake. Only a redeemed code changes; the participant assignment is kept.",
        "operationId": "codesUnredeem",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "CouponToken"
                ],
                "properties": {
                  "CouponToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of a redeemed code"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Unredeem Code — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Code": {
                      "CouponToken": "uuid-v4-string",
                      "SweepstakesToken": "uuid-v4-string",
                      "CouponCode": "SUMMER-7QK2P9",
                      "Description": "$10 off your next order",
                      "Value": "$10",
                      "ExternalURL": "https://shop.example.com/redeem",
                      "ExpirationDate": "2026-12-31T00:00:00.000Z",
                      "ExpirationTime": "23:59",
                      "Status": "not-redeemed",
                      "ParticipantToken": "uuid-v4-string",
                      "AssignedTo": null,
                      "RedemptionDate": null,
                      "RedemptionTime": null,
                      "CreationDate": "2026-09-20T14:02:11.004Z"
                    }
                  },
                  "Message": "Redemption reversed"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Codes & Coupons module not enabled"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "409": {
            "description": "The code's current state does not allow the action (Data.Code says why)"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/codes/settings": {
      "post": {
        "tags": [
          "Codes & Coupons"
        ],
        "summary": "Fetch Code Settings",
        "description": "Read how a sweepstakes hands out codes on its entry and AMOE pages and what participants are shown and sent. Never writes.",
        "operationId": "codesSettings",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SweepstakesToken"
                ],
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of a sweepstakes of your account"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Code Settings — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "SweepstakesToken": "uuid-v4-string",
                    "Configured": true,
                    "Settings": {
                      "CouponEntryPageRegistration": 1,
                      "CouponAmoePageRegistration": 0,
                      "WhatToDoWhenNoCouponCodeIsAvailable": 0,
                      "CouponCodeType": 1,
                      "CouponCodeLength": 20,
                      "DisplayCouponCodeOnConfirmationPage": true,
                      "SendCouponCodeToParticipantByEmail": true,
                      "SendCouponCodeToParticipantBySMS": false,
                      "RejectInvalidCouponCode": false,
                      "InvalidCouponCodeErrorMessage": "",
                      "CouponCodeCaseSensitive": false,
                      "CouponRequestFieldLabel": "",
                      "CouponThankYouPageMessage": "Show this code at any of our stores to claim your reward."
                    }
                  },
                  "Message": "Code settings fetched successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/codes/update-settings": {
      "post": {
        "tags": [
          "Codes & Coupons"
        ],
        "summary": "Update Code Settings",
        "description": "Change how a sweepstakes hands out codes. Partial update; every value validated against a closed set; the three texts are stored as plain text.",
        "operationId": "codesUpdateSettings",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SweepstakesToken"
                ],
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of a sweepstakes of your account"
                  },
                  "CouponEntryPageRegistration": {
                    "type": "integer",
                    "enum": [
                      0,
                      1,
                      2,
                      3
                    ],
                    "description": "Entry page: 0 none, 1 assign an existing code, 2 generate a new code, 3 ask the participant for their code"
                  },
                  "CouponAmoePageRegistration": {
                    "type": "integer",
                    "enum": [
                      0,
                      1,
                      2,
                      3
                    ],
                    "description": "AMOE page: same values as CouponEntryPageRegistration"
                  },
                  "WhatToDoWhenNoCouponCodeIsAvailable": {
                    "type": "integer",
                    "enum": [
                      0,
                      1
                    ],
                    "description": "0 nothing, 1 generate a new code"
                  },
                  "CouponCodeType": {
                    "type": "integer",
                    "enum": [
                      1,
                      2
                    ],
                    "description": "Generated codes: 1 numeric, 2 alphanumeric"
                  },
                  "CouponCodeLength": {
                    "type": "integer",
                    "minimum": 4,
                    "maximum": 20,
                    "description": "Generated code length, 4 to 20"
                  },
                  "DisplayCouponCodeOnConfirmationPage": {
                    "type": "boolean",
                    "description": "Show the code on the confirmation page"
                  },
                  "SendCouponCodeToParticipantByEmail": {
                    "type": "boolean",
                    "description": "Email the code to the participant"
                  },
                  "SendCouponCodeToParticipantBySMS": {
                    "type": "boolean",
                    "description": "Text the code to the participant"
                  },
                  "RejectInvalidCouponCode": {
                    "type": "boolean",
                    "description": "Mode 3: refuse the registration when the code is invalid"
                  },
                  "CouponCodeCaseSensitive": {
                    "type": "boolean",
                    "description": "Mode 3: compare codes case-sensitively"
                  },
                  "InvalidCouponCodeErrorMessage": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 500,
                    "description": "Mode 3: message shown for an invalid code. Plain text, max 500"
                  },
                  "CouponRequestFieldLabel": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 200,
                    "description": "Mode 3: label of the code field. Plain text, max 200. Empty = default label"
                  },
                  "CouponThankYouPageMessage": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 1000,
                    "description": "Message on the thank-you page. Plain text, max 1,000"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update Code Settings — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "SweepstakesToken": "uuid-v4-string",
                    "Updated": [
                      "CouponEntryPageRegistration",
                      "DisplayCouponCodeOnConfirmationPage",
                      "SendCouponCodeToParticipantByEmail",
                      "CouponThankYouPageMessage"
                    ],
                    "Settings": {
                      "CouponEntryPageRegistration": 1,
                      "DisplayCouponCodeOnConfirmationPage": true,
                      "SendCouponCodeToParticipantByEmail": true,
                      "CouponThankYouPageMessage": "Show this code at any of our stores to claim your reward."
                    }
                  },
                  "Message": "Code settings updated successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Codes & Coupons module not enabled"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/codes/send": {
      "post": {
        "tags": [
          "Codes & Coupons"
        ],
        "summary": "Send Code to Participant",
        "description": "Queue an assigned code to the participant who holds it, by email, SMS or both, through the Messaging Engine. No address field.",
        "operationId": "codesSend",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "CouponToken",
                  "Channel"
                ],
                "properties": {
                  "CouponToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of a code assigned to a participant"
                  },
                  "Channel": {
                    "type": "string",
                    "enum": [
                      "email",
                      "sms",
                      "both"
                    ],
                    "description": "email, sms or both. both sends on each channel the participant has a usable address for"
                  },
                  "IdempotencyKey": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{8,64}$",
                    "description": "8 to 64 characters [A-Za-z0-9_-]. Retrying with the same key never sends twice"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Send Code — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "CouponToken": "uuid-v4-string",
                    "ParticipantToken": "uuid-v4-string",
                    "Duplicate": false,
                    "Channels": [
                      {
                        "Channel": "email",
                        "Status": "queued",
                        "MessageToken": "uuid-v4-string"
                      },
                      {
                        "Channel": "sms",
                        "Status": "skipped",
                        "Reason": "NoAddress",
                        "Message": "The participant has no valid phone number."
                      }
                    ]
                  },
                  "Message": "Code queued. It is delivered within about a minute (SMS outside quiet hours)."
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Codes & Coupons module not enabled, Messaging Engine not enabled (DirectMessageNotEnabled), channel not in plan, sending paused or no 10DLC number"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "409": {
            "description": "The code's current state does not allow the action (Data.Code says why)"
          },
          "422": {
            "description": "Refused by a capacity or delivery check (Data.Code / Data.Channels say why)"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60); or the endpoint daily ceiling (Data.Code)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/rules/create": {
      "post": {
        "tags": [
          "Rules"
        ],
        "summary": "Create Rules Document",
        "description": "Create an official rules document for a sweepstakes. The first document created becomes the primary rules. Subsequent documents are secondary.",
        "operationId": "rulesCreate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SweepstakesToken",
                  "Title",
                  "DocumentContent"
                ],
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "Title": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "DocumentContent": {
                    "type": "string",
                    "maxLength": 1000000,
                    "description": "HTML content of the rules document"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rules document created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Data": {
                      "$ref": "#/components/schemas/Rule"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/rules/createWizard": {
      "post": {
        "tags": [
          "Rules"
        ],
        "summary": "Create Rules (Wizard)",
        "description": "Create official rules using a step-by-step wizard with structured form fields. Automatically generates the rules document from template.",
        "operationId": "rulesCreateWizard",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SweepstakesToken"
                ],
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "Title": {
                    "type": "string"
                  },
                  "WizardData": {
                    "type": "object",
                    "description": "Structured wizard form data for rules generation"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rules created via wizard",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/rules/fetch": {
      "post": {
        "tags": [
          "Rules"
        ],
        "summary": "Fetch Rules",
        "description": "Retrieve all rules documents associated with a sweepstakes.",
        "operationId": "rulesFetch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SweepstakesToken"
                ],
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rules list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Rule"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/rules/update": {
      "put": {
        "tags": [
          "Rules"
        ],
        "summary": "Update Rules",
        "description": "Update an existing rules document title or content.",
        "operationId": "rulesUpdate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "RulesToken"
                ],
                "properties": {
                  "RulesToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "Title": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "DocumentContent": {
                    "type": "string",
                    "maxLength": 1000000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rules updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/rules/delete": {
      "post": {
        "tags": [
          "Rules"
        ],
        "summary": "Delete Rules",
        "description": "Permanently delete a rules document.",
        "operationId": "rulesDelete",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "RulesToken"
                ],
                "properties": {
                  "RulesToken": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rules deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/notes/create": {
      "post": {
        "tags": [
          "Notes"
        ],
        "summary": "Create Note",
        "description": "Create an encrypted personal note. Notes are encrypted with AES-256-CBC. Title must be unique per user.",
        "operationId": "notesCreate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "Title",
                  "Note"
                ],
                "properties": {
                  "Title": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "Unique note title"
                  },
                  "Note": {
                    "type": "string",
                    "maxLength": 100000,
                    "description": "Note content (will be AES-256-CBC encrypted)"
                  },
                  "Pinned": {
                    "type": "boolean",
                    "default": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Note created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Message": {
                      "type": "string"
                    },
                    "Data": {
                      "$ref": "#/components/schemas/Note"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/notes/fetch": {
      "get": {
        "tags": [
          "Notes"
        ],
        "summary": "Fetch All Notes",
        "description": "Retrieve all notes for the authenticated user.",
        "operationId": "notesFetch",
        "responses": {
          "200": {
            "description": "Notes list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Note"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/notes/update": {
      "post": {
        "tags": [
          "Notes"
        ],
        "summary": "Update Note",
        "description": "Update an existing note's title, content, or pinned status.",
        "operationId": "notesUpdate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "NoteToken"
                ],
                "properties": {
                  "NoteToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "Title": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "Note": {
                    "type": "string",
                    "maxLength": 100000
                  },
                  "Pinned": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Note updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/notes/delete": {
      "post": {
        "tags": [
          "Notes"
        ],
        "summary": "Delete Note",
        "description": "Permanently delete a note.",
        "operationId": "notesDelete",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "NoteToken"
                ],
                "properties": {
                  "NoteToken": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Note deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/calendar/create": {
      "post": {
        "tags": [
          "Calendar"
        ],
        "summary": "Create Calendar Event",
        "description": "Create a new calendar event. Events cannot be created in the past.",
        "operationId": "calendarCreate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "EventTitle",
                  "EventStartDate",
                  "EventEndDate"
                ],
                "properties": {
                  "EventTitle": {
                    "type": "string"
                  },
                  "EventStartDate": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Must be future date"
                  },
                  "EventEndDate": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Must be future date"
                  },
                  "EventDescription": {
                    "type": "string"
                  },
                  "EventLocation": {
                    "type": "string"
                  },
                  "Latitude": {
                    "type": "string"
                  },
                  "Longitude": {
                    "type": "string"
                  },
                  "EventURL": {
                    "type": "string"
                  },
                  "EventStartTime": {
                    "type": "string",
                    "pattern": "^[0-2][0-9]:[0-5][0-9]$",
                    "default": "00:00"
                  },
                  "EventEndTime": {
                    "type": "string",
                    "pattern": "^[0-2][0-9]:[0-5][0-9]$",
                    "default": "23:59"
                  },
                  "EventColor": {
                    "type": "string",
                    "default": "#6CD9FF"
                  },
                  "EventAllDay": {
                    "type": "boolean",
                    "default": false
                  },
                  "EventStatus": {
                    "type": "boolean",
                    "default": false
                  },
                  "PrivateEvent": {
                    "type": "boolean",
                    "default": false
                  },
                  "SMSNotification": {
                    "type": "boolean",
                    "default": false
                  },
                  "Completed": {
                    "type": "boolean",
                    "default": false
                  },
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "PeopleInvolved": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "RepeatThisEvent": {
                    "type": "object"
                  },
                  "Notification": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Event created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Message": {
                      "type": "string"
                    },
                    "Data": {
                      "$ref": "#/components/schemas/CalendarEvent"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/calendar/fetch": {
      "get": {
        "tags": [
          "Calendar"
        ],
        "summary": "Fetch Calendar Events",
        "description": "Retrieve all calendar events for the authenticated user.",
        "operationId": "calendarFetch",
        "responses": {
          "200": {
            "description": "Events list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CalendarEvent"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/calendar/single": {
      "post": {
        "tags": [
          "Calendar"
        ],
        "summary": "Fetch Single Event",
        "description": "Retrieve a single calendar event by its token.",
        "operationId": "calendarSingle",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "EventToken"
                ],
                "properties": {
                  "EventToken": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/calendar/update": {
      "put": {
        "tags": [
          "Calendar"
        ],
        "summary": "Update Calendar Event",
        "description": "Update an existing calendar event.",
        "operationId": "calendarUpdate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "EventToken"
                ],
                "properties": {
                  "EventToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "EventTitle": {
                    "type": "string"
                  },
                  "EventStartDate": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "EventEndDate": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "EventDescription": {
                    "type": "string"
                  },
                  "EventLocation": {
                    "type": "string"
                  },
                  "EventColor": {
                    "type": "string"
                  },
                  "EventAllDay": {
                    "type": "boolean"
                  },
                  "Completed": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/calendar/delete": {
      "delete": {
        "tags": [
          "Calendar"
        ],
        "summary": "Delete Calendar Event",
        "description": "Permanently delete a calendar event.",
        "operationId": "calendarDelete",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "EventToken"
                ],
                "properties": {
                  "EventToken": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/billing/fetchtransactions": {
      "get": {
        "tags": [
          "Billing"
        ],
        "summary": "Fetch Billing Transactions",
        "description": "Retrieve all billing transactions for the authenticated user.",
        "operationId": "billingFetchTransactions",
        "responses": {
          "200": {
            "description": "Billing transactions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Data": {
                      "type": "object",
                      "properties": {
                        "TotalTransactions": {
                          "type": "integer"
                        },
                        "Transactions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "InvoiceNumber": {
                                "type": "string"
                              },
                              "TransactionID": {
                                "type": "string"
                              },
                              "Description": {
                                "type": "string"
                              },
                              "Amount": {
                                "type": "number"
                              },
                              "AmountPrizes": {
                                "type": "number"
                              },
                              "Status": {
                                "type": "string"
                              },
                              "Refunded": {
                                "type": "boolean"
                              },
                              "IsSandboxTransaction": {
                                "type": "boolean"
                              },
                              "DocumentType": {
                                "type": "string"
                              },
                              "CreationDate": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "ExpirationDate": {
                                "type": "string",
                                "format": "date-time"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/billing/consumptions": {
      "get": {
        "tags": [
          "Billing"
        ],
        "summary": "Fetch Consumptions",
        "description": "Retrieve monthly and yearly consumption totals aggregated from billing transactions and data transfers.",
        "operationId": "billingConsumptions",
        "responses": {
          "200": {
            "description": "Consumption data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Data": {
                      "type": "object",
                      "description": "Consumption totals aggregated by year and month"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/billing/datatransfer": {
      "post": {
        "tags": [
          "Billing"
        ],
        "summary": "Fetch Data Transfer",
        "description": "Retrieve data transfer billing logs for the authenticated user.",
        "operationId": "billingDataTransfer",
        "responses": {
          "200": {
            "description": "Data transfer records",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Data": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/wallet/fetchtransactions": {
      "get": {
        "tags": [
          "Wallet"
        ],
        "summary": "Fetch Wallet Transactions",
        "description": "Retrieve all wallet transactions (credits and debits) for the authenticated user.",
        "operationId": "walletFetchTransactions",
        "responses": {
          "200": {
            "description": "Wallet transactions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Data": {
                      "type": "object",
                      "properties": {
                        "TotalTransactions": {
                          "type": "integer"
                        },
                        "Transactions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "TransactionID": {
                                "type": "string"
                              },
                              "Description": {
                                "type": "string"
                              },
                              "CCType": {
                                "type": "string"
                              },
                              "CCLastFourDigits": {
                                "type": "string"
                              },
                              "TransactionType": {
                                "type": "string",
                                "enum": [
                                  "credit",
                                  "debit"
                                ]
                              },
                              "Amount": {
                                "type": "string"
                              },
                              "IsSandboxTransaction": {
                                "type": "boolean"
                              },
                              "Status": {
                                "type": "boolean"
                              },
                              "CreationDate": {
                                "type": "string",
                                "format": "date-time"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/tickets/createTodo": {
      "post": {
        "tags": [
          "Todos"
        ],
        "summary": "Create To-Do",
        "description": "Create a new To-Do task item.",
        "operationId": "todosCreate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "Title"
                ],
                "properties": {
                  "Title": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "DueDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "Priority": {
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ]
                  },
                  "Status": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "in-progress",
                      "completed"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "To-Do created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/tickets/fetchTodos": {
      "post": {
        "tags": [
          "Todos"
        ],
        "summary": "Fetch To-Do's",
        "description": "Retrieve all To-Do tasks with optional filtering and pagination.",
        "operationId": "todosFetch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "page": {
                    "type": "integer",
                    "default": 1
                  },
                  "limit": {
                    "type": "integer",
                    "default": 20
                  },
                  "status": {
                    "type": "string"
                  },
                  "priority": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "To-Do list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/tickets/create": {
      "post": {
        "tags": [
          "Support"
        ],
        "summary": "Create Support Ticket",
        "description": "Create a new support ticket. The ticket is automatically assigned to all admin users and receives a unique 7-digit case number.",
        "operationId": "ticketsCreate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "Subject",
                  "Message"
                ],
                "properties": {
                  "Subject": {
                    "type": "string"
                  },
                  "Message": {
                    "type": "string"
                  },
                  "Priority": {
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ],
                    "default": "medium"
                  },
                  "Category": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ticket created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Message": {
                      "type": "string"
                    },
                    "Data": {
                      "$ref": "#/components/schemas/Ticket"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/tickets/fetchOpenTickets": {
      "post": {
        "tags": [
          "Support"
        ],
        "summary": "Fetch Open Tickets",
        "description": "Retrieve all open support tickets for the authenticated user.",
        "operationId": "ticketsFetchOpen",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "page": {
                    "type": "integer",
                    "default": 1
                  },
                  "limit": {
                    "type": "integer",
                    "default": 20
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Open tickets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/tickets/fetchClosedTickets": {
      "post": {
        "tags": [
          "Support"
        ],
        "summary": "Fetch Closed Tickets",
        "description": "Retrieve all closed/resolved support tickets for the authenticated user.",
        "operationId": "ticketsFetchClosed",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "page": {
                    "type": "integer",
                    "default": 1
                  },
                  "limit": {
                    "type": "integer",
                    "default": 20
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Closed tickets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/tickets/fetchSingleTicket": {
      "post": {
        "tags": [
          "Support"
        ],
        "summary": "Fetch Single Ticket",
        "description": "Retrieve full details of a single support ticket including all notes and history.",
        "operationId": "ticketsFetchSingle",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "TicketToken"
                ],
                "properties": {
                  "TicketToken": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ticket details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/tickets/resolve": {
      "post": {
        "tags": [
          "Support"
        ],
        "summary": "Resolve Ticket",
        "description": "Mark a support ticket as resolved/closed.",
        "operationId": "ticketsResolve",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "TicketToken"
                ],
                "properties": {
                  "TicketToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "Resolution": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ticket resolved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/tickets/update": {
      "post": {
        "tags": [
          "Support"
        ],
        "summary": "Update Ticket",
        "description": "Add a note or update details on an existing support ticket.",
        "operationId": "ticketsUpdate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "TicketToken"
                ],
                "properties": {
                  "TicketToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "Note": {
                    "type": "string"
                  },
                  "Priority": {
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ticket updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/tickets/delete": {
      "post": {
        "tags": [
          "Support"
        ],
        "summary": "Delete Ticket",
        "description": "Permanently delete a support ticket.",
        "operationId": "ticketsDelete",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "TicketToken"
                ],
                "properties": {
                  "TicketToken": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ticket deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/documentation/fetch": {
      "post": {
        "tags": [
          "Help"
        ],
        "summary": "Fetch Documentation",
        "description": "Retrieve API documentation content programmatically for LLM integration or custom help systems.",
        "operationId": "documentationFetch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "Section": {
                    "type": "string",
                    "description": "Specific documentation section to retrieve"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Documentation content",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/tools/timezones": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "Fetch Timezones",
        "description": "Retrieve a list of all supported timezones with their IDs and offsets.",
        "operationId": "toolsTimezones",
        "responses": {
          "200": {
            "description": "Timezones list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ID": {
                            "type": "integer"
                          },
                          "Name": {
                            "type": "string"
                          },
                          "Offset": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/tools/states": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "Fetch US States",
        "description": "Retrieve a list of all US states with codes and names.",
        "operationId": "toolsStates",
        "responses": {
          "200": {
            "description": "US states list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "Code": {
                            "type": "string"
                          },
                          "Name": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/tools/zipcodes": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "Fetch Zip Codes",
        "description": "Search and retrieve US zip code data.",
        "operationId": "toolsZipcodes",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ZipCode": {
                    "type": "string",
                    "description": "Zip code to look up"
                  },
                  "City": {
                    "type": "string",
                    "description": "City name to search"
                  },
                  "State": {
                    "type": "string",
                    "description": "State code to filter"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Zip code data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/tools/areacodes": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "Fetch Area Codes",
        "description": "Retrieve US telephone area codes with associated state and region data.",
        "operationId": "toolsAreacodes",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "AreaCode": {
                    "type": "string"
                  },
                  "State": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Area codes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/tools/countries": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "Fetch Countries",
        "description": "Retrieve a complete list of countries with ISO codes and names.",
        "operationId": "toolsCountries",
        "responses": {
          "200": {
            "description": "Countries list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "Code": {
                            "type": "string"
                          },
                          "Name": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/invoices/create": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Create Invoice",
        "description": "Create an invoice from a recipient and a set of line items. Every amount is recomputed server-side. Commission percentages are frozen from the account plan at creation time. Invoice numbers are reserved with an atomic per-account counter, so parallel calls never collide. This endpoint never emails the recipient.",
        "operationId": "invoicesCreate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "BillTo",
                  "Items"
                ],
                "properties": {
                  "BillTo": {
                    "type": "object",
                    "required": [
                      "Name",
                      "Email"
                    ],
                    "properties": {
                      "Name": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "Email": {
                        "type": "string",
                        "format": "email",
                        "maxLength": 100
                      },
                      "Phone": {
                        "type": "string",
                        "maxLength": 15
                      },
                      "Company": {
                        "type": "string",
                        "maxLength": 150
                      },
                      "Address": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "City": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "State": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "ZipCode": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "Country": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "TaxId": {
                        "type": "string",
                        "maxLength": 50
                      }
                    }
                  },
                  "Items": {
                    "type": "array",
                    "maxItems": 60,
                    "description": "Line items. Amount is always computed server-side as Quantity x Rate",
                    "items": {
                      "type": "object",
                      "required": [
                        "Description"
                      ],
                      "properties": {
                        "Description": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "Quantity": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 100
                        },
                        "Rate": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1000000
                        }
                      }
                    }
                  },
                  "Title": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "IssueDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "DueDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "DiscountAmount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "TaxEnabled": {
                    "type": "boolean",
                    "default": false
                  },
                  "TaxLabel": {
                    "type": "string",
                    "maxLength": 50,
                    "default": "Tax"
                  },
                  "TaxRate": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "PaymentMethod": {
                    "type": "string",
                    "enum": [
                      "card",
                      "check",
                      "transfer"
                    ],
                    "default": "card"
                  },
                  "PaymentInstructions": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "NotesToRecipient": {
                    "type": "string",
                    "maxLength": 3000
                  },
                  "Terms": {
                    "type": "string",
                    "maxLength": 3000
                  },
                  "Status": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "pending"
                    ],
                    "default": "draft"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Invoice created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, Invoices module not enabled, or monthly quota exceeded"
          },
          "404": {
            "description": "Invoice not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/invoices/fetch": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Fetch Invoices",
        "description": "List invoices with the summary totals (pending, paid, overdue). The summary always covers the whole filtered set, not just the returned page. IsOverdue is derived at read time.",
        "operationId": "invoicesFetch",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "Status": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "pending",
                      "paid",
                      "cancelled"
                    ]
                  },
                  "FromDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "ToDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "Page": {
                    "type": "integer",
                    "minimum": 1,
                    "default": 1
                  },
                  "Limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200,
                    "default": 50
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invoices fetched",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, Invoices module not enabled, or monthly quota exceeded"
          },
          "404": {
            "description": "Invoice not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/invoices/single": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Single Invoice",
        "description": "Fetch one invoice in full: line items, totals, payment details, public payment link, QR code, view statistics, event timeline and modifications log.",
        "operationId": "invoicesSingle",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "InvoiceToken"
                ],
                "properties": {
                  "InvoiceToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "IncludeEvents": {
                    "type": "boolean",
                    "default": true
                  },
                  "IncludeQrCode": {
                    "type": "boolean",
                    "default": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invoice fetched",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, Invoices module not enabled, or monthly quota exceeded"
          },
          "404": {
            "description": "Invoice not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/invoices/update": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Update Invoice",
        "description": "Edit an invoice while it is draft or pending. This is also how an invoice is published (Status \"pending\") or cancelled (Status \"cancelled\"). An invoice is never demoted back to draft. Commission percentages are never recomputed. Publishing does not email the recipient.",
        "operationId": "invoicesUpdate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "InvoiceToken"
                ],
                "properties": {
                  "InvoiceToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "BillTo": {
                    "type": "object",
                    "required": [
                      "Name",
                      "Email"
                    ],
                    "properties": {
                      "Name": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "Email": {
                        "type": "string",
                        "format": "email",
                        "maxLength": 100
                      },
                      "Phone": {
                        "type": "string",
                        "maxLength": 15
                      },
                      "Company": {
                        "type": "string",
                        "maxLength": 150
                      },
                      "Address": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "City": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "State": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "ZipCode": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "Country": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "TaxId": {
                        "type": "string",
                        "maxLength": 50
                      }
                    }
                  },
                  "Items": {
                    "type": "array",
                    "maxItems": 60,
                    "description": "Line items. Amount is always computed server-side as Quantity x Rate",
                    "items": {
                      "type": "object",
                      "required": [
                        "Description"
                      ],
                      "properties": {
                        "Description": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "Quantity": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 100
                        },
                        "Rate": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1000000
                        }
                      }
                    }
                  },
                  "Title": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "IssueDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "DueDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "DiscountAmount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "TaxEnabled": {
                    "type": "boolean"
                  },
                  "TaxLabel": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "TaxRate": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "PaymentMethod": {
                    "type": "string",
                    "enum": [
                      "card",
                      "check",
                      "transfer"
                    ]
                  },
                  "PaymentInstructions": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "NotesToRecipient": {
                    "type": "string",
                    "maxLength": 3000
                  },
                  "Terms": {
                    "type": "string",
                    "maxLength": 3000
                  },
                  "Status": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "cancelled"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invoice updated, issued or cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, Invoices module not enabled, or monthly quota exceeded"
          },
          "404": {
            "description": "Invoice not found"
          },
          "500": {
            "description": "Internal server error"
          },
          "409": {
            "description": "The invoice is paid or cancelled and can no longer be modified"
          }
        }
      }
    },
    "/invoices/delete": {
      "post": {
        "tags": [
          "Invoices"
        ],
        "summary": "Delete Invoice",
        "description": "Permanently delete an invoice and its event trail. The wallet transaction and the Sweeppea commission of a paid invoice are kept on purpose.",
        "operationId": "invoicesDelete",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "InvoiceToken"
                ],
                "properties": {
                  "InvoiceToken": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invoice deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, Invoices module not enabled, or monthly quota exceeded"
          },
          "404": {
            "description": "Invoice not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/messaging/usage": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Fetch Messaging Usage",
        "description": "Read the account's messaging state: module access, plan channels, this month's email and SMS allowance, SMS sender readiness and any active sending pause.",
        "operationId": "messagingUsage",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Messaging Usage — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "ModuleEnabled": true,
                    "DirectMessageEnabled": true,
                    "Email": {
                      "IncludedInPlan": true,
                      "Paused": false,
                      "PausedBy": null,
                      "Month": "2026-09",
                      "MaxPerMonth": 5000,
                      "Unlimited": false,
                      "Used": 1240,
                      "Reserved": 300,
                      "Remaining": 3460,
                      "LimitReached": false,
                      "TransactionalCeiling": 6000
                    },
                    "Sms": {
                      "IncludedInPlan": true,
                      "Paused": false,
                      "PausedBy": null,
                      "Month": "2026-09",
                      "MaxPerMonth": 1000,
                      "Unlimited": false,
                      "Used": 88,
                      "Reserved": 0,
                      "Remaining": 912,
                      "LimitReached": false,
                      "TransactionalCeiling": 1200,
                      "SenderReady": true
                    }
                  },
                  "Message": "Messaging usage fetched successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/messaging/campaigns": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Fetch Messaging Campaigns",
        "description": "List the account's email and SMS campaigns, newest first, with filters and pagination.",
        "operationId": "messagingCampaigns",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4. Only campaigns of this sweepstakes"
                  },
                  "Channel": {
                    "type": "string",
                    "enum": [
                      "email",
                      "sms"
                    ],
                    "description": "email or sms"
                  },
                  "Category": {
                    "type": "string",
                    "enum": [
                      "marketing",
                      "transactional",
                      "referral"
                    ],
                    "description": "marketing, transactional or referral"
                  },
                  "Status": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "scheduled",
                      "queued",
                      "sending",
                      "paused",
                      "completed",
                      "cancelled",
                      "failed",
                      "blocked"
                    ],
                    "description": "draft, scheduled, queued, sending, paused, completed, cancelled, failed, blocked"
                  },
                  "Search": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "Part of the campaign name (case-insensitive, max 100 characters)"
                  },
                  "Archived": {
                    "type": "boolean",
                    "default": false,
                    "description": "true lists archived campaigns instead. Defaults to false"
                  },
                  "Page": {
                    "type": "integer",
                    "minimum": 1,
                    "default": 1,
                    "description": "Page number, starting at 1. Defaults to 1"
                  },
                  "ItemsPerPage": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 25,
                    "description": "1 to 100. Defaults to 25"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fetch Campaigns — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Campaigns": [
                      {
                        "CampaignToken": "uuid-v4-string",
                        "SweepstakesToken": "uuid-v4-string",
                        "Name": "Final Week Reminder",
                        "Channel": "email",
                        "Category": "marketing",
                        "Status": "sending",
                        "BlockedReason": null,
                        "ReputationHold": false,
                        "Archived": false,
                        "Origin": "manual",
                        "Counters": {
                          "Targeted": 4820,
                          "Excluded": {
                            "NoConsent": 112,
                            "Suppressed": 37,
                            "Invalid": 9,
                            "Capped": 0,
                            "Duplicate": 21,
                            "NonUsCaNumber": 0,
                            "NotFirstParty": 0,
                            "OverQuota": 0
                          },
                          "Queued": 4641,
                          "Sent": 2310,
                          "Delivered": 2288,
                          "Opened": 941,
                          "Clicked": 203,
                          "Bounced": 14,
                          "Complained": 1,
                          "Unsubscribed": 6,
                          "Failed": 8,
                          "Segments": 0
                        },
                        "QuotaReserved": 4641,
                        "ReviewStatus": null,
                        "ScheduledAt": null,
                        "ScheduleZone": null,
                        "LaunchedAt": "2026-09-28T15:00:04.112Z",
                        "CompletedAt": null,
                        "CreationDate": "2026-09-27T19:42:10.508Z",
                        "UpdatedAt": "2026-09-28T15:12:48.300Z",
                        "Actions": {
                          "Pause": true,
                          "Resume": false,
                          "Cancel": true
                        }
                      }
                    ],
                    "TotalResults": 1,
                    "Page": 1,
                    "ItemsPerPage": 25,
                    "TotalPages": 1
                  },
                  "Message": "Campaigns fetched successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/messaging/campaign": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Fetch Single Messaging Campaign",
        "description": "Fetch one campaign in full: content, audience, sender profile, counters and the actions this API may take on it.",
        "operationId": "messagingCampaign",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "CampaignToken"
                ],
                "properties": {
                  "CampaignToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of the campaign"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Single Campaign — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Campaign": {
                      "CampaignToken": "uuid-v4-string",
                      "SweepstakesToken": "uuid-v4-string",
                      "Name": "Final Week Reminder",
                      "Channel": "email",
                      "Category": "marketing",
                      "Status": "sending",
                      "BlockedReason": null,
                      "ReputationHold": false,
                      "Archived": false,
                      "Origin": "manual",
                      "Counters": {
                        "Targeted": 4820,
                        "Excluded": {
                          "NoConsent": 112,
                          "Suppressed": 37,
                          "Invalid": 9,
                          "Capped": 0,
                          "Duplicate": 21,
                          "NonUsCaNumber": 0,
                          "NotFirstParty": 0,
                          "OverQuota": 0
                        },
                        "Queued": 4641,
                        "Sent": 2310,
                        "Delivered": 2288,
                        "Opened": 941,
                        "Clicked": 203,
                        "Bounced": 14,
                        "Complained": 1,
                        "Unsubscribed": 6,
                        "Failed": 8,
                        "Segments": 0
                      },
                      "QuotaReserved": 4641,
                      "ReviewStatus": null,
                      "ScheduledAt": null,
                      "ScheduleZone": null,
                      "LaunchedAt": "2026-09-28T15:00:04.112Z",
                      "CompletedAt": null,
                      "CreationDate": "2026-09-27T19:42:10.508Z",
                      "UpdatedAt": "2026-09-28T15:12:48.300Z",
                      "Actions": {
                        "Pause": true,
                        "Resume": false,
                        "Cancel": true
                      },
                      "Content": {
                        "Subject": "Only 7 days left to enter",
                        "Preheader": "Your chance to win ends next Sunday",
                        "SmsBody": null,
                        "Blocks": [
                          {
                            "Type": "heading",
                            "Text": "The clock is ticking"
                          },
                          {
                            "Type": "text",
                            "Text": "Hi [ FIRST_NAME ], there is one week left to enter the giveaway."
                          },
                          {
                            "Type": "button",
                            "Label": "Enter now",
                            "Url": "https://hub.sweeppea.com/f?tkn=uuid-v4-string"
                          }
                        ]
                      },
                      "Audience": {
                        "Sources": [
                          "participants"
                        ],
                        "Filters": {},
                        "ExcludeRecentHours": 24
                      },
                      "Sender": {
                        "ProfileToken": "uuid-v4-string"
                      }
                    }
                  },
                  "Message": "Campaign fetched successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/messaging/campaign-report": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Fetch Messaging Campaign Report",
        "description": "Delivery report of one campaign: counters, rates over sent, messages by status, top error codes, sends per hour and most-clicked links.",
        "operationId": "messagingCampaignReport",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "CampaignToken"
                ],
                "properties": {
                  "CampaignToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of the campaign"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Campaign Report — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Campaign": {
                      "CampaignToken": "uuid-v4-string",
                      "SweepstakesToken": "uuid-v4-string",
                      "Name": "Final Week Reminder",
                      "Channel": "email",
                      "Category": "marketing",
                      "Status": "sending",
                      "BlockedReason": null,
                      "ReputationHold": false,
                      "Archived": false,
                      "Origin": "manual",
                      "Counters": {
                        "Targeted": 4820,
                        "Excluded": {
                          "NoConsent": 112,
                          "Suppressed": 37,
                          "Invalid": 9,
                          "Capped": 0,
                          "Duplicate": 21,
                          "NonUsCaNumber": 0,
                          "NotFirstParty": 0,
                          "OverQuota": 0
                        },
                        "Queued": 4641,
                        "Sent": 2310,
                        "Delivered": 2288,
                        "Opened": 941,
                        "Clicked": 203,
                        "Bounced": 14,
                        "Complained": 1,
                        "Unsubscribed": 6,
                        "Failed": 8,
                        "Segments": 0
                      },
                      "QuotaReserved": 4641,
                      "ReviewStatus": null,
                      "ScheduledAt": null,
                      "ScheduleZone": null,
                      "LaunchedAt": "2026-09-28T15:00:04.112Z",
                      "CompletedAt": null,
                      "CreationDate": "2026-09-27T19:42:10.508Z",
                      "UpdatedAt": "2026-09-28T15:12:48.300Z",
                      "Actions": {
                        "Pause": true,
                        "Resume": false,
                        "Cancel": true
                      }
                    },
                    "Counters": {
                      "Targeted": 4820,
                      "Excluded": {
                        "NoConsent": 112,
                        "Suppressed": 37,
                        "Invalid": 9,
                        "Capped": 0,
                        "Duplicate": 21,
                        "NonUsCaNumber": 0,
                        "NotFirstParty": 0,
                        "OverQuota": 0
                      },
                      "Queued": 4641,
                      "Sent": 2310,
                      "Delivered": 2288,
                      "Opened": 941,
                      "Clicked": 203,
                      "Bounced": 14,
                      "Complained": 1,
                      "Unsubscribed": 6,
                      "Failed": 8,
                      "Segments": 0
                    },
                    "Rates": {
                      "Delivered": 99.05,
                      "Opened": 40.74,
                      "Clicked": 8.79,
                      "Bounced": 0.61,
                      "Complained": 0.04,
                      "Unsubscribed": 0.26,
                      "Failed": 0.35
                    },
                    "ByStatus": {
                      "queued": 2331,
                      "delivered": 1144,
                      "opened": 738,
                      "clicked": 203,
                      "bounced": 14,
                      "complained": 1,
                      "unsubscribed": 6,
                      "failed": 8,
                      "sent": 196
                    },
                    "TopErrors": [
                      {
                        "Code": "MailboxDoesNotExist",
                        "Count": 11
                      },
                      {
                        "Code": "MessageRejected",
                        "Count": 3
                      }
                    ],
                    "Timeline": [
                      {
                        "Hour": "2026-09-28T15:00:00Z",
                        "Count": 1400
                      },
                      {
                        "Hour": "2026-09-28T16:00:00Z",
                        "Count": 910
                      }
                    ],
                    "TopLinks": [
                      {
                        "Link": "https://hub.sweeppea.com/f?tkn=uuid-v4-string",
                        "Clicks": 187
                      }
                    ],
                    "RowsExpired": false
                  },
                  "Message": "Campaign report fetched successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/messaging/campaign-recipients": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Fetch Messaging Campaign Recipients",
        "description": "List who a campaign went to and what happened to each message, paginated, with a status filter and an exact-address search.",
        "operationId": "messagingCampaignRecipients",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "CampaignToken"
                ],
                "properties": {
                  "CampaignToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of the campaign"
                  },
                  "Status": {
                    "type": "string",
                    "enum": [
                      "queued",
                      "sending",
                      "sent",
                      "delivered",
                      "opened",
                      "clicked",
                      "bounced",
                      "complained",
                      "failed",
                      "suppressed",
                      "unsubscribed",
                      "cancelled"
                    ],
                    "description": "queued, sending, sent, delivered, opened, clicked, bounced, complained, failed, suppressed, unsubscribed, cancelled"
                  },
                  "Search": {
                    "type": "string",
                    "maxLength": 254,
                    "description": "One exact email address or phone number (max 254 characters). Parsed for the campaign's channel"
                  },
                  "Page": {
                    "type": "integer",
                    "minimum": 1,
                    "default": 1,
                    "description": "Page number, starting at 1. Defaults to 1"
                  },
                  "ItemsPerPage": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 25,
                    "description": "1 to 100. Defaults to 25"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Campaign Recipients — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Recipients": [
                      {
                        "Address": "jane.doe@example.com",
                        "Status": "bounced",
                        "ErrorCode": "MailboxDoesNotExist",
                        "SentAt": "2026-09-28T15:02:11.410Z",
                        "DeliveredAt": null,
                        "OpenedAt": null,
                        "ClickedAt": null,
                        "NextAttemptAt": null,
                        "Segments": 0
                      }
                    ],
                    "TotalResults": 14,
                    "Page": 1,
                    "ItemsPerPage": 25,
                    "TotalPages": 1
                  },
                  "Message": "Campaign recipients fetched successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/messaging/pause-campaign": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Pause Messaging Campaign",
        "description": "Stop a campaign that is queued or sending. Nothing more goes out after the call answers; the held allowance stays held for a resume.",
        "operationId": "messagingPauseCampaign",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "CampaignToken"
                ],
                "properties": {
                  "CampaignToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of a campaign in status queued or sending"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pause Campaign — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Campaign": {
                      "CampaignToken": "uuid-v4-string",
                      "SweepstakesToken": "uuid-v4-string",
                      "Name": "Final Week Reminder",
                      "Channel": "email",
                      "Category": "marketing",
                      "Status": "paused",
                      "BlockedReason": null,
                      "ReputationHold": false,
                      "Archived": false,
                      "Origin": "manual",
                      "Counters": {
                        "Targeted": 4820,
                        "Excluded": {
                          "NoConsent": 112,
                          "Suppressed": 37,
                          "Invalid": 9,
                          "Capped": 0,
                          "Duplicate": 21,
                          "NonUsCaNumber": 0,
                          "NotFirstParty": 0,
                          "OverQuota": 0
                        },
                        "Queued": 4641,
                        "Sent": 2310,
                        "Delivered": 2288,
                        "Opened": 941,
                        "Clicked": 203,
                        "Bounced": 14,
                        "Complained": 1,
                        "Unsubscribed": 6,
                        "Failed": 8,
                        "Segments": 0
                      },
                      "QuotaReserved": 4641,
                      "ReviewStatus": null,
                      "ScheduledAt": null,
                      "ScheduleZone": null,
                      "LaunchedAt": "2026-09-28T15:00:04.112Z",
                      "CompletedAt": null,
                      "CreationDate": "2026-09-27T19:42:10.508Z",
                      "UpdatedAt": "2026-09-28T15:20:31.902Z",
                      "Actions": {
                        "Pause": false,
                        "Resume": true,
                        "Cancel": true
                      }
                    }
                  },
                  "Message": "Campaign paused successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Send Message module not enabled"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "409": {
            "description": "The current state does not allow the action (Data carries the status or reason)"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/messaging/resume-campaign": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Resume Messaging Campaign",
        "description": "Resume a paused campaign whose recipient list is complete. Every problem that would stop it again is re-checked first and returned together.",
        "operationId": "messagingResumeCampaign",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "CampaignToken"
                ],
                "properties": {
                  "CampaignToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of a paused campaign"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resume Campaign — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Campaign": {
                      "CampaignToken": "uuid-v4-string",
                      "SweepstakesToken": "uuid-v4-string",
                      "Name": "Final Week Reminder",
                      "Channel": "email",
                      "Category": "marketing",
                      "Status": "sending",
                      "BlockedReason": null,
                      "ReputationHold": false,
                      "Archived": false,
                      "Origin": "manual",
                      "Counters": {
                        "Targeted": 4820,
                        "Excluded": {
                          "NoConsent": 112,
                          "Suppressed": 37,
                          "Invalid": 9,
                          "Capped": 0,
                          "Duplicate": 21,
                          "NonUsCaNumber": 0,
                          "NotFirstParty": 0,
                          "OverQuota": 0
                        },
                        "Queued": 4641,
                        "Sent": 2310,
                        "Delivered": 2288,
                        "Opened": 941,
                        "Clicked": 203,
                        "Bounced": 14,
                        "Complained": 1,
                        "Unsubscribed": 6,
                        "Failed": 8,
                        "Segments": 0
                      },
                      "QuotaReserved": 4641,
                      "ReviewStatus": null,
                      "ScheduledAt": null,
                      "ScheduleZone": null,
                      "LaunchedAt": "2026-09-28T15:00:04.112Z",
                      "CompletedAt": null,
                      "CreationDate": "2026-09-27T19:42:10.508Z",
                      "UpdatedAt": "2026-09-28T16:05:02.117Z",
                      "Actions": {
                        "Pause": true,
                        "Resume": false,
                        "Cancel": true
                      }
                    }
                  },
                  "Message": "Campaign resumed. Sending continues within about a minute."
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Send Message module not enabled"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "409": {
            "description": "The current state does not allow the action (Data carries the status or reason)"
          },
          "422": {
            "description": "Refused by a content or delivery check (details in Data)"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/messaging/cancel-campaign": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Cancel Messaging Campaign",
        "description": "Cancel a campaign that has not finished and release the monthly allowance it was holding. Cannot be undone.",
        "operationId": "messagingCancelCampaign",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "CampaignToken"
                ],
                "properties": {
                  "CampaignToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of a campaign in status scheduled, queued, sending, paused or blocked"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cancel Campaign — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "CampaignToken": "uuid-v4-string",
                    "PreviousStatus": "paused",
                    "Status": "cancelled",
                    "Sent": 2310,
                    "CancelledRows": 2331,
                    "ReleasedUnits": 4641
                  },
                  "Message": "Campaign cancelled successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Send Message module not enabled"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "409": {
            "description": "The current state does not allow the action (Data carries the status or reason)"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/messaging/suppressions": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Fetch Messaging Suppressions",
        "description": "List the account's do-not-contact list: every address that unsubscribed, replied STOP, complained, bounced or was added by you.",
        "operationId": "messagingSuppressions",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "Channel": {
                    "type": "string",
                    "enum": [
                      "email",
                      "sms"
                    ],
                    "description": "email or sms"
                  },
                  "Search": {
                    "type": "string",
                    "maxLength": 254,
                    "description": "One exact email address or phone number (max 254 characters). Without Channel, a value containing @ is searched as email, anything else as SMS"
                  },
                  "Page": {
                    "type": "integer",
                    "minimum": 1,
                    "default": 1,
                    "description": "Page number, starting at 1. Defaults to 1"
                  },
                  "ItemsPerPage": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 25,
                    "description": "1 to 100. Defaults to 25"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fetch Suppressions — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Suppressions": [
                      {
                        "Channel": "email",
                        "Address": "jane.doe@example.com",
                        "AddressHash": "3f1c9a0b5e7d2c4f8a6b1e0d9c7f5a3b2e4d6c8a0f1b3d5e7c9a2b4d6f8e0c1a",
                        "Reason": "manual",
                        "CreationDate": "2026-09-27T12:40:03.221Z",
                        "Removable": true
                      },
                      {
                        "Channel": "email",
                        "Address": "john.smith@example.com",
                        "AddressHash": "9e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d9c8b7a6f5e4d3c2b1a0f9e8d",
                        "Reason": "unsubscribe",
                        "CreationDate": "2026-09-21T08:15:44.012Z",
                        "Removable": false
                      }
                    ],
                    "TotalResults": 2,
                    "Page": 1,
                    "ItemsPerPage": 25,
                    "TotalPages": 1
                  },
                  "Message": "Suppressions fetched successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/messaging/add-suppressions": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Add Messaging Suppressions",
        "description": "Add up to 500 addresses of one channel to the account's do-not-contact list. Idempotent; never downgrades an existing opt-out.",
        "operationId": "messagingAddSuppressions",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "Channel",
                  "Addresses"
                ],
                "properties": {
                  "Channel": {
                    "type": "string",
                    "enum": [
                      "email",
                      "sms"
                    ],
                    "description": "email or sms"
                  },
                  "Addresses": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "maxItems": 500,
                    "description": "1 to 500 email addresses, or phone numbers (E.164 or 10-digit US/CA)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Add Suppressions — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Channel": "email",
                    "Received": 3,
                    "Added": 1,
                    "AlreadySuppressed": 1,
                    "Invalid": [
                      "not-an-email"
                    ],
                    "InvalidCount": 1
                  },
                  "Message": "1 address(es) added to the suppression list"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Send Message module not enabled"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60); or the endpoint daily ceiling (Data.Code)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/messaging/remove-suppression": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Remove Messaging Suppression",
        "description": "Remove one address that was added to the do-not-contact list by hand (reason manual). A recipient's own opt-out is never removable.",
        "operationId": "messagingRemoveSuppression",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "Channel"
                ],
                "properties": {
                  "Channel": {
                    "type": "string",
                    "enum": [
                      "email",
                      "sms"
                    ],
                    "description": "email or sms"
                  },
                  "Address": {
                    "type": "string",
                    "maxLength": 254,
                    "description": "The email address or phone number. Required unless AddressHash is sent"
                  },
                  "AddressHash": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$",
                    "description": "The 64-character AddressHash from Fetch Suppressions. When present, Address is ignored"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Remove Suppression — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Channel": "email",
                    "Address": "jane.doe@example.com",
                    "Reason": "manual"
                  },
                  "Message": "Address removed from the suppression list"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Send Message module not enabled"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "409": {
            "description": "The current state does not allow the action (Data carries the status or reason)"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/messaging/send": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Send Message to Participant",
        "description": "Queue one email and/or SMS written by you to one of your own participants. There is no address field; the recipient is a ParticipantToken inside your account.",
        "operationId": "messagingSend",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ParticipantToken",
                  "Channel",
                  "Message"
                ],
                "properties": {
                  "ParticipantToken": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID v4 of a participant (regular or AMOE) of your account"
                  },
                  "Channel": {
                    "type": "string",
                    "enum": [
                      "email",
                      "sms",
                      "both"
                    ],
                    "description": "email, sms or both. both sends on each channel the participant has a usable address for"
                  },
                  "Message": {
                    "type": "string",
                    "maxLength": 5000,
                    "description": "Plain text. Max 5,000 characters (1,600 when sending by SMS)"
                  },
                  "Subject": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Email subject, max 200 characters. Line breaks are collapsed. Defaults to a generic subject"
                  },
                  "IdempotencyKey": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{8,64}$",
                    "description": "8 to 64 characters [A-Za-z0-9_-]. Retrying with the same key never sends twice"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Send Message — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "ParticipantToken": "uuid-v4-string",
                    "NotificationId": "66f8a1c2e4b0a91d2c3e4f50",
                    "Duplicate": false,
                    "Channels": [
                      {
                        "Channel": "email",
                        "Status": "queued",
                        "MessageToken": "uuid-v4-string"
                      },
                      {
                        "Channel": "sms",
                        "Status": "skipped",
                        "Reason": "NoAddress",
                        "Message": "The participant has no valid phone number."
                      }
                    ]
                  },
                  "Message": "Message queued. It is delivered within about a minute (SMS outside quiet hours)."
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Send Message module not enabled, direct messages not enabled (DirectMessageNotEnabled), channel not in plan, sending paused or no 10DLC number"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "422": {
            "description": "Refused by a content or delivery check (details in Data)"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60); or the endpoint daily ceiling (Data.Code)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/surveys/fetch": {
      "post": {
        "tags": [
          "Surveys"
        ],
        "summary": "Fetch Surveys",
        "description": "List the surveys of the account with their question, page and response counters, plus the public HUB link of each one.",
        "operationId": "surveysFetch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "Status": {
                    "type": "boolean"
                  },
                  "Archived": {
                    "type": "boolean"
                  },
                  "Page": {
                    "type": "integer",
                    "default": 1
                  },
                  "Limit": {
                    "type": "integer",
                    "default": 50,
                    "maximum": 200
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Surveys fetched",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, Surveys module not enabled, or monthly quota exceeded"
          },
          "404": {
            "description": "Survey not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/surveys/create": {
      "post": {
        "tags": [
          "Surveys"
        ],
        "summary": "Create Survey",
        "description": "Create a survey together with its whole question set in one call. Pages are renumbered 1..N with no gaps and Order is the position inside the array, per page.",
        "operationId": "surveysCreate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SweepstakesToken",
                  "SurveyName"
                ],
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "SurveyName": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "Status": {
                    "type": "boolean",
                    "default": true
                  },
                  "Settings": {
                    "type": "object"
                  },
                  "Questions": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Survey created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, Surveys module not enabled, or monthly quota exceeded"
          },
          "404": {
            "description": "Survey not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/surveys/single": {
      "post": {
        "tags": [
          "Surveys"
        ],
        "summary": "Fetch Single Survey",
        "description": "Retrieve one survey with its complete question set, ordered by page and position, plus the IsLocked flag that says whether the structure can still be replaced.",
        "operationId": "surveysSingle",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SurveyToken"
                ],
                "properties": {
                  "SurveyToken": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Survey fetched",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, Surveys module not enabled, or monthly quota exceeded"
          },
          "404": {
            "description": "Survey not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/surveys/update": {
      "post": {
        "tags": [
          "Surveys"
        ],
        "summary": "Update Survey",
        "description": "Update a survey. Questions is a full replacement of the question set and is rejected with 409 once the survey has at least one response.",
        "operationId": "surveysUpdate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SurveyToken"
                ],
                "properties": {
                  "SurveyToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "SurveyName": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "Status": {
                    "type": "boolean"
                  },
                  "Archived": {
                    "type": "boolean"
                  },
                  "Settings": {
                    "type": "object"
                  },
                  "Questions": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Survey updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, Surveys module not enabled, or monthly quota exceeded"
          },
          "404": {
            "description": "Survey not found"
          },
          "409": {
            "description": "The survey already has responses, so its question set can no longer be replaced"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/surveys/delete": {
      "post": {
        "tags": [
          "Surveys"
        ],
        "summary": "Delete Survey",
        "description": "Permanently delete a survey with its questions, responses, statistics and uploaded media. Confirm must be true when the survey already holds responses.",
        "operationId": "surveysDelete",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SurveyToken"
                ],
                "properties": {
                  "SurveyToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "Confirm": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Survey deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, Surveys module not enabled, or monthly quota exceeded"
          },
          "404": {
            "description": "Survey not found"
          },
          "409": {
            "description": "The survey holds collected responses — send Confirm: true to destroy them"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/surveys/responses": {
      "post": {
        "tags": [
          "Surveys"
        ],
        "summary": "Fetch Survey Responses",
        "description": "Retrieve the individual answers collected by a survey, newest first and paginated. The device and IP metadata block is opt-in.",
        "operationId": "surveysResponses",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SurveyToken"
                ],
                "properties": {
                  "SurveyToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "Completed": {
                    "type": "boolean"
                  },
                  "FromDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "ToDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "IncludeMetadata": {
                    "type": "boolean",
                    "default": false
                  },
                  "Page": {
                    "type": "integer",
                    "default": 1
                  },
                  "Limit": {
                    "type": "integer",
                    "default": 25,
                    "maximum": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Survey responses fetched",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, Surveys module not enabled, or monthly quota exceeded"
          },
          "404": {
            "description": "Survey not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/surveys/report": {
      "post": {
        "tags": [
          "Surveys"
        ],
        "summary": "Fetch Survey Report",
        "description": "Retrieve the aggregated report of a survey: funnel totals, completion rate and times, device and browser breakdowns, daily timeline and per-question answer distributions.",
        "operationId": "surveysReport",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SurveyToken"
                ],
                "properties": {
                  "SurveyToken": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "TimelineDays": {
                    "type": "integer",
                    "default": 30,
                    "maximum": 365
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Survey report fetched",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, Surveys module not enabled, or monthly quota exceeded"
          },
          "404": {
            "description": "Survey not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/messaging/drips": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "List Drip Campaigns",
        "description": "Lists the drip campaigns (automated email or SMS sequences) of your account, with their status, people counters and your plan allowance. Drips are created, edited and activated only in the Sweeppea app.",
        "operationId": "messagingFetchDrips",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "SweepstakesToken": {
                    "type": "string",
                    "description": "UUID v4. Only drips of this sweepstakes.",
                    "format": "uuid"
                  },
                  "Channel": {
                    "type": "string",
                    "description": "email or sms."
                  },
                  "Status": {
                    "type": "string",
                    "description": "draft, active, paused, completed or blocked."
                  },
                  "Search": {
                    "type": "string",
                    "description": "Part of the drip name, max 100 characters."
                  },
                  "Archived": {
                    "type": "boolean",
                    "description": "true lists archived drips instead. Default false."
                  },
                  "Page": {
                    "type": "integer",
                    "description": "Page number, starting at 1. Default 1."
                  },
                  "ItemsPerPage": {
                    "type": "integer",
                    "description": "1 to 100. Default 25."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "List Drip Campaigns — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Drips": [
                      {
                        "DripToken": "uuid-v4-string",
                        "SweepstakesToken": "uuid-v4-string",
                        "Name": "Welcome Series",
                        "Description": "Three emails for new entrants",
                        "Channel": "email",
                        "Status": "active",
                        "BlockedReason": null,
                        "StaffHold": false,
                        "Archived": false,
                        "Trigger": "join",
                        "StepsCount": 3,
                        "Counters": {
                          "Enrolled": 1240,
                          "Active": 812,
                          "Completed": 356,
                          "Exited": {
                            "Unsubscribed": 38,
                            "Suppressed": 9,
                            "Won": 4,
                            "Removed": 2
                          },
                          "Deferred": {}
                        },
                        "Origin": "user",
                        "ActivatedAt": "2026-09-20T14:02:11.000Z",
                        "PausedAt": null,
                        "CompletedAt": null,
                        "CreationDate": "2026-09-18T10:15:40.000Z",
                        "UpdatedAt": "2026-09-20T14:02:11.000Z"
                      }
                    ],
                    "TotalResults": 1,
                    "Page": 1,
                    "ItemsPerPage": 25,
                    "TotalPages": 1,
                    "PlanLimit": {
                      "MaxAllowed": 3,
                      "CurrentCount": 2,
                      "Unlimited": false,
                      "LimitReached": false
                    },
                    "CanRun": true
                  },
                  "Message": "Drip campaigns fetched successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Drip Marketing module not enabled"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/messaging/drip": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Get Drip Campaign",
        "description": "Returns one drip campaign in full: every step with its delay and content, a summary of the audience and the sending settings.",
        "operationId": "messagingFetchDrip",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "DripToken"
                ],
                "properties": {
                  "DripToken": {
                    "type": "string",
                    "description": "UUID v4 of the drip.",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Get Drip Campaign — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Drip": {
                      "DripToken": "uuid-v4-string",
                      "SweepstakesToken": "uuid-v4-string",
                      "Name": "Welcome Series",
                      "Description": "Three emails for new entrants",
                      "Channel": "email",
                      "Status": "active",
                      "BlockedReason": null,
                      "StaffHold": false,
                      "Archived": false,
                      "Trigger": "join",
                      "StepsCount": 3,
                      "Counters": {
                        "Enrolled": 1240,
                        "Active": 812,
                        "Completed": 356,
                        "Exited": {
                          "Unsubscribed": 38,
                          "Suppressed": 9,
                          "Won": 4,
                          "Removed": 2
                        },
                        "Deferred": {}
                      },
                      "Origin": "user",
                      "ActivatedAt": "2026-09-20T14:02:11.000Z",
                      "PausedAt": null,
                      "CompletedAt": null,
                      "CreationDate": "2026-09-18T10:15:40.000Z",
                      "UpdatedAt": "2026-09-20T14:02:11.000Z",
                      "Audience": {
                        "Sources": [
                          "participants"
                        ],
                        "AcquisitionChannels": [],
                        "Groups": 0,
                        "Lists": 0,
                        "Agents": 0
                      },
                      "Settings": {
                        "Language": "en",
                        "SendWindow": null,
                        "ExitOnClick": false,
                        "ExitOnWin": true,
                        "MaxEnrollmentsPerDay": null,
                        "HasTemplate": true
                      },
                      "Steps": [
                        {
                          "Index": 0,
                          "StepToken": "uuid-v4-string",
                          "Name": "Welcome",
                          "Delay": {
                            "Value": 1,
                            "Unit": "hours"
                          },
                          "Content": {
                            "Subject": "Welcome, [ FIRST_NAME ]!",
                            "Preheader": "Thanks for entering",
                            "Blocks": [
                              {
                                "Type": "text",
                                "Text": "Good luck in the drawing!"
                              }
                            ]
                          }
                        }
                      ]
                    }
                  },
                  "Message": "Drip campaign fetched successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Drip Marketing module not enabled"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/messaging/drip-report": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Drip Campaign Report",
        "description": "Message statistics of a drip campaign: per step, in total, day by day, and the links people clicked.",
        "operationId": "messagingDripReport",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "DripToken"
                ],
                "properties": {
                  "DripToken": {
                    "type": "string",
                    "description": "UUID v4 of the drip.",
                    "format": "uuid"
                  },
                  "Days": {
                    "type": "integer",
                    "description": "Activity window: 7, 30, 90 or 180. Default 30."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Drip Campaign Report — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Drip": {
                      "DripToken": "uuid-v4-string",
                      "SweepstakesToken": "uuid-v4-string",
                      "Name": "Welcome Series",
                      "Description": "Three emails for new entrants",
                      "Channel": "email",
                      "Status": "active",
                      "BlockedReason": null,
                      "StaffHold": false,
                      "Archived": false,
                      "Trigger": "join",
                      "StepsCount": 3,
                      "Counters": {
                        "Enrolled": 1240,
                        "Active": 812,
                        "Completed": 356,
                        "Exited": {
                          "Unsubscribed": 38,
                          "Suppressed": 9,
                          "Won": 4,
                          "Removed": 2
                        },
                        "Deferred": {}
                      },
                      "Origin": "user",
                      "ActivatedAt": "2026-09-20T14:02:11.000Z",
                      "PausedAt": null,
                      "CompletedAt": null,
                      "CreationDate": "2026-09-18T10:15:40.000Z",
                      "UpdatedAt": "2026-09-20T14:02:11.000Z"
                    },
                    "Days": 30,
                    "People": {
                      "Enrolled": 1240,
                      "Active": 812,
                      "Completed": 356,
                      "Exited": {
                        "Unsubscribed": 38,
                        "Suppressed": 9,
                        "Won": 4,
                        "Removed": 2
                      },
                      "Deferred": {}
                    },
                    "Totals": {
                      "Sent": 2310,
                      "Delivered": 2281,
                      "Opened": 1104,
                      "Clicked": 212,
                      "Bounced": 21,
                      "Complained": 1,
                      "Unsubscribed": 38,
                      "Failed": 8
                    },
                    "Rates": {
                      "Delivered": 98.74,
                      "Opened": 47.79,
                      "Clicked": 9.18,
                      "Unsubscribed": 1.65,
                      "Bounced": 0.91,
                      "Complained": 0.04
                    },
                    "Steps": [
                      {
                        "Index": 0,
                        "Name": "Welcome",
                        "Delay": {
                          "Value": 1,
                          "Unit": "hours"
                        },
                        "Waiting": 120,
                        "Counters": {
                          "Sent": 1180,
                          "Delivered": 1166,
                          "Opened": 640,
                          "Clicked": 131,
                          "Bounced": 12,
                          "Complained": 0,
                          "Unsubscribed": 14,
                          "Failed": 2
                        },
                        "Rates": {
                          "Delivered": 98.81,
                          "Opened": 54.24,
                          "Clicked": 11.1,
                          "Unsubscribed": 1.19,
                          "Bounced": 1.02
                        }
                      }
                    ],
                    "Timeline": [
                      {
                        "Day": "2026-10-01",
                        "Sent": 84,
                        "Opened": 41,
                        "Clicked": 7,
                        "Unsubscribed": 1
                      }
                    ],
                    "TopLinks": [
                      {
                        "Link": "https://example.com/prizes",
                        "Step": 1,
                        "Clicks": 96
                      }
                    ]
                  },
                  "Message": "Drip campaign report fetched successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Drip Marketing module not enabled"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/messaging/drip-enrollments": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "List Drip Enrollments",
        "description": "Lists the contacts enrolled in a drip campaign: where each one is in the sequence and why anyone left.",
        "operationId": "messagingDripEnrollments",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "DripToken"
                ],
                "properties": {
                  "DripToken": {
                    "type": "string",
                    "description": "UUID v4 of the drip.",
                    "format": "uuid"
                  },
                  "Status": {
                    "type": "string",
                    "description": "active, completed or exited."
                  },
                  "SourceToken": {
                    "type": "string",
                    "description": "Only this contact (a ParticipantToken, or a lead / subscriber id)."
                  },
                  "Page": {
                    "type": "integer",
                    "description": "Page number, starting at 1. Default 1."
                  },
                  "ItemsPerPage": {
                    "type": "integer",
                    "description": "1 to 100. Default 25."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "List Drip Enrollments — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "DripToken": "uuid-v4-string",
                    "Enrollments": [
                      {
                        "EnrollmentToken": "uuid-v4-string",
                        "SourceType": "participant",
                        "SourceToken": "uuid-v4-string",
                        "Status": "active",
                        "ExitReason": null,
                        "NextStep": 2,
                        "NextStepAt": "2026-10-04T15:00:00.000Z",
                        "EnrolledAt": "2026-10-01T14:58:12.000Z",
                        "LastSentAt": "2026-10-01T16:00:03.000Z",
                        "EndedAt": null
                      }
                    ],
                    "TotalResults": 1,
                    "Page": 1,
                    "ItemsPerPage": 25,
                    "TotalPages": 1
                  },
                  "Message": "Drip enrollments fetched successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Drip Marketing module not enabled"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/messaging/pause-drip": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Pause Drip Campaign",
        "description": "Pauses an active drip campaign: no new contact is enrolled and no step is sent until it is resumed.",
        "operationId": "messagingPauseDrip",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "DripToken"
                ],
                "properties": {
                  "DripToken": {
                    "type": "string",
                    "description": "UUID v4 of a drip in status active.",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pause Drip Campaign — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Drip": {
                      "DripToken": "uuid-v4-string",
                      "SweepstakesToken": "uuid-v4-string",
                      "Name": "Welcome Series",
                      "Description": "Three emails for new entrants",
                      "Channel": "email",
                      "Status": "paused",
                      "BlockedReason": null,
                      "StaffHold": false,
                      "Archived": false,
                      "Trigger": "join",
                      "StepsCount": 3,
                      "Counters": {
                        "Enrolled": 1240,
                        "Active": 812,
                        "Completed": 356,
                        "Exited": {
                          "Unsubscribed": 38,
                          "Suppressed": 9,
                          "Won": 4,
                          "Removed": 2
                        },
                        "Deferred": {}
                      },
                      "Origin": "user",
                      "ActivatedAt": "2026-09-20T14:02:11.000Z",
                      "PausedAt": "2026-10-02T17:20:00.000Z",
                      "CompletedAt": null,
                      "CreationDate": "2026-09-18T10:15:40.000Z",
                      "UpdatedAt": "2026-09-20T14:02:11.000Z"
                    },
                    "ReleasedUnits": 42
                  },
                  "Message": "Drip campaign paused successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Send Message or Drip Marketing module not enabled"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "409": {
            "description": "The current state does not allow the action (Data carries the status or reason)"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/messaging/resume-drip": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Resume Drip Campaign",
        "description": "Resumes a drip campaign you paused, provided nothing has changed since and the account can still send.",
        "operationId": "messagingResumeDrip",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "DripToken"
                ],
                "properties": {
                  "DripToken": {
                    "type": "string",
                    "description": "UUID v4 of a drip in status paused, not edited since it was paused.",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resume Drip Campaign — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "Drip": {
                      "DripToken": "uuid-v4-string",
                      "SweepstakesToken": "uuid-v4-string",
                      "Name": "Welcome Series",
                      "Description": "Three emails for new entrants",
                      "Channel": "email",
                      "Status": "active",
                      "BlockedReason": null,
                      "StaffHold": false,
                      "Archived": false,
                      "Trigger": "join",
                      "StepsCount": 3,
                      "Counters": {
                        "Enrolled": 1240,
                        "Active": 812,
                        "Completed": 356,
                        "Exited": {
                          "Unsubscribed": 38,
                          "Suppressed": 9,
                          "Won": 4,
                          "Removed": 2
                        },
                        "Deferred": {}
                      },
                      "Origin": "user",
                      "ActivatedAt": "2026-09-20T14:02:11.000Z",
                      "PausedAt": null,
                      "CompletedAt": null,
                      "CreationDate": "2026-09-18T10:15:40.000Z",
                      "UpdatedAt": "2026-09-20T14:02:11.000Z"
                    },
                    "Note": "The drip picks up within the next few minutes (the sequencer runs every 5 minutes)."
                  },
                  "Message": "Drip campaign resumed successfully"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Send Message or Drip Marketing module not enabled; on resume also the plan, channel, 10DLC or a staff hold (Data.Reason)"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "409": {
            "description": "The current state does not allow the action (Data carries the status or reason)"
          },
          "423": {
            "description": "Sending on the channel is paused by Sweeppea right now"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/messaging/drip-remove-contact": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Remove Contact From Drip",
        "description": "Takes one contact out of a drip campaign so it receives no more steps.",
        "operationId": "messagingRemoveDripContact",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "DripToken",
                  "SourceToken"
                ],
                "properties": {
                  "DripToken": {
                    "type": "string",
                    "description": "UUID v4 of the drip.",
                    "format": "uuid"
                  },
                  "SourceToken": {
                    "type": "string",
                    "description": "The contact: a ParticipantToken, or a lead / subscriber id."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Remove Contact From Drip — success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Response": {
                      "type": "boolean"
                    },
                    "Telemetry": {
                      "type": "object",
                      "properties": {
                        "DataConsumed": {
                          "type": "integer"
                        },
                        "APICalls": {
                          "type": "integer"
                        },
                        "MaxAPICalls": {
                          "type": "integer"
                        }
                      }
                    },
                    "Data": {
                      "type": "object"
                    },
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Response": true,
                  "Telemetry": {
                    "DataConsumed": 0,
                    "APICalls": 312,
                    "MaxAPICalls": 1500000
                  },
                  "Data": {
                    "DripToken": "uuid-v4-string",
                    "SourceToken": "uuid-v4-string",
                    "Removed": 1
                  },
                  "Message": "Contact removed from the drip"
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Includes a Help.ExpectedBody block listing every accepted parameter"
          },
          "401": {
            "description": "Invalid or missing Bearer token"
          },
          "403": {
            "description": "Invalid API token, account disabled, or monthly quota exceeded, Send Message or Drip Marketing module not enabled"
          },
          "404": {
            "description": "Not found, or it belongs to another account"
          },
          "409": {
            "description": "The current state does not allow the action (Data carries the status or reason)"
          },
          "429": {
            "description": "Rate limit exceeded (Retry-After: 60)"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    }
  }
}
