{
  "openapi": "3.1.0",
  "info": {
    "title": "Telehealth Ad Compliance and Creative Tools by Telehealth Media",
    "version": "1.0.0",
    "description": "Free telehealth ad compliance, writing and calculator tools. General information, not legal advice. Privacy: https://telehealthmedia.com/privacy"
  },
  "servers": [
    {
      "url": "https://telehealthmedia.com"
    }
  ],
  "paths": {
    "/api/tools/run/check_ad_compliance": {
      "post": {
        "operationId": "check_ad_compliance",
        "summary": "Check ad copy for health ad review risk",
        "description": "Ad compliance checker for telehealth ad copy: flags phrases likely to draw a closer review under Meta, Google and FTC health rules, with rule ids, sources and a risk level. Heuristics, not legal advice. Tool page: https://telehealthmedia.com/tools/ad-compliance-checker",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 8000,
                    "description": "Ad copy to check"
                  },
                  "vertical": {
                    "default": "general",
                    "description": "Telehealth vertical",
                    "type": "string",
                    "enum": [
                      "general",
                      "glp1",
                      "trt",
                      "ed",
                      "hair-loss",
                      "hrt",
                      "birth-control",
                      "skin",
                      "peptides",
                      "mental-health",
                      "medication-delivery"
                    ]
                  },
                  "platform": {
                    "default": "meta",
                    "description": "Platform",
                    "type": "string",
                    "enum": [
                      "meta",
                      "google",
                      "tiktok"
                    ]
                  }
                },
                "required": [
                  "text"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/list_compliance_rules": {
      "post": {
        "operationId": "list_compliance_rules",
        "summary": "List health ad rules",
        "description": "Lists the Meta, Google, FTC and FDA rules the compliance checker uses, optionally for one telehealth vertical, with summaries, short quotes, sources and checked dates. Tool page: https://telehealthmedia.com/data/telehealth-ad-compliance-statistics",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "vertical": {
                    "default": "general",
                    "description": "Telehealth vertical",
                    "type": "string",
                    "enum": [
                      "general",
                      "glp1",
                      "trt",
                      "ed",
                      "hair-loss",
                      "hrt",
                      "birth-control",
                      "skin",
                      "peptides",
                      "mental-health",
                      "medication-delivery"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/explain_rule": {
      "post": {
        "operationId": "explain_rule",
        "summary": "Explain one health ad rule",
        "description": "Explains one compliance rule by id (for example META_PERSONAL_ATTRIBUTES): what it covers, the verticals it applies to, a short policy quote and the source. Tool page: https://telehealthmedia.com/meta-health-ad-policy",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "rule_id": {
                    "type": "string",
                    "description": "Rule id from list_compliance_rules"
                  }
                },
                "required": [
                  "rule_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_roas": {
      "post": {
        "operationId": "calculate_roas",
        "summary": "ROAS",
        "description": "Return on ad spend from spend and revenue. Tool page: https://telehealthmedia.com/tools/roas-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "spend": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Ad spend"
                  },
                  "revenue": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Revenue"
                  }
                },
                "required": [
                  "spend",
                  "revenue"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_breakeven_roas": {
      "post": {
        "operationId": "calculate_breakeven_roas",
        "summary": "Break-even ROAS and CPA",
        "description": "Break-even ROAS and CPA with the telehealth cost stack (consult, pharmacy, shipping, payment fees, refunds). Tool page: https://telehealthmedia.com/tools/break-even-roas-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "aov": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Revenue per first order"
                  },
                  "cogs_per_order": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Product cost"
                  },
                  "consult_fee": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Consult fee paid per order"
                  },
                  "pharmacy_fee": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Pharmacy fee"
                  },
                  "shipping": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Shipping"
                  },
                  "payment_pct": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Payment fees, percent"
                  },
                  "refund_pct": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Refunds, percent"
                  },
                  "target_margin_pct": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Target margin, percent"
                  }
                },
                "required": [
                  "aov",
                  "cogs_per_order",
                  "consult_fee",
                  "pharmacy_fee",
                  "shipping",
                  "payment_pct",
                  "refund_pct"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_cac": {
      "post": {
        "operationId": "calculate_cac",
        "summary": "Patient acquisition cost",
        "description": "Customer (patient) acquisition cost. Tool page: https://telehealthmedia.com/tools/cac-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "spend": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Ad spend"
                  },
                  "other_costs": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Other acquisition costs"
                  },
                  "new_patients": {
                    "type": "number",
                    "minimum": 0,
                    "description": "New patients"
                  }
                },
                "required": [
                  "spend",
                  "other_costs",
                  "new_patients"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_ltv": {
      "post": {
        "operationId": "calculate_ltv",
        "summary": "Subscription LTV",
        "description": "Lifetime gross profit of a subscription patient. Tool page: https://telehealthmedia.com/tools/customer-lifetime-value-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "monthly_price": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Monthly price"
                  },
                  "gross_margin_pct": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Gross margin, percent"
                  },
                  "monthly_churn_pct": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Monthly churn, percent"
                  }
                },
                "required": [
                  "monthly_price",
                  "gross_margin_pct",
                  "monthly_churn_pct"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_ltv_cac": {
      "post": {
        "operationId": "calculate_ltv_cac",
        "summary": "LTV to CAC ratio",
        "description": "LTV to CAC ratio and payback months. Tool page: https://telehealthmedia.com/tools/ltv-cac-ratio-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ltv_gp": {
                    "type": "number",
                    "minimum": 0,
                    "description": "LTV (gross profit)"
                  },
                  "cac": {
                    "type": "number",
                    "minimum": 0,
                    "description": "CAC"
                  },
                  "monthly_gp": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Monthly gross profit per patient"
                  }
                },
                "required": [
                  "ltv_gp",
                  "cac",
                  "monthly_gp"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_cac_payback": {
      "post": {
        "operationId": "calculate_cac_payback",
        "summary": "CAC payback",
        "description": "Months to earn back CAC from gross profit. Tool page: https://telehealthmedia.com/tools/cac-payback-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "cac": {
                    "type": "number",
                    "minimum": 0,
                    "description": "CAC"
                  },
                  "monthly_price": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Monthly price"
                  },
                  "gross_margin_pct": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Gross margin, percent"
                  },
                  "monthly_churn_pct": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Monthly churn, percent"
                  }
                },
                "required": [
                  "cac",
                  "monthly_price",
                  "gross_margin_pct"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_cpm": {
      "post": {
        "operationId": "calculate_cpm",
        "summary": "CPM",
        "description": "Cost per thousand impressions. Tool page: https://telehealthmedia.com/tools/cpm-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "spend": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Spend"
                  },
                  "impressions": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Impressions"
                  }
                },
                "required": [
                  "spend",
                  "impressions"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_ctr": {
      "post": {
        "operationId": "calculate_ctr",
        "summary": "CTR",
        "description": "Click-through rate. Tool page: https://telehealthmedia.com/tools/ctr-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "clicks": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Clicks"
                  },
                  "impressions": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Impressions"
                  }
                },
                "required": [
                  "clicks",
                  "impressions"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_cpc": {
      "post": {
        "operationId": "calculate_cpc",
        "summary": "CPC",
        "description": "Cost per click. Tool page: https://telehealthmedia.com/tools/cpc-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "spend": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Spend"
                  },
                  "clicks": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Clicks"
                  }
                },
                "required": [
                  "spend",
                  "clicks"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_cpa": {
      "post": {
        "operationId": "calculate_cpa",
        "summary": "CPA",
        "description": "Cost per acquisition. Tool page: https://telehealthmedia.com/tools/cpa-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "spend": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Spend"
                  },
                  "conversions": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Conversions"
                  }
                },
                "required": [
                  "spend",
                  "conversions"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_hook_rate": {
      "post": {
        "operationId": "calculate_hook_rate",
        "summary": "Hook and hold rate",
        "description": "Hook rate, hold rate and related video metrics. Tool page: https://telehealthmedia.com/tools/hook-rate-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "impressions": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Impressions"
                  },
                  "plays_3s": {
                    "type": "number",
                    "minimum": 0,
                    "description": "3-second plays"
                  },
                  "thruplays": {
                    "type": "number",
                    "minimum": 0,
                    "description": "ThruPlays"
                  },
                  "avg_watch_s": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Average watch time, seconds"
                  },
                  "video_len_s": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Video length, seconds"
                  },
                  "clicks": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Clicks"
                  }
                },
                "required": [
                  "impressions",
                  "plays_3s",
                  "thruplays",
                  "avg_watch_s",
                  "video_len_s",
                  "clicks"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_creative_volume": {
      "post": {
        "operationId": "calculate_creative_volume",
        "summary": "Creative volume",
        "description": "How many new ads a month a budget needs. Tool page: https://telehealthmedia.com/tools/creative-volume-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "monthly_spend": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Monthly spend"
                  },
                  "spend_per_winner_week": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Spend one winning ad can take per week"
                  },
                  "weeks_ad_lasts": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Weeks an ad lasts"
                  },
                  "hit_rate_pct": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Hit rate, percent"
                  }
                },
                "required": [
                  "monthly_spend",
                  "spend_per_winner_week",
                  "weeks_ad_lasts",
                  "hit_rate_pct"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_testing_budget": {
      "post": {
        "operationId": "calculate_testing_budget",
        "summary": "Creative testing budget",
        "description": "Budget to test a set of ads. Tool page: https://telehealthmedia.com/tools/creative-testing-budget-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "num_ads": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Ads in the test"
                  },
                  "target_cpa": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Target CPA"
                  },
                  "cpa_multiple_per_ad": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Spend per ad as a multiple of target CPA"
                  }
                },
                "required": [
                  "num_ads",
                  "target_cpa",
                  "cpa_multiple_per_ad"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_learning_phase_budget": {
      "post": {
        "operationId": "calculate_learning_phase_budget",
        "summary": "Learning phase budget",
        "description": "Daily budget to exit Meta learning (about 50 results a week). Tool page: https://telehealthmedia.com/tools/learning-phase-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "target_cpa": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Target CPA"
                  },
                  "conversions_needed": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Conversions needed"
                  },
                  "days": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Days"
                  }
                },
                "required": [
                  "target_cpa"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_funnel": {
      "post": {
        "operationId": "calculate_funnel",
        "summary": "Telehealth funnel",
        "description": "Step-by-step conversion rates through a telehealth funnel. Tool page: https://telehealthmedia.com/tools/telehealth-funnel-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "visitors": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Visitors"
                  },
                  "intake_starts": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Intake starts"
                  },
                  "intake_completes": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Intake completes"
                  },
                  "approvals": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Approvals"
                  },
                  "first_fills": {
                    "type": "number",
                    "minimum": 0,
                    "description": "First fills"
                  },
                  "refill_2": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Second refills"
                  }
                },
                "required": [
                  "visitors",
                  "intake_starts",
                  "intake_completes",
                  "approvals",
                  "first_fills",
                  "refill_2"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_mer": {
      "post": {
        "operationId": "calculate_mer",
        "summary": "MER",
        "description": "Marketing efficiency ratio (blended ROAS). Tool page: https://telehealthmedia.com/tools/marketing-efficiency-ratio-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "total_revenue": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Total revenue"
                  },
                  "total_ad_spend": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Total ad spend"
                  }
                },
                "required": [
                  "total_revenue",
                  "total_ad_spend"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_poas": {
      "post": {
        "operationId": "calculate_poas",
        "summary": "POAS",
        "description": "Profit on ad spend. Tool page: https://telehealthmedia.com/tools/poas-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "spend": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Spend"
                  },
                  "revenue": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Revenue"
                  },
                  "variable_costs": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Variable costs"
                  }
                },
                "required": [
                  "spend",
                  "revenue",
                  "variable_costs"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_contribution_margin": {
      "post": {
        "operationId": "calculate_contribution_margin",
        "summary": "Contribution margin",
        "description": "Contribution margin per unit and in total. Tool page: https://telehealthmedia.com/tools/contribution-margin-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "price": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Price"
                  },
                  "variable_cost_per_unit": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Variable cost per unit"
                  },
                  "units": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Units"
                  }
                },
                "required": [
                  "price",
                  "variable_cost_per_unit",
                  "units"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_ab_test": {
      "post": {
        "operationId": "calculate_ab_test",
        "summary": "A/B test significance",
        "description": "Two-proportion z-test for an A/B test. Tool page: https://telehealthmedia.com/tools/ab-test-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "n_a": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Visitors A"
                  },
                  "conv_a": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Conversions A"
                  },
                  "n_b": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Visitors B"
                  },
                  "conv_b": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Conversions B"
                  }
                },
                "required": [
                  "n_a",
                  "conv_a",
                  "n_b",
                  "conv_b"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_sample_size": {
      "post": {
        "operationId": "calculate_sample_size",
        "summary": "Sample size",
        "description": "Visitors per version for an A/B test. Tool page: https://telehealthmedia.com/tools/sample-size-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "baseline_pct": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Baseline conversion rate, percent"
                  },
                  "mde_rel_pct": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Minimum detectable effect, relative percent"
                  },
                  "alpha": {
                    "type": "number",
                    "description": "Significance level"
                  },
                  "power": {
                    "type": "number",
                    "description": "Power"
                  }
                },
                "required": [
                  "baseline_pct",
                  "mde_rel_pct"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_lift": {
      "post": {
        "operationId": "calculate_lift",
        "summary": "Lift",
        "description": "Lift, incremental conversions and cost per incremental conversion. Tool page: https://telehealthmedia.com/tools/lift-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "test_users": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Test group size"
                  },
                  "test_conversions": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Test conversions"
                  },
                  "control_users": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Holdout size"
                  },
                  "control_conversions": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Holdout conversions"
                  },
                  "spend": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Spend"
                  }
                },
                "required": [
                  "test_users",
                  "test_conversions",
                  "control_users",
                  "control_conversions",
                  "spend"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_churn": {
      "post": {
        "operationId": "calculate_churn",
        "summary": "Churn rate",
        "description": "Churn rate for a period. Tool page: https://telehealthmedia.com/tools/churn-rate-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "customers_start": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Patients at start"
                  },
                  "customers_lost": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Patients lost"
                  }
                },
                "required": [
                  "customers_start",
                  "customers_lost"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_retention_cohort": {
      "post": {
        "operationId": "calculate_retention_cohort",
        "summary": "Retention cohort",
        "description": "Patients left each month for a cohort. Tool page: https://telehealthmedia.com/tools/retention-cohort-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "start_patients": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Starting patients"
                  },
                  "m1_churn_pct": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Month 1 churn, percent"
                  },
                  "later_churn_pct": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Later monthly churn, percent"
                  },
                  "months": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Months"
                  }
                },
                "required": [
                  "start_patients",
                  "m1_churn_pct",
                  "later_churn_pct"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/forecast_meta_ads": {
      "post": {
        "operationId": "forecast_meta_ads",
        "summary": "Ad spend forecast",
        "description": "Monthly impressions, clicks, conversions, revenue, ROAS and CPA from a daily budget. Tool page: https://telehealthmedia.com/tools/meta-ads-forecast",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "daily_budget": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Daily budget"
                  },
                  "cpm_": {
                    "type": "number",
                    "minimum": 0,
                    "description": "CPM"
                  },
                  "ctr_pct": {
                    "type": "number",
                    "minimum": 0,
                    "description": "CTR, percent"
                  },
                  "cvr_pct": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Conversion rate, percent"
                  },
                  "aov": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Revenue per conversion"
                  }
                },
                "required": [
                  "daily_budget",
                  "cpm_",
                  "ctr_pct",
                  "cvr_pct",
                  "aov"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_ugc_rate": {
      "post": {
        "operationId": "calculate_ugc_rate",
        "summary": "UGC rate",
        "description": "Total UGC creator fee with usage, hooks, raw footage and whitelisting. Tool page: https://telehealthmedia.com/tools/ugc-rate-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "base_video": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Base fee per video"
                  },
                  "usage_months": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Usage months"
                  },
                  "paid_usage_pct_per_month": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Paid usage, percent of base per month"
                  },
                  "raw_footage_fee": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Raw footage fee"
                  },
                  "hooks_extra": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Extra hooks"
                  },
                  "per_hook_fee": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Fee per extra hook"
                  },
                  "whitelisting_fee": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Whitelisting fee"
                  }
                },
                "required": [
                  "base_video",
                  "usage_months",
                  "paid_usage_pct_per_month",
                  "raw_footage_fee",
                  "hooks_extra",
                  "per_hook_fee",
                  "whitelisting_fee"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/calculate_legitscript_cost": {
      "post": {
        "operationId": "calculate_legitscript_cost",
        "summary": "LegitScript cost",
        "description": "LegitScript application, annual and expedited fees (USD) from LegitScript's published prices. Tool page: https://telehealthmedia.com/tools/legitscript-cost-calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "domains": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Websites"
                  },
                  "years": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Years"
                  },
                  "expedited": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "required": [
                  "domains",
                  "years"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/get_ad_specs": {
      "post": {
        "operationId": "get_ad_specs",
        "summary": "Get ad specs",
        "description": "Ad specs for Meta, TikTok and Google placements: ratio, size, length, file size and text limits, each with its official source. Tool page: https://telehealthmedia.com/tools/ad-specs",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "Meta",
                      "TikTok",
                      "Google"
                    ]
                  },
                  "placement": {
                    "description": "Part of the placement name, for example \"reels\"",
                    "type": "string",
                    "maxLength": 80
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/build_utm": {
      "post": {
        "operationId": "build_utm",
        "summary": "Build a UTM URL",
        "description": "Adds UTM parameters to a landing page URL, keeping its existing query. Meta macros such as {{ad.name}} are left unescaped. Tool page: https://telehealthmedia.com/tools/utm-builder",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "source": {
                    "default": "facebook",
                    "type": "string"
                  },
                  "medium": {
                    "default": "paid_social",
                    "type": "string"
                  },
                  "campaign": {
                    "default": "{{campaign.name}}",
                    "type": "string"
                  },
                  "content": {
                    "default": "{{ad.name}}",
                    "type": "string"
                  },
                  "term": {
                    "default": "{{adset.name}}",
                    "type": "string"
                  }
                },
                "required": [
                  "url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/build_ad_name": {
      "post": {
        "operationId": "build_ad_name",
        "summary": "Build an ad name",
        "description": "Builds an ad name in the pattern date_VERTICAL_angle_TYPE_format_HOOK_creator_vN, for reporting by angle, format and creator. Tool page: https://telehealthmedia.com/tools/ad-naming-convention",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "vertical": {
                    "type": "string"
                  },
                  "angle": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "vid",
                      "sta",
                      "car"
                    ]
                  },
                  "format": {
                    "type": "string"
                  },
                  "hook": {
                    "type": "string"
                  },
                  "creator": {
                    "default": "none",
                    "type": "string"
                  },
                  "version": {
                    "default": "1",
                    "type": "string"
                  }
                },
                "required": [
                  "date",
                  "vertical",
                  "angle",
                  "type",
                  "format",
                  "hook"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/run/get_meta_health_ad_policy": {
      "post": {
        "operationId": "get_meta_health_ad_policy",
        "summary": "Get the Meta health ad policy summary",
        "description": "The Meta ad rules that matter for telehealth, in plain English, with short quotes, sources, checked dates and the recent changelog. Tool page: https://telehealthmedia.com/meta-health-ad-policy",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result, plus a source line linking the tool page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {},
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}