{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/honkio-ca/json-schema/honkio-ca-opt-out-schema.json",
  "title": "OptOut",
  "description": "An opt-out record as stored: field names are camelCase, unlike the rest of the API.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/honkio-ca-compliance-casl-api-openapi.yml#/components/schemas/OptOut",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "id",
    "accountId",
    "channel",
    "phoneNumber",
    "fromNumber",
    "fromAddress",
    "emailAddress",
    "keywordUsed",
    "optedOutAt",
    "reinstatedAt",
    "reinstateKeyword"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "accountId": {
      "type": "string"
    },
    "channel": {
      "type": "string",
      "enum": [
        "SMS",
        "EMAIL"
      ]
    },
    "phoneNumber": {
      "type": [
        "string",
        "null"
      ]
    },
    "fromNumber": {
      "type": [
        "string",
        "null"
      ],
      "description": "The sending number the subscriber opted out from (SMS)."
    },
    "fromAddress": {
      "type": [
        "string",
        "null"
      ]
    },
    "emailAddress": {
      "type": [
        "string",
        "null"
      ]
    },
    "keywordUsed": {
      "type": [
        "string",
        "null"
      ],
      "description": "STOP, UNSUBSCRIBE and so on; null for an opt-out recorded through the API."
    },
    "optedOutAt": {
      "type": "string",
      "format": "date-time"
    },
    "reinstatedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "reinstateKeyword": {
      "type": [
        "string",
        "null"
      ]
    }
  }
}