{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/optimizely/main/json-schema/optimizely-rest-smart-campaign-schema.json",
  "title": "RestSmartCampaign",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/optimizely-smart-campaigns-api-openapi.yml#/components/schemas/RestSmartCampaign",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Campaign ID",
      "format": "int64"
    },
    "name": {
      "type": "string",
      "description": "Campaign name"
    },
    "mailingGroupId": {
      "type": "integer",
      "description": "Client ID",
      "format": "int64"
    },
    "description": {
      "type": "string",
      "description": "Mailing description"
    },
    "status": {
      "type": "string",
      "description": "Current campaign status",
      "enum": [
        "invalid",
        "activationRequired",
        "activated",
        "canceled",
        "paused",
        "running",
        "finished"
      ]
    },
    "type": {
      "type": "string",
      "description": "Campaign type",
      "enum": [
        "regular",
        "event",
        "confirmation"
      ]
    },
    "created": {
      "type": "string",
      "description": "Creation date",
      "format": "date-time"
    },
    "modified": {
      "type": "string",
      "description": "Modification date",
      "format": "date-time"
    },
    "started": {
      "type": "string",
      "description": "Start date of the campaign",
      "format": "date-time"
    },
    "finished": {
      "type": "string",
      "description": "Finish date of the campaign",
      "format": "date-time"
    },
    "links": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "uriBuilder": {
            "type": "object"
          },
          "rels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rel": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "params": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "title": {
            "type": "string"
          },
          "uri": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    },
    "recipientLists": {
      "$ref": "#/$defs/RestRecipientListsNode"
    },
    "targetGroups": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RestTargetGroupNode"
      }
    },
    "messages": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RestMessageNode"
      }
    },
    "message": {
      "$ref": "#/$defs/RestMessageNode"
    }
  },
  "$defs": {
    "Filter": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        }
      }
    },
    "Point": {
      "type": "object",
      "properties": {
        "x": {
          "type": "integer",
          "format": "int32"
        },
        "y": {
          "type": "integer",
          "format": "int32"
        }
      },
      "description": "Grid location point"
    },
    "RestMessageNode": {
      "type": "object",
      "properties": {
        "nodeId": {
          "type": "string",
          "description": "Node ID"
        },
        "name": {
          "type": "string",
          "description": "Mailing name"
        },
        "mailingId": {
          "type": "integer",
          "description": "Mailing ID",
          "format": "int64"
        },
        "description": {
          "type": "string",
          "description": "Mailing description"
        },
        "mediaType": {
          "type": "string",
          "description": "Media type of the mailing"
        },
        "status": {
          "type": "string",
          "description": "Current status of the mailing",
          "enum": [
            "invalid",
            "activationRequired",
            "activated",
            "canceled",
            "paused",
            "running",
            "finished"
          ]
        },
        "created": {
          "type": "string",
          "description": "Creation date",
          "format": "date-time"
        },
        "modified": {
          "type": "string",
          "description": "Modification date",
          "format": "date-time"
        },
        "started": {
          "type": "string",
          "description": "Start date of the mailing",
          "format": "date-time"
        },
        "finished": {
          "type": "string",
          "description": "Finish date of the mailing",
          "format": "date-time"
        },
        "senderAddress": {
          "type": "string",
          "description": "Email address of the sender"
        },
        "senderName": {
          "type": "string",
          "description": "Sender name"
        },
        "replyToAddress": {
          "type": "string",
          "description": "Email address for reply emails"
        },
        "replyToName": {
          "type": "string",
          "description": "Name for reply emails"
        },
        "subject": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "mediaCode": {
          "type": "string",
          "description": "Media code of the mailing"
        },
        "format": {
          "type": "string",
          "description": "Mailing format"
        },
        "dispatchOption": {
          "type": "string",
          "description": "Dispatch options of the print mailing"
        },
        "dispatchStrategyOption": {
          "type": "string",
          "description": "Dispatch strategy of the print mailing"
        },
        "accumulateMessagesForDays": {
          "type": "integer",
          "description": "Number of messages per day",
          "format": "int32"
        },
        "pushType": {
          "type": "string",
          "description": "Push type (push message)",
          "enum": [
            "MOBILE",
            "WEB"
          ]
        },
        "icon": {
          "type": "string",
          "description": "Icon (push message)"
        },
        "clickAction": {
          "type": "string",
          "description": "Click action (push message)"
        },
        "archiveEnabled": {
          "type": "boolean",
          "description": "Is mail archiving enabled"
        },
        "archivePeriod": {
          "type": "string",
          "description": "Mail archiving period",
          "enum": [
            "ONE_MONTH",
            "TWO_MONTHS",
            "THREE_MONTHS",
            "SIX_MONTHS",
            "ONE_YEAR",
            "TWO_YEARS"
          ]
        },
        "smsParts": {
          "type": "integer",
          "description": "Number of SMS parts",
          "format": "int32"
        },
        "deeplinks": {
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "description": "Deeplinks of the push message"
          },
          "description": "Deeplinks of the push message"
        },
        "links": {
          "type": "array",
          "description": "Restful links",
          "items": {
            "type": "object",
            "properties": {
              "uriBuilder": {
                "type": "object"
              },
              "rels": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "rel": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "params": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "title": {
                "type": "string"
              },
              "uri": {
                "type": "string",
                "format": "uri"
              }
            },
            "description": "Restful links"
          }
        },
        "content": {
          "type": "string",
          "description": "Mailing content"
        },
        "payload": {
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "description": "Payload of the push message"
          },
          "description": "Payload of the push message"
        },
        "contentType": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string"
            },
            "subtype": {
              "type": "string"
            },
            "parameters": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "wildcardType": {
              "type": "boolean"
            },
            "wildcardSubtype": {
              "type": "boolean"
            }
          },
          "description": "Content type of the mailing"
        },
        "expiry": {
          "type": "string",
          "description": "Expiry date and time of the push message",
          "format": "date-time"
        },
        "attachmentIds": {
          "type": "array",
          "description": "Comma-separated list of attachment IDs",
          "items": {
            "type": "integer",
            "description": "Comma-separated list of attachment IDs",
            "format": "int64"
          }
        },
        "gridLocation": {
          "$ref": "#/$defs/Point"
        }
      }
    },
    "RestRecipientListsNode": {
      "type": "object",
      "properties": {
        "nodeId": {
          "type": "string",
          "description": "Node ID"
        },
        "successorNodeId": {
          "type": "string",
          "description": "Successor node ID"
        },
        "recipientListIds": {
          "type": "array",
          "description": "List of recipient list IDs",
          "items": {
            "type": "integer",
            "description": "List of recipient list IDs",
            "format": "int64"
          }
        },
        "links": {
          "type": "array",
          "description": "Links for further requests",
          "items": {
            "type": "object",
            "properties": {
              "uriBuilder": {
                "type": "object"
              },
              "rels": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "rel": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "params": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "title": {
                "type": "string"
              },
              "uri": {
                "type": "string",
                "format": "uri"
              }
            },
            "description": "Links for further requests"
          }
        },
        "gridLocation": {
          "$ref": "#/$defs/Point"
        }
      }
    },
    "RestTargetGroupNode": {
      "type": "object",
      "properties": {
        "nodeId": {
          "type": "string",
          "description": "Node ID"
        },
        "successorNodeId": {
          "type": "string",
          "description": "Successor node ID"
        },
        "name": {
          "type": "string",
          "description": "Target group name"
        },
        "targetGroup": {
          "$ref": "#/$defs/Filter"
        },
        "links": {
          "type": "array",
          "description": "Links for further requests",
          "items": {
            "type": "object",
            "properties": {
              "uriBuilder": {
                "type": "object"
              },
              "rels": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "rel": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "params": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "title": {
                "type": "string"
              },
              "uri": {
                "type": "string",
                "format": "uri"
              }
            },
            "description": "Links for further requests"
          }
        },
        "gridLocation": {
          "$ref": "#/$defs/Point"
        }
      }
    }
  }
}