{
  "openapi": "3.1.0",
  "info": {
    "title": "Cresva AI Marketing Tools API",
    "description": "15 AI-powered marketing tools for ecommerce brands. Free to use with rate limits (3/day anonymous, 10/day signed in, unlimited Pro). Each tool is powered by a specialized AI agent.\n\nThis is NOT the assistant connector API. The tools an AI assistant calls through the Cresva connector are a separate document, describing separate endpoints with their own limits: https://cresva.ai/openapi-connector.json",
    "version": "1.0.0",
    "contact": {
      "name": "Cresva Support",
      "email": "hello@cresva.ai",
      "url": "https://cresva.ai/help"
    },
    "termsOfService": "https://cresva.ai/terms"
  },
  "servers": [
    {
      "url": "https://cresva.ai/api/public",
      "description": "Production: Public Tools tools (no auth required)"
    },
    {
      "url": "https://cresva.ai/api/mcp",
      "description": "MCP Platform API (Bearer auth required)"
    }
  ],
  "paths": {
    "/ai-readiness": {
      "post": {
        "operationId": "aiReadiness",
        "summary": "AI Readiness Scanner",
        "description": "Scans a website for structured data, llms.txt, schema markup, and meta tags. Scores readiness for AI agent discovery. Powered by agent Iris.",
        "tags": [
          "Business & Reporting"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Website URL to scan"
                  },
                  "industry": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "AI readiness score with schema analysis and recommendations"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/tracking-audit": {
      "post": {
        "operationId": "trackingAudit",
        "summary": "Pixel & UTM Auditor",
        "description": "Scans a website for tracking pixels (Meta, Google, TikTok, etc.), GTM setup, consent tools, and UTM parameters. Finds broken tracking and conversion gaps. Powered by agent Dana.",
        "tags": [
          "Ad Performance"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "websiteUrl"
                ],
                "properties": {
                  "websiteUrl": {
                    "type": "string",
                    "description": "URL to scan"
                  },
                  "platforms": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "meta",
                        "google",
                        "tiktok",
                        "snapchat",
                        "pinterest",
                        "twitter",
                        "linkedin"
                      ]
                    },
                    "description": "Platforms to check for pixels"
                  },
                  "industry": {
                    "type": "string",
                    "enum": [
                      "ecommerce",
                      "saas",
                      "fashion",
                      "beauty",
                      "food",
                      "health",
                      "finance",
                      "lead_gen"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tracking audit results with detected pixels, issues, and recommendations"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/product-feed-optimizer": {
      "post": {
        "operationId": "productFeedOptimizer",
        "summary": "Product Feed Optimizer",
        "description": "Analyzes product feed CSV for errors, scores titles, and generates AI-fixed replacements. Powered by agent Iris.",
        "tags": [
          "Ad Performance"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "csvData"
                ],
                "properties": {
                  "csvData": {
                    "type": "string",
                    "description": "CSV content (max 10MB)"
                  },
                  "industry": {
                    "type": "string"
                  },
                  "feedFormat": {
                    "type": "string",
                    "enum": [
                      "google_shopping",
                      "meta_catalog",
                      "generic",
                      "auto"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Feed health score, per-product issues, AI-fixed titles, and downloadable CSV"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/promo-profitability": {
      "post": {
        "operationId": "promoProfitability",
        "summary": "Promo Profitability Analyzer",
        "description": "Shows true P&L of discounts including margin hit, pull-forward, and cannibalization. Powered by agent Max.",
        "tags": [
          "Business & Reporting"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "discountValue",
                  "expectedOrders",
                  "promoDurationDays",
                  "avgOrderValue",
                  "avgMarginPercent"
                ],
                "properties": {
                  "promoName": {
                    "type": "string"
                  },
                  "promoType": {
                    "type": "string",
                    "enum": [
                      "percent_off",
                      "dollar_off",
                      "bogo",
                      "free_shipping",
                      "gift_with_purchase",
                      "bundle",
                      "flash_sale",
                      "clearance"
                    ]
                  },
                  "discountValue": {
                    "type": "number"
                  },
                  "expectedOrders": {
                    "type": "integer"
                  },
                  "promoDurationDays": {
                    "type": "integer"
                  },
                  "avgOrderValue": {
                    "type": "number"
                  },
                  "avgMarginPercent": {
                    "type": "number"
                  },
                  "normalOrdersPerDay": {
                    "type": "number"
                  },
                  "industry": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Profitability rating, margin waterfall, pull-forward analysis"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/sku-profitability": {
      "post": {
        "operationId": "skuProfitability",
        "summary": "SKU Profitability",
        "description": "Exposes which products lose money, even with good ROAS. Quick mode (single product) or full mode (portfolio). Powered by agent Max.",
        "tags": [
          "Business & Reporting"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "mode"
                ],
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "quick",
                      "full"
                    ]
                  },
                  "inputs": {
                    "type": "object",
                    "description": "Quick mode: single product cost breakdown",
                    "properties": {
                      "aov": {
                        "type": "number"
                      },
                      "cogs": {
                        "type": "number"
                      },
                      "shipping": {
                        "type": "number"
                      },
                      "packaging": {
                        "type": "number"
                      },
                      "paymentFeePercent": {
                        "type": "number"
                      },
                      "paymentFeeFlat": {
                        "type": "number"
                      },
                      "returnRate": {
                        "type": "number"
                      },
                      "fulfillmentFee": {
                        "type": "number"
                      },
                      "platformFeePercent": {
                        "type": "number"
                      }
                    }
                  },
                  "skus": {
                    "type": "array",
                    "description": "Full mode: product portfolio",
                    "items": {
                      "type": "object",
                      "required": [
                        "sku",
                        "name",
                        "cogs",
                        "currentPrice",
                        "unitsSold"
                      ],
                      "properties": {
                        "sku": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "cogs": {
                          "type": "number"
                        },
                        "currentPrice": {
                          "type": "number"
                        },
                        "unitsSold": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Contribution margin, cost breakdown, tier classification, and recommendations"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/revenue-forecast": {
      "post": {
        "operationId": "revenueForecast",
        "summary": "Revenue Forecast",
        "description": "Predicts next 90 days with confidence bands using Holt-Winters statistical model. Powered by agent Felix.",
        "tags": [
          "Business & Reporting"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "monthlyRevenue"
                ],
                "properties": {
                  "monthlyRevenue": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "minItems": 1,
                    "maxItems": 24
                  },
                  "industry": {
                    "type": "string",
                    "enum": [
                      "ecommerce",
                      "saas",
                      "retail",
                      "services",
                      "marketplace",
                      "other"
                    ]
                  },
                  "seasonality": {
                    "type": "string",
                    "enum": [
                      "none",
                      "q4_heavy",
                      "summer",
                      "spring",
                      "monthly"
                    ]
                  },
                  "growthRate": {
                    "type": "number",
                    "minimum": -50,
                    "maximum": 500
                  },
                  "growthTarget": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "90-day forecast with weekly timeline, confidence intervals, and narrative insights"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/ai-visibility": {
      "post": {
        "operationId": "aiVisibility",
        "summary": "AI Visibility Tracker",
        "description": "Checks if ChatGPT, Perplexity, Claude, and Gemini recommend your brand or competitors. Powered by agent Iris.",
        "tags": [
          "Creative & Strategy"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "brandName"
                ],
                "properties": {
                  "brandName": {
                    "type": "string",
                    "description": "Brand name to check"
                  },
                  "competitors": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "queryContext": {
                    "type": "string"
                  },
                  "platforms": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "chatgpt",
                        "perplexity",
                        "claude",
                        "gemini"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Visibility scores across AI platforms with competitor comparison"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/competitor-intel": {
      "post": {
        "operationId": "competitorIntel",
        "summary": "Competitor Ad Intel",
        "description": "Reads a competitor's active Meta ads in the EU, UK and Australia from the Meta Ad Library and extracts creative patterns. Powered by agent Olivia.",
        "tags": [
          "Creative & Strategy"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Competitor brand domain or URL"
                  },
                  "competitors": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "category": {
                    "type": "string"
                  },
                  "deepAnalysis": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Active ads, creative patterns, strategy analysis, and stealable ideas"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/roas-audit": {
      "post": {
        "operationId": "roasAudit",
        "summary": "ROAS Audit",
        "description": "Exposes platform ROAS inflation and shows true incremental return. Detects 30-50% typical overclaim. Powered by agent Parker.",
        "tags": [
          "Ad Performance"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "meta",
                      "google"
                    ]
                  },
                  "accountId": {
                    "type": "string"
                  },
                  "reportedRoas": {
                    "type": "number"
                  },
                  "monthlySpend": {
                    "type": "number"
                  },
                  "attributionWindow": {
                    "type": "string"
                  },
                  "category": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Corrected ROAS, phantom revenue, inflation sources"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/ad-account-audit": {
      "post": {
        "operationId": "adAccountAudit",
        "summary": "Ad Account Audit",
        "description": "Finds wasted spend in ad accounts. Analyzes structure, overlap, and leaks. Powered by agent Sam.",
        "tags": [
          "Ad Performance"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "meta",
                      "google"
                    ]
                  },
                  "accountId": {
                    "type": "string"
                  },
                  "brandId": {
                    "type": "string"
                  },
                  "platforms": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "platform": {
                          "type": "string"
                        },
                        "accountId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Campaign analysis, key findings, opportunities, and time series data"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/analyze-creative": {
      "post": {
        "operationId": "creativeAnalyzer",
        "summary": "Creative Analyzer",
        "description": "Scores ad creative with GPT-4o Vision. Analyzes hooks, composition, and platform optimization. Powered by agent Olivia.",
        "tags": [
          "Creative & Strategy"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "imageUrl",
                  "category",
                  "platform"
                ],
                "properties": {
                  "imageUrl": {
                    "type": "string",
                    "description": "HTTPS URL or base64 data:image/"
                  },
                  "category": {
                    "type": "string",
                    "enum": [
                      "fashion",
                      "beauty",
                      "home",
                      "electronics",
                      "food",
                      "fitness",
                      "jewelry",
                      "pets",
                      "baby",
                      "other"
                    ]
                  },
                  "platform": {
                    "type": "string",
                    "enum": [
                      "meta",
                      "tiktok",
                      "google"
                    ]
                  },
                  "context": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Creative scores, DNA analysis, platform optimization, and recommendations"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/creative-fatigue": {
      "post": {
        "operationId": "creativeFatigue",
        "summary": "Creative Fatigue Predictor",
        "description": "Predicts when ads will fatigue 5-7 days early with refresh recommendations. Powered by agent Olivia.",
        "tags": [
          "Creative & Strategy"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "imageUrl",
                  "platform"
                ],
                "properties": {
                  "imageUrl": {
                    "type": "string"
                  },
                  "platform": {
                    "type": "string",
                    "enum": [
                      "meta",
                      "tiktok",
                      "google",
                      "pinterest",
                      "linkedin"
                    ]
                  },
                  "industry": {
                    "type": "string"
                  },
                  "currentFrequency": {
                    "type": "number"
                  },
                  "campaignAge": {
                    "type": "integer",
                    "description": "Days since launch"
                  },
                  "historicalCtr": {
                    "type": "number"
                  },
                  "historicalCpm": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fatigue level, estimated lifespan, signals, and refresh strategy"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/landing-page-analyzer": {
      "post": {
        "operationId": "landingPageAnalyzer",
        "summary": "Landing Page Analyzer",
        "description": "Finds conversion killers on a landing page with specific fixes and estimated lift. Powered by agent Olivia.",
        "tags": [
          "Creative & Strategy"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Landing page URL to analyze"
                  },
                  "industry": {
                    "type": "string"
                  },
                  "competitorUrl": {
                    "type": "string"
                  },
                  "captureScreenshot": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Page score, element analysis, psychology signals, and performance metrics"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/tag-manager-audit": {
      "post": {
        "operationId": "tagManagerAudit",
        "summary": "Tag Manager Audit",
        "description": "Reads the LIVE version of a connected Google Tag Manager container and reports duplicate conversion tags, tags with no firing trigger, paused conversion tags, conversion tags on an unfiltered All Pages trigger, and references to variables the container does not define. One check compares the container against the caller's connected ad accounts and reports a platform with spend and no tag. Requires a Tag Manager connection covering the container. Powered by agent Dana.",
        "tags": [
          "Ad Performance"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "containerPath"
                ],
                "properties": {
                  "containerPath": {
                    "type": "string",
                    "description": "The container, as accounts/{accountId}/containers/{containerId}. Must be one the caller's Tag Manager connection covers"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Findings with the tags each concerns, container counts, a downloadable tag-change plan, and a coverage block naming what the run could not look at"
          },
          "401": {
            "description": "Not signed in. There is no anonymous form of this operation"
          },
          "403": {
            "description": "No Tag Manager connection covers this container, or the connection cannot be read"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/utm-linter": {
      "post": {
        "operationId": "utmLinter",
        "summary": "UTM & Naming Linter",
        "description": "Lints a SET of tagged URLs and campaign or ad names against each other: values spelled several ways, characters that must be encoded, click ids alongside manual tags, duplicated keys, parameters that do not survive a redirect, and names that cannot be parsed back into a structure. Does NOT check utm_source without utm_medium: trackingAudit owns that. Powered by agent Dana.",
        "tags": [
          "Ad Performance"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {
                  "urls": {
                    "type": "string",
                    "description": "Tagged URLs, one per line. Optional if names are supplied."
                  },
                  "names": {
                    "type": "string",
                    "description": "Campaign and ad names, one per line. Optional if urls are supplied."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Findings with dated sources, the naming convention read out of the supplied set, redirect outcomes including chains that could not be followed, coverage notes, a corrected-set artifact, and verification against the caller's previous run"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/ask-cresva": {
      "post": {
        "operationId": "askCresva",
        "summary": "Ask Cresva: Conversational AI Assistant",
        "description": "Natural language interface to all 20 Tools tools. Ask a question, Cresva identifies the right tool, extracts inputs, and runs the analysis. Supports multi-turn conversation.",
        "tags": [
          "Ask Cresva"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "message"
                ],
                "properties": {
                  "message": {
                    "type": "string",
                    "description": "Natural language question",
                    "maxLength": 500
                  },
                  "history": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "user",
                            "assistant"
                          ]
                        },
                        "content": {
                          "type": "string"
                        }
                      }
                    },
                    "maxItems": 10
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool match with extracted inputs and optional auto-executed results"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Required for MCP Platform API endpoints only. Public Tools tools do not require authentication."
      }
    }
  },
  "tags": [
    {
      "name": "Ad Performance",
      "description": "Tools for auditing and optimizing ad spend"
    },
    {
      "name": "Creative & Strategy",
      "description": "Tools for creative analysis and competitive intelligence"
    },
    {
      "name": "Business & Reporting",
      "description": "Tools for profitability, forecasting, and business metrics"
    },
    {
      "name": "Ask Cresva",
      "description": "Conversational AI assistant for all tools"
    }
  ]
}
