{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adobe/json-schema/adobe-auto-allocate-activity-schema.json",
  "title": "AutoAllocateActivity",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adobe-target-admin-openapi.yml#/components/schemas/AutoAllocateActivity",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "format": "int64"
    },
    "thirdPartyId": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "startsAt": {
      "type": "string",
      "format": "date-time"
    },
    "endsAt": {
      "type": "string",
      "format": "date-time"
    },
    "state": {
      "$ref": "#/$defs/ActivityState"
    },
    "priority": {
      "type": "integer",
      "format": "int32"
    },
    "autoAllocateTraffic": {
      "$ref": "#/$defs/AutoAllocateTraffic"
    },
    "entryConstraint": {
      "$ref": "#/$defs/EntryConstraint"
    },
    "applicationContext": {
      "$ref": "#/$defs/ApplicationContext"
    },
    "options": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Option"
      }
    },
    "locations": {
      "$ref": "#/$defs/Locations"
    },
    "views": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ViewReference"
      }
    },
    "experiences": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Experience"
      }
    },
    "metrics": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Metric"
      }
    },
    "reportingAudiences": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ReportingAudience"
      }
    },
    "reportingSource": {
      "type": "string",
      "enum": [
        "target",
        "analytics",
        "customer_journey_analytics"
      ]
    },
    "analytics": {
      "$ref": "#/$defs/Analytics"
    },
    "cjaReporting": {
      "$ref": "#/$defs/CjaReporting"
    },
    "workspace": {
      "$ref": "#/$defs/workspace"
    },
    "propertyIds": {
      "uniqueItems": true,
      "type": "array",
      "items": {
        "type": "integer",
        "format": "int64"
      }
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "modifiedAt": {
      "type": "string",
      "format": "date-time"
    },
    "modifiedByName": {
      "type": "string"
    },
    "platform": {
      "$ref": "#/$defs/PlatformMetadata"
    }
  },
  "$defs": {
    "ActivityState": {
      "type": "string",
      "description": "<p>There are four valid activity states: approved, saved, deactivated, and deleted.</p><p>The \"Approved\" state has two attributes called startAt and endAt that play a vital role in what happens when you update the activity state to \"Approved\". startAt is the date and time that the activity is/was scheduled to begin. endAt is the date and time that the activity is/was scheduled to end.</p><p><b>Caution</b>: There is approximately a 15-minute latency between the API and the UI, so when setting dates give it time.&nbsp;</p><p>&nbsp;</p><div><table><tbody><tr><th>API State</th><th>Start At</th><th>End At</th><th>UI Status</th></tr><tr><td>Approved</td><td>in the past</td><td>in the future</td><td>Live</td></tr><tr><td>Approved</td><td>in the past</td><td>in the past</td><td>Ended</td></tr><tr><td>Approved</td><td>in the future</td><td>in the future</td><td>Scheduled</td></tr><tr><td>Saved</td><td>-</td><td>-</td><td>Inactive</td></tr><tr><td>Deactivated</td><td>-</td><td>-</td><td>Archived</td></tr><tr><td>Deleted&nbsp;</td><td>-</td><td>-</td><td>Does Not Appear in the UI</td></tr></tbody></table></div><p>&nbsp;</p><p><b>Note</b>: When setting an activity to any state using the API, the activity will stay the state that you set it to be even while the status in the UI changes. So if you set an activity to Approved and it passes the end date, the UI will show that it has ended, but the state will still be Approved.&nbsp;</p><p>&nbsp;</p></div> ",
      "enum": [
        "approved",
        "saved",
        "deactivated",
        "deleted"
      ]
    },
    "Analytics": {
      "type": "object",
      "properties": {
        "dataCollectionHost": {
          "type": "string"
        },
        "reportSuites": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReportSuites"
          }
        }
      }
    },
    "ApplicationContext": {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "enum": [
            "web",
            "mobile"
          ]
        },
        "applicationVersions": {
          "uniqueItems": true,
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "mobilePlatformVersions": {
          "uniqueItems": true,
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "deviceType": {
          "type": "string",
          "enum": [
            "phone",
            "tablet"
          ]
        },
        "screenOrientation": {
          "type": "string",
          "enum": [
            "landscape",
            "portrait"
          ]
        }
      }
    },
    "AutoAllocateTraffic": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "successEvaluationCriteria": {
          "type": "string",
          "enum": [
            "conversion_rate",
            "rpv",
            "engagement"
          ]
        }
      }
    },
    "CjaMetric": {
      "type": "object",
      "properties": {
        "cjaMetricId": {
          "type": "string"
        }
      }
    },
    "CjaReporting": {
      "type": "object",
      "properties": {
        "dataViewId": {
          "type": "string"
        }
      }
    },
    "ClickTrackSelector": {
      "type": "object",
      "properties": {
        "selector": {
          "type": "string"
        },
        "audienceIds": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int64"
          }
        },
        "selectorVersion": {
          "type": "integer",
          "format": "int32"
        },
        "viewLocalId": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "Conditions": {
      "type": "object",
      "properties": {
        "maxVisitCount": {
          "type": "integer",
          "format": "int32"
        },
        "maxImpressionCount": {
          "type": "integer",
          "format": "int32"
        },
        "experiences": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExperienceCondition"
          }
        }
      }
    },
    "EntryConstraint": {
      "type": "object",
      "properties": {
        "mboxes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EntryConstraintMbox"
          }
        },
        "visitorPercentage": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "EntryConstraintMbox": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "audienceIds": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int64"
          }
        }
      }
    },
    "Experience": {
      "type": "object",
      "properties": {
        "experienceLocalId": {
          "type": "integer",
          "format": "int32"
        },
        "name": {
          "type": "string"
        },
        "audienceIds": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int64"
          }
        },
        "visitorPercentage": {
          "type": "integer",
          "format": "int32"
        },
        "optionLocations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OptionLocation"
          }
        }
      }
    },
    "ExperienceCondition": {
      "type": "object",
      "properties": {
        "experienceLocalId": {
          "type": "integer",
          "format": "int32"
        },
        "maxVisitCount": {
          "type": "integer",
          "format": "int32"
        },
        "maxImpressionCount": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "Locations": {
      "type": "object",
      "properties": {
        "mboxes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Mbox"
          }
        },
        "selectors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Selector"
          }
        }
      }
    },
    "Mbox": {
      "type": "object",
      "properties": {
        "locationLocalId": {
          "type": "integer",
          "format": "int32"
        },
        "name": {
          "type": "string"
        },
        "audienceIds": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int64"
          }
        }
      }
    },
    "Metric": {
      "type": "object",
      "properties": {
        "metricLocalId": {
          "type": "integer",
          "format": "int32"
        },
        "name": {
          "type": "string"
        },
        "conversion": {
          "type": "boolean"
        },
        "engagement": {
          "type": "string",
          "enum": [
            "page_count",
            "score",
            "time_on_site",
            "none"
          ]
        },
        "action": {
          "$ref": "#/$defs/MetricAction"
        },
        "mboxes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MetricMbox"
          }
        },
        "clickTrackSelectors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ClickTrackSelector"
          }
        },
        "views": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MetricView"
          }
        },
        "analytics": {
          "$ref": "#/$defs/Analytics"
        },
        "cjaMetrics": {
          "$ref": "#/$defs/CjaMetric"
        }
      }
    },
    "MetricAction": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "count_once",
            "count_landings",
            "always_convert",
            "restart_same_experience",
            "restart_random_experience",
            "restart_new_experience",
            "exclude_to_same_experience",
            "ban_from_campaign"
          ]
        },
        "conditions": {
          "$ref": "#/$defs/Conditions"
        },
        "onConditionsMetAction": {
          "type": "string",
          "enum": [
            "count_once",
            "count_landings",
            "always_convert",
            "restart_same_experience",
            "restart_random_experience",
            "restart_new_experience",
            "exclude_to_same_experience",
            "ban_from_campaign"
          ]
        }
      }
    },
    "MetricMbox": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "successEvent": {
          "type": "string",
          "enum": [
            "mbox_clicked",
            "mbox_shown"
          ]
        },
        "audienceIds": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int64"
          }
        }
      }
    },
    "MetricView": {
      "type": "object",
      "properties": {
        "viewLocalId": {
          "type": "integer",
          "format": "int32"
        },
        "audienceIds": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int64"
          }
        }
      }
    },
    "OfferTemplate": {
      "type": "object",
      "properties": {
        "offerTemplateId": {
          "type": "integer",
          "format": "int64"
        },
        "templateParameters": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TemplateParameter"
          }
        }
      }
    },
    "Option": {
      "type": "object",
      "properties": {
        "optionLocalId": {
          "type": "integer",
          "format": "int32"
        },
        "name": {
          "type": "string"
        },
        "offerId": {
          "type": "integer",
          "format": "int64"
        },
        "offerTemplates": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OfferTemplate"
          }
        }
      }
    },
    "OptionLocation": {
      "type": "object",
      "properties": {
        "locationLocalId": {
          "type": "integer",
          "format": "int32"
        },
        "optionLocalId": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "PlatformMetadata": {
      "type": "object",
      "properties": {
        "sandbox": {
          "$ref": "#/$defs/Sandbox"
        }
      }
    },
    "ReportSuites": {
      "type": "object",
      "properties": {
        "companyName": {
          "type": "string"
        },
        "reportSuites": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "ReportingAudience": {
      "type": "object",
      "properties": {
        "reportingAudienceLocalId": {
          "type": "integer",
          "format": "int32"
        },
        "audienceId": {
          "type": "integer",
          "format": "int64"
        },
        "metricLocalId": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "Sandbox": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        }
      }
    },
    "Selector": {
      "type": "object",
      "properties": {
        "locationLocalId": {
          "type": "integer",
          "format": "int32"
        },
        "name": {
          "type": "string"
        },
        "selector": {
          "type": "string"
        },
        "audienceIds": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int64"
          }
        }
      }
    },
    "TemplateParameter": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "ViewReference": {
      "type": "object",
      "properties": {
        "viewLocalId": {
          "type": "integer",
          "format": "int32"
        },
        "viewId": {
          "type": "integer",
          "format": "int64"
        },
        "audienceIds": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int64"
          }
        }
      }
    },
    "workspace": {
      "maxLength": 250,
      "type": "string",
      "description": "In case of premium customers (customers with multiple workspaces), it's essential to add the workspace id in every request's payload. If one is not stated, the default workspace will be used. The API consumer must have \"approver\" privilege on the workspace used in the request, if not the API will respond with an error indicating the lack of sufficient privileges to perform the operation."
    }
  }
}