{
  "$id": "https://betterstood.com/developers/v31/schemas/mcp/campaign_review_draft.output.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "anyOf": [
    {
      "additionalProperties": false,
      "properties": {
        "campaignKey": {
          "maxLength": 128,
          "minLength": 1,
          "type": "string"
        },
        "draftReady": {
          "type": "boolean"
        },
        "editorUrl": {
          "maxLength": 2048,
          "type": "string"
        },
        "interviewEstimate": {
          "anyOf": [
            {
              "additionalProperties": false,
              "properties": {
                "capacity": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "properties": {
                        "availableCredits": {
                          "maximum": 9007199254740991,
                          "minimum": 0,
                          "type": "integer"
                        },
                        "interviews": {
                          "items": {
                            "additionalProperties": false,
                            "properties": {
                              "channel": {
                                "enum": [
                                  "web_call",
                                  "phone_call",
                                  "text_chat"
                                ],
                                "type": "string"
                              },
                              "count": {
                                "anyOf": [
                                  {
                                    "maximum": 9007199254740991,
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "channel",
                              "count"
                            ],
                            "type": "object"
                          },
                          "maxItems": 3,
                          "type": "array"
                        }
                      },
                      "required": [
                        "availableCredits",
                        "interviews"
                      ],
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "channels": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "channel": {
                        "enum": [
                          "web_call",
                          "phone_call",
                          "text_chat"
                        ],
                        "type": "string"
                      },
                      "heldCredits": {
                        "maximum": 9007199254740991,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "highCredits": {
                        "maximum": 9007199254740991,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "typicalCredits": {
                        "maximum": 9007199254740991,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "withinLimit": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "channel",
                      "typicalCredits",
                      "highCredits",
                      "heldCredits",
                      "withinLimit"
                    ],
                    "type": "object"
                  },
                  "maxItems": 3,
                  "type": "array"
                },
                "duration": {
                  "enum": [
                    "ok",
                    "long",
                    "near_voice_limit",
                    "over_voice_limit"
                  ],
                  "type": "string"
                },
                "minutes": {
                  "additionalProperties": false,
                  "properties": {
                    "high": {
                      "exclusiveMinimum": 0,
                      "maximum": 1440,
                      "type": "integer"
                    },
                    "low": {
                      "exclusiveMinimum": 0,
                      "maximum": 1440,
                      "type": "integer"
                    },
                    "typical": {
                      "exclusiveMinimum": 0,
                      "maximum": 1440,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "low",
                    "typical",
                    "high"
                  ],
                  "type": "object"
                },
                "questions": {
                  "additionalProperties": false,
                  "properties": {
                    "conversation": {
                      "maximum": 500,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "formFirst": {
                      "maximum": 500,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "optional": {
                      "maximum": 500,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "required": {
                      "maximum": 500,
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "conversation",
                    "required",
                    "optional",
                    "formFirst"
                  ],
                  "type": "object"
                },
                "version": {
                  "const": "interview-estimate.v1",
                  "type": "string"
                },
                "voiceLimitMinutes": {
                  "exclusiveMinimum": 0,
                  "maximum": 1440,
                  "type": "integer"
                }
              },
              "required": [
                "version",
                "questions",
                "minutes",
                "voiceLimitMinutes",
                "duration",
                "channels",
                "capacity"
              ],
              "type": "object"
            },
            {
              "type": "null"
            }
          ]
        },
        "issues": {
          "items": {
            "additionalProperties": false,
            "properties": {
              "code": {
                "enum": [
                  "CAMPAIGN_NOT_DRAFT",
                  "INTAKE_TITLE_REQUIRED",
                  "INTAKE_HEADLINE_REQUIRED",
                  "INTAKE_CTA_REQUIRED",
                  "PUBLISH_PROVIDER_NOT_PUBLISHED",
                  "PUBLISH_PROVIDER_STALE",
                  "PUBLISH_PROVIDER_ERROR",
                  "PUBLISH_CHANNEL_PROMPT_NOT_READY",
                  "PUBLISH_CONVERSATION_TOO_LONG",
                  "PUBLISH_TEXT_CHAT_BUDGET_NOT_READY",
                  "PUBLISH_KNOWLEDGE_BASE_NOT_READY",
                  "PUBLISH_KNOWLEDGE_BASE_TIER_UNAVAILABLE",
                  "PUBLISH_CALLER_NUMBER_REQUIRED",
                  "PUBLISH_CALLER_NUMBER_UNAVAILABLE",
                  "PUBLISH_CALLER_NUMBER_TIER_UNAVAILABLE",
                  "PUBLISH_VOICE_TIER_UNAVAILABLE",
                  "PUBLISH_QUICK_ANSWERS_NOT_READY",
                  "ACCESS_CONFIGURATION_REQUIRED"
                ],
                "type": "string"
              },
              "message": {
                "maxLength": 1024,
                "type": "string"
              },
              "path": {
                "maxLength": 512,
                "type": "string"
              }
            },
            "required": [
              "path",
              "code",
              "message"
            ],
            "type": "object"
          },
          "maxItems": 20,
          "type": "array"
        },
        "operatorActions": {
          "items": {
            "enum": [
              "open_campaign_editor",
              "configure_access",
              "prepare_scenario",
              "assign_caller_number",
              "review_quick_answers",
              "publish_campaign"
            ],
            "type": "string"
          },
          "maxItems": 10,
          "type": "array"
        },
        "publishReadiness": {
          "additionalProperties": false,
          "properties": {
            "code": {
              "anyOf": [
                {
                  "enum": [
                    "CAMPAIGN_NOT_DRAFT",
                    "INTAKE_TITLE_REQUIRED",
                    "INTAKE_HEADLINE_REQUIRED",
                    "INTAKE_CTA_REQUIRED",
                    "PUBLISH_PROVIDER_NOT_PUBLISHED",
                    "PUBLISH_PROVIDER_STALE",
                    "PUBLISH_PROVIDER_ERROR",
                    "PUBLISH_CHANNEL_PROMPT_NOT_READY",
                    "PUBLISH_CONVERSATION_TOO_LONG",
                    "PUBLISH_TEXT_CHAT_BUDGET_NOT_READY",
                    "PUBLISH_KNOWLEDGE_BASE_NOT_READY",
                    "PUBLISH_KNOWLEDGE_BASE_TIER_UNAVAILABLE",
                    "PUBLISH_CALLER_NUMBER_REQUIRED",
                    "PUBLISH_CALLER_NUMBER_UNAVAILABLE",
                    "PUBLISH_CALLER_NUMBER_TIER_UNAVAILABLE",
                    "PUBLISH_VOICE_TIER_UNAVAILABLE",
                    "PUBLISH_QUICK_ANSWERS_NOT_READY",
                    "ACCESS_CONFIGURATION_REQUIRED"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "ready": {
              "type": "boolean"
            },
            "supportCode": {
              "const": "BS-SCENARIO-001",
              "type": "string"
            }
          },
          "required": [
            "ready",
            "code"
          ],
          "type": "object"
        },
        "revision": {
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991,
          "type": "integer"
        },
        "warnings": {
          "items": {
            "additionalProperties": false,
            "properties": {
              "code": {
                "enum": [
                  "CAMPAIGN_NOT_DRAFT",
                  "INTAKE_TITLE_REQUIRED",
                  "INTAKE_HEADLINE_REQUIRED",
                  "INTAKE_CTA_REQUIRED",
                  "PUBLISH_PROVIDER_NOT_PUBLISHED",
                  "PUBLISH_PROVIDER_STALE",
                  "PUBLISH_PROVIDER_ERROR",
                  "PUBLISH_CHANNEL_PROMPT_NOT_READY",
                  "PUBLISH_CONVERSATION_TOO_LONG",
                  "PUBLISH_TEXT_CHAT_BUDGET_NOT_READY",
                  "PUBLISH_KNOWLEDGE_BASE_NOT_READY",
                  "PUBLISH_KNOWLEDGE_BASE_TIER_UNAVAILABLE",
                  "PUBLISH_CALLER_NUMBER_REQUIRED",
                  "PUBLISH_CALLER_NUMBER_UNAVAILABLE",
                  "PUBLISH_CALLER_NUMBER_TIER_UNAVAILABLE",
                  "PUBLISH_VOICE_TIER_UNAVAILABLE",
                  "PUBLISH_QUICK_ANSWERS_NOT_READY",
                  "ACCESS_CONFIGURATION_REQUIRED"
                ],
                "type": "string"
              },
              "message": {
                "maxLength": 1024,
                "type": "string"
              },
              "path": {
                "maxLength": 512,
                "type": "string"
              }
            },
            "required": [
              "path",
              "code",
              "message"
            ],
            "type": "object"
          },
          "maxItems": 20,
          "type": "array"
        }
      },
      "required": [
        "campaignKey",
        "revision",
        "draftReady",
        "publishReadiness",
        "issues",
        "warnings",
        "operatorActions",
        "editorUrl",
        "interviewEstimate"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "code": {
          "enum": [
            "NOT_FOUND",
            "REVISION_CONFLICT",
            "RESOURCE_LOCKED",
            "SCENARIO_LOCKED",
            "CAMPAIGN_LOCKED",
            "VALIDATION_FAILED",
            "QUOTA_EXCEEDED",
            "TOOL_NOT_AVAILABLE",
            "IDEMPOTENCY_KEY_REUSED",
            "REMOVAL_ACKNOWLEDGEMENT_REQUIRED",
            "UNAUTHORIZED",
            "FORBIDDEN",
            "RATE_LIMITED",
            "SERVICE_UNAVAILABLE"
          ],
          "type": "string"
        },
        "currentRevision": {
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991,
          "type": "integer"
        },
        "docsUrl": {
          "maxLength": 2048,
          "type": "string"
        },
        "editorUrl": {
          "maxLength": 2048,
          "type": "string"
        },
        "expectedRevision": {
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991,
          "type": "integer"
        },
        "field": {
          "maxLength": 256,
          "type": "string"
        },
        "issues": {
          "items": {
            "additionalProperties": false,
            "properties": {
              "code": {
                "maxLength": 128,
                "type": "string"
              },
              "message": {
                "maxLength": 1024,
                "type": "string"
              },
              "path": {
                "maxLength": 512,
                "type": "string"
              }
            },
            "required": [
              "path",
              "code",
              "message"
            ],
            "type": "object"
          },
          "maxItems": 100,
          "type": "array"
        },
        "message": {
          "maxLength": 1024,
          "minLength": 1,
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "studioUrl": {
          "maxLength": 2048,
          "type": "string"
        }
      },
      "required": [
        "code",
        "message",
        "retryable"
      ],
      "type": "object"
    }
  ],
  "title": "campaign_review_draft output",
  "type": "object"
}
