{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/outreachgenie-ai/json-schema/outreachgenie-ai-campaign-schema.json",
  "title": "Campaign",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/outreachgenie-ai-openapi.json#/components/schemas/Campaign",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "readOnly": true
    },
    "name": {
      "type": "string",
      "maxLength": 80
    },
    "status": {
      "$ref": "#/$defs/CampaignStatus"
    },
    "flow": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "flow_name": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true
    },
    "flow_test": {
      "allOf": [
        {
          "$ref": "#/$defs/FlowTest"
        }
      ],
      "nullable": true,
      "readOnly": true
    },
    "list_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "writeOnly": true
    },
    "list_count": {
      "type": "integer",
      "readOnly": true,
      "default": 0
    },
    "prospect_count": {
      "type": "integer",
      "readOnly": true,
      "default": 0
    },
    "selected_list_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "readOnly": true
    },
    "linkedin_account_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "writeOnly": true
    },
    "senders": {
      "type": "object",
      "additionalProperties": {},
      "readOnly": true
    },
    "runtime": {
      "allOf": [
        {
          "$ref": "#/$defs/CampaignRuntimeSnapshot"
        }
      ],
      "nullable": true,
      "readOnly": true
    },
    "overview": {
      "allOf": [
        {
          "$ref": "#/$defs/CampaignOverview"
        }
      ],
      "readOnly": true
    },
    "analytics": {
      "allOf": [
        {
          "$ref": "#/$defs/CampaignAnalytics"
        }
      ],
      "nullable": true,
      "readOnly": true
    },
    "analytics_campaign_launch": {
      "type": "boolean",
      "readOnly": true,
      "default": false,
      "description": "True only when this successful request created a new campaign runtime."
    },
    "schedule_mode": {
      "allOf": [
        {
          "$ref": "#/$defs/ScheduleModeEnum"
        }
      ],
      "default": "immediate"
    },
    "schedule_time": {
      "type": [
        "string",
        "null"
      ],
      "format": "time"
    },
    "schedule_end_time": {
      "type": [
        "string",
        "null"
      ],
      "format": "time"
    },
    "schedule_timezone": {
      "type": "string",
      "default": "UTC"
    },
    "schedule_days": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ScheduleDaysEnum"
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    }
  },
  "required": [
    "analytics",
    "analytics_campaign_launch",
    "created_at",
    "flow_name",
    "flow_test",
    "id",
    "list_count",
    "name",
    "overview",
    "prospect_count",
    "runtime",
    "selected_list_ids",
    "senders",
    "updated_at"
  ],
  "$defs": {
    "BucketSizeEnum": {
      "enum": [
        "hour",
        "day"
      ],
      "type": "string",
      "description": "* `hour` - hour\n* `day` - day"
    },
    "CampaignAnalytics": {
      "type": "object",
      "properties": {
        "bucket_size": {
          "$ref": "#/$defs/BucketSizeEnum"
        },
        "timeline": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CampaignAnalyticsTimelinePoint"
          }
        },
        "action_breakdown": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CampaignAnalyticsActionBreakdownItem"
          }
        }
      },
      "required": [
        "action_breakdown",
        "bucket_size",
        "timeline"
      ]
    },
    "CampaignAnalyticsActionBreakdownItem": {
      "type": "object",
      "properties": {
        "action_key": {
          "type": "string"
        },
        "total": {
          "type": "integer"
        },
        "completed": {
          "type": "integer"
        },
        "failed": {
          "type": "integer"
        },
        "skipped": {
          "type": "integer"
        },
        "waiting": {
          "type": "integer"
        }
      },
      "required": [
        "action_key",
        "completed",
        "failed",
        "skipped",
        "total",
        "waiting"
      ]
    },
    "CampaignAnalyticsTimelinePoint": {
      "type": "object",
      "properties": {
        "timestamp": {
          "type": "string"
        },
        "completed": {
          "type": "integer"
        },
        "failed": {
          "type": "integer"
        },
        "skipped": {
          "type": "integer"
        },
        "waiting": {
          "type": "integer"
        }
      },
      "required": [
        "completed",
        "failed",
        "skipped",
        "timestamp",
        "waiting"
      ]
    },
    "CampaignOverview": {
      "type": "object",
      "properties": {
        "actions_completed_count": {
          "type": "integer"
        },
        "actions_run_count": {
          "type": "integer"
        },
        "actions_failed_count": {
          "type": "integer"
        },
        "actions_skipped_count": {
          "type": "integer"
        },
        "actions_waiting_count": {
          "type": "integer"
        },
        "actions_remaining_count": {
          "type": "integer"
        },
        "profile_activity_check_enabled": {
          "type": "boolean"
        },
        "profile_activity_checked_count": {
          "type": "integer"
        },
        "profile_activity_active_count": {
          "type": "integer"
        },
        "profile_activity_not_active_count": {
          "type": "integer"
        },
        "connection_requests_sent_count": {
          "type": "integer"
        },
        "connection_requests_accepted_count": {
          "type": "integer"
        },
        "connection_request_acceptance_rate": {
          "type": [
            "integer",
            "null"
          ]
        },
        "replies_count": {
          "type": "integer"
        },
        "reply_tracked_prospect_count": {
          "type": "integer"
        },
        "reply_rate": {
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "required": [
        "actions_completed_count",
        "actions_failed_count",
        "actions_remaining_count",
        "actions_run_count",
        "actions_skipped_count",
        "actions_waiting_count",
        "connection_request_acceptance_rate",
        "connection_requests_accepted_count",
        "connection_requests_sent_count",
        "profile_activity_active_count",
        "profile_activity_check_enabled",
        "profile_activity_checked_count",
        "profile_activity_not_active_count",
        "replies_count",
        "reply_rate",
        "reply_tracked_prospect_count"
      ]
    },
    "CampaignRuntimeSnapshot": {
      "type": "object",
      "properties": {
        "job_id": {
          "type": "string",
          "format": "uuid"
        },
        "job_status": {
          "type": "string"
        },
        "completed_count": {
          "type": "integer"
        },
        "execution_count": {
          "type": "integer"
        },
        "failed_count": {
          "type": "integer"
        },
        "in_progress_count": {
          "type": "integer"
        },
        "pending_count": {
          "type": "integer"
        },
        "queued_count": {
          "type": "integer"
        },
        "running_count": {
          "type": "integer"
        },
        "skipped_count": {
          "type": "integer"
        },
        "waiting_count": {
          "type": "integer"
        },
        "provisioning_status": {
          "$ref": "#/$defs/ProvisioningStatusEnum"
        },
        "provisioning_created_count": {
          "type": "integer"
        },
        "provisioning_total_count": {
          "type": "integer"
        },
        "provisioning_error": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "completed_count",
        "execution_count",
        "failed_count",
        "in_progress_count",
        "job_id",
        "job_status",
        "pending_count",
        "provisioning_created_count",
        "provisioning_error",
        "provisioning_status",
        "provisioning_total_count",
        "queued_count",
        "running_count",
        "skipped_count",
        "waiting_count"
      ]
    },
    "CampaignStatus": {
      "enum": [
        "draft",
        "active",
        "paused",
        "stopped",
        "archived"
      ],
      "type": "string",
      "description": "* `draft` - Draft\n* `active` - Active\n* `paused` - Paused\n* `stopped` - Stopped\n* `archived` - Archived"
    },
    "EndReasonEnum": {
      "enum": [
        "auto_winner",
        "picked",
        "stopped",
        "no_clear_winner"
      ],
      "type": "string",
      "description": "* `auto_winner` - Picked automatically\n* `picked` - Picked by hand\n* `stopped` - Stopped\n* `no_clear_winner` - No clear winner"
    },
    "FlowTest": {
      "type": "object",
      "description": "A test as the campaign pages and the Past tests table list it.",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "readOnly": true
        },
        "status": {
          "allOf": [
            {
              "$ref": "#/$defs/FlowTestStatusEnum"
            }
          ],
          "readOnly": true
        },
        "goal": {
          "allOf": [
            {
              "$ref": "#/$defs/GoalEnum"
            }
          ],
          "readOnly": true
        },
        "winner_rule": {
          "allOf": [
            {
              "$ref": "#/$defs/WinnerRuleEnum"
            }
          ],
          "readOnly": true
        },
        "started_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "readOnly": true
        },
        "ended_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "readOnly": true
        },
        "end_reason": {
          "allOf": [
            {
              "$ref": "#/$defs/EndReasonEnum"
            }
          ],
          "readOnly": true
        },
        "winner": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true
        },
        "winner_undone_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "readOnly": true
        },
        "leader": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true
        },
        "confidence": {
          "type": [
            "integer",
            "null"
          ],
          "readOnly": true
        },
        "evaluated_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "readOnly": true
        },
        "variants": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FlowTestVariant"
          },
          "readOnly": true
        }
      },
      "required": [
        "confidence",
        "end_reason",
        "ended_at",
        "evaluated_at",
        "goal",
        "id",
        "leader",
        "started_at",
        "status",
        "variants",
        "winner",
        "winner_rule",
        "winner_undone_at"
      ]
    },
    "FlowTestStatusEnum": {
      "enum": [
        "draft",
        "running",
        "completed",
        "stopped"
      ],
      "type": "string",
      "description": "* `draft` - Draft\n* `running` - Running\n* `completed` - Completed\n* `stopped` - Stopped"
    },
    "FlowTestVariant": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "readOnly": true
        },
        "label": {
          "type": "string",
          "readOnly": true
        },
        "flow": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "readOnly": true
        },
        "flow_name": {
          "type": "string",
          "readOnly": true
        },
        "share": {
          "type": "integer",
          "readOnly": true
        },
        "is_control": {
          "type": "boolean",
          "readOnly": true
        }
      },
      "required": [
        "flow",
        "flow_name",
        "id",
        "is_control",
        "label",
        "share"
      ]
    },
    "GoalEnum": {
      "enum": [
        "reply_rate",
        "acceptance_rate"
      ],
      "type": "string",
      "description": "* `reply_rate` - Reply rate\n* `acceptance_rate` - Acceptance rate"
    },
    "ProvisioningStatusEnum": {
      "enum": [
        "pending",
        "running",
        "completed",
        "failed"
      ],
      "type": "string",
      "description": "* `pending` - pending\n* `running` - running\n* `completed` - completed\n* `failed` - failed"
    },
    "ScheduleDaysEnum": {
      "enum": [
        "mon",
        "tue",
        "wed",
        "thu",
        "fri",
        "sat",
        "sun"
      ],
      "type": "string",
      "description": "* `mon` - mon\n* `tue` - tue\n* `wed` - wed\n* `thu` - thu\n* `fri` - fri\n* `sat` - sat\n* `sun` - sun"
    },
    "ScheduleModeEnum": {
      "enum": [
        "immediate",
        "scheduled"
      ],
      "type": "string",
      "description": "* `immediate` - Immediate\n* `scheduled` - Scheduled"
    },
    "WinnerRuleEnum": {
      "enum": [
        "auto",
        "manual"
      ],
      "type": "string",
      "description": "* `auto` - Switch automatically\n* `manual` - Tell me"
    }
  }
}