{
  "openapi": "3.1.0",
  "info": {
    "title": "AdMakeAI Agent API",
    "version": "1.0.0",
    "summary": "Generate ad images and UGC video ads, research competitors' Meta ads, and read Meta ad performance.",
    "description": "Every AdMakeAI agent tool is one endpoint: `POST /api/v1/<tool>` with the tool's input as a plain JSON body (no tRPC or superjson envelope). The same tools are served over MCP at https://admakeai.com/api/mcp.\n\n**Auth.** Send an API key from https://admakeai.com/dashboard/integrations/api as `x-api-key: <key>` or `Authorization: Bearer <key>`. API keys can call every tool. OAuth 2.1 access tokens (`amai_at_…`) also work as a Bearer token, limited to the scopes the user granted.\n\n**Responses.** Success is `{ \"ok\": true, \"tool\": \"<tool>\", \"data\": <result> }` with dates as ISO 8601 strings. A tool error is `{ \"ok\": false, \"error\": { \"code\", \"message\" } }` with a matching HTTP status; auth and routing errors are `{ \"error\": \"<message>\" }`.\n\n**GET.** Any tool can also be called as `GET /api/v1/<tool>?input=<URL-encoded JSON>`. Tool names may use dots (`adGeneration.create`) or double underscores (`adGeneration__create`).\n\n**Async work.** Image and video tools queue a render and return its id: poll `adGeneration.getById` or `videoGeneration.getStatus` until `status` is `COMPLETED`. Tools that cost credits say so.",
    "termsOfService": "https://admakeai.com/resources/terms-of-service",
    "license": {
      "name": "AdMakeAI Terms of Service",
      "url": "https://admakeai.com/resources/terms-of-service"
    },
    "contact": {
      "name": "AdMakeAI Support",
      "email": "support@admakeai.com",
      "url": "https://admakeai.com/resources/faq"
    }
  },
  "externalDocs": {
    "description": "Agent API reference with a request tester",
    "url": "https://admakeai.com/api/docs"
  },
  "servers": [
    {
      "url": "https://admakeai.com"
    }
  ],
  "tags": [
    {
      "name": "Account",
      "description": "Profile, plan and credit balance."
    },
    {
      "name": "Projects",
      "description": "Create the first project and edit a project's brand brief and assets."
    },
    {
      "name": "Ad research",
      "description": "Projects, competitor tracking, and any brand's live ads from the Meta Ad Library."
    },
    {
      "name": "Uploads",
      "description": "Upload source images and list them."
    },
    {
      "name": "Ad images",
      "description": "Design, render and edit ad images, then poll them until COMPLETED."
    },
    {
      "name": "Ad copy",
      "description": "Write Facebook and Instagram ad copy for an ad image."
    },
    {
      "name": "Ad sets",
      "description": "A shared brief that batches of ad variations are generated from."
    },
    {
      "name": "Video ads",
      "description": "UGC-style video ads."
    },
    {
      "name": "Meta connections",
      "description": "The user's connected Facebook ad accounts and Pages."
    },
    {
      "name": "Meta uploads",
      "description": "Check and upload AdMakeAI ads to a Meta ad account."
    },
    {
      "name": "Meta campaign drafts",
      "description": "Create Meta campaigns, ad sets and ads as drafts."
    },
    {
      "name": "Meta ad analytics",
      "description": "Spend and performance of the user's Meta ad accounts, campaigns and ads."
    }
  ],
  "paths": {
    "/api/v1/user.me": {
      "post": {
        "operationId": "userMe",
        "summary": "Get account profile",
        "description": "Get the authenticated user's profile, plan, and credit balance.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/user.getCredits": {
      "post": {
        "operationId": "userGetCredits",
        "summary": "Get credit balance",
        "description": "Get the authenticated user's current credit balance only.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adResearch.listProjects": {
      "post": {
        "operationId": "adResearchListProjects",
        "summary": "List projects",
        "description": "List the user's projects (brands). ALWAYS call this before generating anything: every generation needs a projectId, and the project's brand brief is what the render is built from. Pick the project the user's request is about; if more than one could fit, ask which. If the list is empty, this is a new account: ask the user for their brand's website (never guess it) and call project.createFirst, then carry on with their request.",
        "tags": [
          "Ad research"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "limit": {
                    "default": 20,
                    "type": "number",
                    "minimum": 1,
                    "maximum": 50
                  },
                  "cursor": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/project.createFirst": {
      "post": {
        "operationId": "projectCreateFirst",
        "summary": "Create first project",
        "description": "Create the account's FIRST project from the brand's website URL: reads the site and fills in the brand brief and logo in about 10-15 seconds. Free. Only for accounts with no projects (adResearch.listProjects returned an empty list); otherwise it fails, and further projects are made at https://admakeai.com/dashboard. Ask the user for the URL; never guess it.",
        "tags": [
          "Projects"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "websiteUrl": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "websiteUrl"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adResearch.getProject": {
      "post": {
        "operationId": "adResearchGetProject",
        "summary": "Get project brief",
        "description": "Get one project with its full brand brief, competitors, research jobs, and scraped-ad counts. Read this before generating so the creative matches the brand.",
        "tags": [
          "Ad research"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adResearch.pollStatus": {
      "post": {
        "operationId": "adResearchPollStatus",
        "summary": "Get research status",
        "description": "Poll a project's research status: pipeline stage, running scrape jobs, competitor and saved-ad counts.",
        "tags": [
          "Ad research"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/project.updateBrief": {
      "post": {
        "operationId": "projectUpdateBrief",
        "summary": "Update brand brief",
        "description": "Update a project's brand brief (product summary, target audience, value proposition, industry, keywords). Sharpening the brief improves every later generation.",
        "tags": [
          "Projects"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "projectId": {
                    "type": "string"
                  },
                  "productSummary": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000
                  },
                  "targetAudience": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "valueProposition": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "industry": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "keywords": {
                    "maxItems": 15,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "required": [
                  "projectId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/project.getAssets": {
      "post": {
        "operationId": "projectGetAssets",
        "summary": "List brand assets",
        "description": "List a project's stored assets (product photos, logos) with their URLs, for use as reference images.",
        "tags": [
          "Projects"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "projectId": {
                    "type": "string"
                  }
                },
                "required": [
                  "projectId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/upload.uploadImageBase64": {
      "post": {
        "operationId": "uploadUploadImageBase64",
        "summary": "Upload image",
        "description": "Upload a JPEG, PNG, or WebP image from base64 bytes into AdMakeAI storage. Returns an image ID and public URL for image generation or Facebook campaign drafts.",
        "tags": [
          "Uploads"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filename": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "contentType": {
                    "type": "string"
                  },
                  "base64Data": {
                    "type": "string",
                    "minLength": 1
                  },
                  "imageHash": {
                    "type": "string"
                  },
                  "turnstileToken": {
                    "type": "string"
                  }
                },
                "required": [
                  "base64Data"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/upload.getUserImages": {
      "post": {
        "operationId": "uploadGetUserImages",
        "summary": "List uploaded images",
        "description": "List the user's previously uploaded source images, newest first, with pagination.",
        "tags": [
          "Uploads"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "limit": {
                    "default": 20,
                    "type": "number",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "cursor": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adGeneration.create": {
      "post": {
        "operationId": "adGenerationCreate",
        "summary": "Design an ad",
        "description": "Queue a FINISHED AD image render. Required: projectId. Call adResearch.listProjects first and pick the project the request is about, or ask the user when it is ambiguous; never guess an id. Also required: prompt, a creative brief rather than a finished image prompt. How the prompt is used: a creative-director model rewrites it into the real image prompt using the project's brand brief, and that rewrite always adds a specific headline, a subline, a CTA button, and the project logo when the project has one. Negative instructions in the prompt ('no text', 'no logo', 'nothing but the product') cannot suppress those; use adGeneration.generateImage when the caller wants exact or no text. Optional: adType, aspectRatio, quality (low/high/ultra), referenceImageUrls, inputImageId (from upload.uploadImageBase64), referenceAdId or referenceInspirationId to remix an existing ad. Costs credits. Returns a generation ID. Poll adGeneration.getById until status is COMPLETED. Tier names users see: low = Fast, high = Sharp, ultra = Max.",
        "tags": [
          "Ad images"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "projectId": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string",
                    "minLength": 1
                  },
                  "adType": {
                    "default": "product_showcase",
                    "type": "string",
                    "enum": [
                      "product_showcase",
                      "promotional",
                      "testimonial",
                      "lifestyle",
                      "comparison",
                      "announcement"
                    ]
                  },
                  "aspectRatio": {
                    "default": "1:1",
                    "type": "string",
                    "enum": [
                      "1:1",
                      "4:5",
                      "9:16",
                      "16:9"
                    ]
                  },
                  "quality": {
                    "default": "low",
                    "type": "string",
                    "enum": [
                      "low",
                      "high",
                      "ultra"
                    ]
                  },
                  "referenceImageUrls": {
                    "maxItems": 4,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "inputImageId": {
                    "type": "string"
                  },
                  "referenceAdId": {
                    "type": "string"
                  },
                  "referenceInspirationId": {
                    "type": "string"
                  },
                  "adSetId": {
                    "type": "string"
                  }
                },
                "required": [
                  "projectId",
                  "prompt"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adGeneration.generateImage": {
      "post": {
        "operationId": "adGenerationGenerateImage",
        "summary": "Render image from exact prompt",
        "description": "Queue an image render from a VERBATIM prompt. The prompt goes to the image model exactly as written: no creative-director rewrite, no brand brief, no added headline, subline or CTA, and no project logo. The image contains only what the prompt stipulates. Use this when the caller wants only specific stipulated text, forbids text/logos/CTAs, or wants raw scene, product, or photography imagery rather than a finished ad; use adGeneration.create for finished ads. Required: projectId (credit scoping only, nothing from it enters the prompt) and prompt. Optional: aspectRatio, quality (low/high/ultra), referenceImageUrls and inputImageId for image-to-image. Costs the same credits as adGeneration.create. Returns a generation ID. Poll adGeneration.getById until status is COMPLETED. Tier names users see: low = Fast, high = Sharp, ultra = Max.",
        "tags": [
          "Ad images"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "projectId": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string",
                    "minLength": 1
                  },
                  "aspectRatio": {
                    "default": "1:1",
                    "type": "string",
                    "enum": [
                      "1:1",
                      "4:5",
                      "9:16",
                      "16:9"
                    ]
                  },
                  "quality": {
                    "default": "low",
                    "type": "string",
                    "enum": [
                      "low",
                      "high",
                      "ultra"
                    ]
                  },
                  "referenceImageUrls": {
                    "maxItems": 4,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "inputImageId": {
                    "type": "string"
                  }
                },
                "required": [
                  "projectId",
                  "prompt"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adGeneration.edit": {
      "post": {
        "operationId": "adGenerationEdit",
        "summary": "Edit ad image",
        "description": "Queue an image-to-image edit and return immediately. The universal edit tool: change background, restyle, swap a subject, change aspect ratio, add brand assets, or remix a competitor ad. Source is either sourceAdId (one of the user's own generations) or sourceImageUrl (any direct image URL). Costs credits. Poll adGeneration.getById until COMPLETED.",
        "tags": [
          "Ad images"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sourceAdId": {
                    "type": "string"
                  },
                  "sourceImageUrl": {
                    "type": "string",
                    "format": "uri"
                  },
                  "editInstructions": {
                    "type": "string",
                    "minLength": 3
                  },
                  "aspectRatio": {
                    "type": "string",
                    "enum": [
                      "1:1",
                      "4:5",
                      "9:16",
                      "16:9"
                    ]
                  },
                  "quality": {
                    "default": "low",
                    "type": "string",
                    "enum": [
                      "low",
                      "high",
                      "ultra"
                    ]
                  },
                  "projectId": {
                    "type": "string"
                  }
                },
                "required": [
                  "editInstructions"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adGeneration.getById": {
      "post": {
        "operationId": "adGenerationGetById",
        "summary": "Get ad",
        "description": "Get the status, prompt, and resulting image URLs of a single ad generation by ID. Use to poll until status is COMPLETED.",
        "tags": [
          "Ad images"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adGeneration.list": {
      "post": {
        "operationId": "adGenerationList",
        "summary": "List ads",
        "description": "Paginated list of the user's ad generations, newest first.",
        "tags": [
          "Ad images"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "limit": {
                    "default": 20,
                    "type": "number",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "cursor": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adGeneration.getRecent": {
      "post": {
        "operationId": "adGenerationGetRecent",
        "summary": "List recent ads",
        "description": "Get the user's most recent ad generations (default limit 12).",
        "tags": [
          "Ad images"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "limit": {
                    "default": 6,
                    "type": "number",
                    "minimum": 1,
                    "maximum": 20
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adGeneration.searchAll": {
      "post": {
        "operationId": "adGenerationSearchAll",
        "summary": "Search ads",
        "description": "Full-text search across the user's ad generations by prompt.",
        "tags": [
          "Ad images"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "default": "",
                    "type": "string"
                  },
                  "limit": {
                    "default": 24,
                    "type": "number",
                    "minimum": 1,
                    "maximum": 60
                  },
                  "cursor": {
                    "default": 0,
                    "type": "number",
                    "minimum": 0
                  },
                  "filter": {
                    "default": "all",
                    "type": "string",
                    "enum": [
                      "all",
                      "liked",
                      "downloaded",
                      "not_downloaded"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adGeneration.listPending": {
      "post": {
        "operationId": "adGenerationListPending",
        "summary": "List pending ads",
        "description": "List the user's currently-pending ad generations.",
        "tags": [
          "Ad images"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "adSetId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adGeneration.toggleFavorite": {
      "post": {
        "operationId": "adGenerationToggleFavorite",
        "summary": "Toggle ad favorite",
        "description": "Star or unstar one of the user's ad generations. Free — use it to mark the winner of a batch.",
        "tags": [
          "Ad images"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adCopyGeneration.generate": {
      "post": {
        "operationId": "adCopyGenerationGenerate",
        "summary": "Write ad copy",
        "description": "Write Facebook/Instagram ad copy for an ad image URL: headline, primary text, description, CTA, and hook angle. Returns up to 5 variations. Pass projectId so the copy uses the brand brief. Call this right after a generation completes.",
        "tags": [
          "Ad copy"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "imageUrl": {
                    "type": "string",
                    "format": "uri"
                  },
                  "projectId": {
                    "type": "string"
                  },
                  "messagingStyle": {
                    "default": "auto",
                    "type": "string",
                    "enum": [
                      "auto",
                      "clickbait",
                      "professional",
                      "controversial",
                      "oneliners",
                      "ugc",
                      "directResponse",
                      "storytelling"
                    ]
                  },
                  "variationCount": {
                    "default": 3,
                    "type": "number",
                    "minimum": 1,
                    "maximum": 5
                  },
                  "additionalInstructions": {
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "imageUrl"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adCopyGeneration.getMessagingStyles": {
      "post": {
        "operationId": "adCopyGenerationGetMessagingStyles",
        "summary": "List ad copy styles",
        "description": "List the ad-copy messaging styles (clickbait, professional, UGC, direct response, storytelling, ...) accepted by adCopyGeneration.generate.",
        "tags": [
          "Ad copy"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adSet.list": {
      "post": {
        "operationId": "adSetList",
        "summary": "List ad sets",
        "description": "Paginated list of the user's ad sets.",
        "tags": [
          "Ad sets"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "page": {
                    "default": 1,
                    "type": "number",
                    "minimum": 1
                  },
                  "perPage": {
                    "default": 12,
                    "type": "number",
                    "minimum": 1,
                    "maximum": 50
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adSet.get": {
      "post": {
        "operationId": "adSetGet",
        "summary": "Get ad set",
        "description": "Get an ad set by ID, including its general instructions.",
        "tags": [
          "Ad sets"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adSet.create": {
      "post": {
        "operationId": "adSetCreate",
        "summary": "Create ad set",
        "description": "Create an ad set: a project + shared brief + ad type + quality + aspect ratio that many variations are generated from. Free — the credits are charged by adSet.generateBatch. Tier names users see: low = Fast, high = Sharp, ultra = Max.",
        "tags": [
          "Ad sets"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "generalInstructions": {
                    "type": "string",
                    "minLength": 1
                  },
                  "projectId": {
                    "type": "string"
                  },
                  "adType": {
                    "type": "string",
                    "enum": [
                      "product_showcase",
                      "promotional",
                      "testimonial",
                      "lifestyle",
                      "comparison",
                      "announcement"
                    ]
                  },
                  "quality": {
                    "default": "low",
                    "type": "string",
                    "enum": [
                      "low",
                      "high",
                      "ultra"
                    ]
                  },
                  "aspectRatio": {
                    "default": "1:1",
                    "type": "string",
                    "enum": [
                      "1:1",
                      "4:5",
                      "9:16",
                      "16:9"
                    ]
                  },
                  "additionalImageUrls": {
                    "default": [],
                    "maxItems": 3,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "adCopyInstructions": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "adCopyMessagingStyle": {
                    "default": "auto",
                    "type": "string",
                    "enum": [
                      "auto",
                      "clickbait",
                      "professional",
                      "controversial",
                      "oneliners",
                      "ugc",
                      "directResponse",
                      "storytelling"
                    ]
                  }
                },
                "required": [
                  "generalInstructions",
                  "projectId",
                  "adType"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adSet.update": {
      "post": {
        "operationId": "adSetUpdate",
        "summary": "Update ad set",
        "description": "Update an ad set's brief, ad type, quality, aspect ratio, or reference images before generating another batch.",
        "tags": [
          "Ad sets"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "generalInstructions": {
                    "type": "string",
                    "minLength": 1
                  },
                  "adType": {
                    "type": "string",
                    "enum": [
                      "product_showcase",
                      "promotional",
                      "testimonial",
                      "lifestyle",
                      "comparison",
                      "announcement"
                    ]
                  },
                  "quality": {
                    "type": "string",
                    "enum": [
                      "low",
                      "high",
                      "ultra"
                    ]
                  },
                  "aspectRatio": {
                    "type": "string",
                    "enum": [
                      "1:1",
                      "4:5",
                      "9:16",
                      "16:9"
                    ]
                  },
                  "additionalImageUrls": {
                    "maxItems": 3,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "adCopyInstructions": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 1000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "adCopyMessagingStyle": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "clickbait",
                      "professional",
                      "controversial",
                      "oneliners",
                      "ugc",
                      "directResponse",
                      "storytelling"
                    ]
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adSet.getGenerations": {
      "post": {
        "operationId": "adSetGetGenerations",
        "summary": "List ads in ad set",
        "description": "List all ad generations belonging to an ad set.",
        "tags": [
          "Ad sets"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "adSetId": {
                    "type": "string"
                  },
                  "page": {
                    "default": 1,
                    "type": "number",
                    "minimum": 1
                  },
                  "perPage": {
                    "default": 50,
                    "type": "number",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "filter": {
                    "default": "all",
                    "type": "string",
                    "enum": [
                      "all",
                      "liked",
                      "downloaded",
                      "not_downloaded"
                    ]
                  }
                },
                "required": [
                  "adSetId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adSet.generateBatch": {
      "post": {
        "operationId": "adSetGenerateBatch",
        "summary": "Design ad set variations",
        "description": "Generate a batch of ad variations from one ad set + per-variation instructions. Enqueues N background jobs and returns their generation IDs.",
        "tags": [
          "Ad sets"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "adSetId": {
                    "type": "string"
                  },
                  "specificInstructions": {
                    "type": "string"
                  },
                  "count": {
                    "default": "4",
                    "type": "string",
                    "enum": [
                      "1",
                      "2",
                      "4",
                      "6",
                      "8",
                      "15"
                    ]
                  },
                  "quality": {
                    "type": "string",
                    "enum": [
                      "low",
                      "high",
                      "ultra"
                    ]
                  }
                },
                "required": [
                  "adSetId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adSet.suggestDirections": {
      "post": {
        "operationId": "adSetSuggestDirections",
        "summary": "Suggest creative directions",
        "description": "Ask the model for distinct creative directions (angles/hooks) for an ad set, to feed back in as per-variation instructions.",
        "tags": [
          "Ad sets"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "adSetId": {
                    "type": "string"
                  },
                  "exclude": {
                    "maxItems": 12,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 600
                    }
                  }
                },
                "required": [
                  "adSetId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/videoGeneration.start": {
      "post": {
        "operationId": "videoGenerationStart",
        "summary": "Create UGC video ad",
        "description": "Queue UGC-style video ad generation for a project (script, voice, and render). Costs credits per video by quality; optional engine picks the model family (hosted = Gemini/FLUX.3 on fal, minimax = self-hosted MiniMax H3; default hosted). Poll videoGeneration.getStatus. Tier names users see: low = Fast, medium = Sharp, high = Max. Video Sharp is medium, not high.",
        "tags": [
          "Video ads"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "projectId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "userInstructions": {
                    "type": "string"
                  },
                  "videoCount": {
                    "default": 1,
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10
                  },
                  "quality": {
                    "default": "low",
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ]
                  },
                  "engine": {
                    "type": "string",
                    "enum": [
                      "hosted",
                      "minimax"
                    ]
                  },
                  "startingFrameUrl": {
                    "type": "string",
                    "format": "uri"
                  },
                  "generateStartingFrame": {
                    "default": false,
                    "type": "boolean"
                  },
                  "referenceImageUrl": {
                    "type": "string",
                    "format": "uri"
                  }
                },
                "required": [
                  "projectId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/videoGeneration.getStatus": {
      "post": {
        "operationId": "videoGenerationGetStatus",
        "summary": "Get video status",
        "description": "Get the status and output URL of a single video generation by ID. Poll until COMPLETED.",
        "tags": [
          "Video ads"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/videoGeneration.list": {
      "post": {
        "operationId": "videoGenerationList",
        "summary": "List video ads",
        "description": "Paginated list of the user's completed UGC video ads.",
        "tags": [
          "Video ads"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "projectId": {
                    "type": "string"
                  },
                  "videoSetId": {
                    "type": "string"
                  },
                  "page": {
                    "default": 1,
                    "type": "number",
                    "minimum": 1
                  },
                  "perPage": {
                    "default": 12,
                    "type": "number",
                    "minimum": 1,
                    "maximum": 50
                  },
                  "filter": {
                    "default": "all",
                    "type": "string",
                    "enum": [
                      "all",
                      "liked",
                      "downloaded"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/videoGeneration.listPending": {
      "post": {
        "operationId": "videoGenerationListPending",
        "summary": "List pending videos",
        "description": "List the user's currently-rendering video generations.",
        "tags": [
          "Video ads"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "videoSetId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adResearch.searchCompanies": {
      "post": {
        "operationId": "adResearchSearchCompanies",
        "summary": "Find advertiser page",
        "description": "Resolve a brand name to its Facebook advertiser Page (id, name, category, follower counts). Step 1 of looking up any brand's live ads.",
        "tags": [
          "Ad research"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  }
                },
                "required": [
                  "query"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adResearch.getCompanyAds": {
      "post": {
        "operationId": "adResearchGetCompanyAds",
        "summary": "Get advertiser's live ads",
        "description": "Get the ads a Facebook Page is currently running, from the Meta Ad Library, by pageId (from adResearch.searchCompanies). Works for any advertiser, not just the user's competitors.",
        "tags": [
          "Ad research"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pageId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "country": {
                    "default": "ALL",
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 8
                  },
                  "cursor": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2048
                  }
                },
                "required": [
                  "pageId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adResearch.addCompetitors": {
      "post": {
        "operationId": "adResearchAddCompetitors",
        "summary": "Add competitors",
        "description": "Add competitors to a project by name (optionally with website URL) and kick off ad scraping for them.",
        "tags": [
          "Ad research"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "projectId": {
                    "type": "string"
                  },
                  "competitors": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "minLength": 1
                        },
                        "websiteUrl": {
                          "type": "string",
                          "format": "uri"
                        },
                        "type": {
                          "default": "DIRECT",
                          "type": "string",
                          "enum": [
                            "DIRECT",
                            "INDIRECT",
                            "ASPIRATIONAL"
                          ]
                        }
                      },
                      "required": [
                        "name"
                      ]
                    }
                  },
                  "scrapeAds": {
                    "default": true,
                    "type": "boolean"
                  }
                },
                "required": [
                  "projectId",
                  "competitors"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adResearch.scrapeCompetitor": {
      "post": {
        "operationId": "adResearchScrapeCompetitor",
        "summary": "Refresh competitor ads",
        "description": "Re-scrape one competitor's live Facebook ads into the project. Returns a research job — poll adResearch.pollStatus.",
        "tags": [
          "Ad research"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "competitorId": {
                    "type": "string"
                  }
                },
                "required": [
                  "competitorId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adResearch.getCompetitorPreview": {
      "post": {
        "operationId": "adResearchGetCompetitorPreview",
        "summary": "Preview competitor ads",
        "description": "Preview the ads already scraped for a single competitor.",
        "tags": [
          "Ad research"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "competitorId": {
                    "type": "string"
                  }
                },
                "required": [
                  "competitorId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adResearch.getScrapedAds": {
      "post": {
        "operationId": "adResearchGetScrapedAds",
        "summary": "Browse competitor ads",
        "description": "Browse the competitor ads scraped into a project, with sorting (relevance, longest_running, newest) and media-type/keyword filters. This is the raw material for remixes.",
        "tags": [
          "Ad research"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "projectId": {
                    "type": "string"
                  },
                  "competitorId": {
                    "type": "string"
                  },
                  "mediaType": {
                    "type": "string",
                    "enum": [
                      "IMAGE",
                      "VIDEO",
                      "CAROUSEL",
                      "ALL"
                    ]
                  },
                  "searchTerm": {
                    "type": "string"
                  },
                  "search": {
                    "type": "string"
                  },
                  "showIrrelevant": {
                    "default": false,
                    "type": "boolean"
                  },
                  "sortBy": {
                    "default": "relevance",
                    "type": "string",
                    "enum": [
                      "relevance",
                      "newest",
                      "oldest",
                      "longest_running",
                      "popularity",
                      "recently_added"
                    ]
                  },
                  "limit": {
                    "default": 30,
                    "type": "number",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "offset": {
                    "default": 0,
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "projectId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adResearch.getAdDetails": {
      "post": {
        "operationId": "adResearchGetAdDetails",
        "summary": "Get competitor ad",
        "description": "Get one scraped competitor ad in full: creative URLs, ad text, headline, run dates, and platform placements.",
        "tags": [
          "Ad research"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "projectId": {
                    "type": "string"
                  },
                  "scrapedAdId": {
                    "type": "string"
                  }
                },
                "required": [
                  "projectId",
                  "scrapedAdId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adResearch.saveInspiration": {
      "post": {
        "operationId": "adResearchSaveInspiration",
        "summary": "Save ad as inspiration",
        "description": "Save a scraped competitor ad to a project as inspiration. The returned inspiration ID can be passed to adGeneration.create as referenceInspirationId to remix it.",
        "tags": [
          "Ad research"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "scrapedAdId": {
                    "type": "string"
                  },
                  "projectId": {
                    "type": "string"
                  },
                  "action": {
                    "default": "TAKE_INSPIRATION",
                    "type": "string",
                    "enum": [
                      "COPY_DESIGN",
                      "TAKE_INSPIRATION",
                      "AI_GENERATE"
                    ]
                  },
                  "userNotes": {
                    "type": "string"
                  }
                },
                "required": [
                  "scrapedAdId",
                  "projectId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/adResearch.getSavedInspirations": {
      "post": {
        "operationId": "adResearchGetSavedInspirations",
        "summary": "List saved inspirations",
        "description": "List the competitor ads saved as inspiration for a project, with their inspiration IDs.",
        "tags": [
          "Ad research"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "projectId": {
                    "type": "string"
                  },
                  "limit": {
                    "default": 20,
                    "type": "number",
                    "minimum": 1,
                    "maximum": 50
                  },
                  "offset": {
                    "default": 0,
                    "type": "number",
                    "minimum": 0
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/facebookConnection.list": {
      "post": {
        "operationId": "facebookConnectionList",
        "summary": "List Facebook connections",
        "description": "List the user's connected Facebook ad accounts and Pages, with their cached identity info.",
        "tags": [
          "Meta connections"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/facebookUpload.getCampaigns": {
      "post": {
        "operationId": "facebookUploadGetCampaigns",
        "summary": "List ad account campaigns",
        "description": "List Meta campaigns for a specific connected ad account (cache-first; refresh from Meta if cold).",
        "tags": [
          "Meta uploads"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "adAccountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "refresh": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "adAccountId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/facebookUpload.getAdSets": {
      "post": {
        "operationId": "facebookUploadGetAdSets",
        "summary": "List campaign ad sets",
        "description": "List Meta ad sets under a given campaign.",
        "tags": [
          "Meta uploads"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "adAccountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "fbCampaignId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "refresh": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "adAccountId",
                  "fbCampaignId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/facebookUpload.runPreflight": {
      "post": {
        "operationId": "facebookUploadRunPreflight",
        "summary": "Check ad before Meta upload",
        "description": "Validate an ad-creative + ad-account pair for Meta upload (image dimensions, copy length, etc.) without uploading.",
        "tags": [
          "Meta uploads"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "adGenerationId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "copy": {
                    "type": "object",
                    "properties": {
                      "primaryText": {
                        "type": "string",
                        "minLength": 1
                      },
                      "headline": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "callToAction": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "primaryText"
                    ]
                  },
                  "destinationUrl": {
                    "type": "string",
                    "format": "uri"
                  },
                  "targetAdSetId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "declareAsAiGenerated": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "adGenerationId",
                  "copy",
                  "destinationUrl",
                  "targetAdSetId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/facebookUpload.request": {
      "post": {
        "operationId": "facebookUploadRequest",
        "summary": "Upload ad to Meta",
        "description": "Enqueue an upload of an AdMakeAI-generated ad creative to a Meta ad account / campaign / ad set. Creates a real ad on Meta.",
        "tags": [
          "Meta uploads"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:publish"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "adGenerationId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "targetAdSetId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "targetPageId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "targetInstagramActorId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "copy": {
                    "type": "object",
                    "properties": {
                      "primaryText": {
                        "type": "string",
                        "minLength": 1
                      },
                      "headline": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "callToAction": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "primaryText",
                      "callToAction"
                    ]
                  },
                  "destinationUrl": {
                    "type": "string",
                    "format": "uri"
                  },
                  "templateOverrides": {
                    "type": "object",
                    "properties": {
                      "campaign": {
                        "type": "object",
                        "properties": {
                          "objective": {
                            "type": "string",
                            "enum": [
                              "OUTCOME_AWARENESS",
                              "OUTCOME_TRAFFIC",
                              "OUTCOME_ENGAGEMENT",
                              "OUTCOME_LEADS",
                              "OUTCOME_APP_PROMOTION",
                              "OUTCOME_SALES"
                            ]
                          },
                          "specialAdCategories": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "specialAdCategoryCountry": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "buyingType": {
                            "type": "string",
                            "enum": [
                              "AUCTION",
                              "RESERVED"
                            ]
                          },
                          "bidStrategy": {
                            "type": "string",
                            "enum": [
                              "LOWEST_COST_WITHOUT_CAP",
                              "LOWEST_COST_WITH_BID_CAP",
                              "COST_CAP",
                              "LOWEST_COST_WITH_MIN_ROAS"
                            ]
                          },
                          "dailyBudgetCents": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "lifetimeBudgetCents": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "spendCapCents": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "campaignOptimizationType": {
                            "type": "string",
                            "enum": [
                              "NONE",
                              "ICO_ONLY"
                            ]
                          }
                        }
                      },
                      "adSet": {
                        "type": "object",
                        "properties": {
                          "destinationType": {
                            "type": "string"
                          },
                          "optimizationGoal": {
                            "type": "string"
                          },
                          "billingEvent": {
                            "type": "string"
                          },
                          "bidAmountCents": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "bidConstraints": {
                            "type": "object",
                            "properties": {
                              "roasAverageFloor": {
                                "type": "number"
                              }
                            }
                          },
                          "promotedObject": {
                            "type": "object",
                            "properties": {
                              "pixelId": {
                                "type": "string"
                              },
                              "customEventType": {
                                "type": "string"
                              },
                              "applicationId": {
                                "type": "string"
                              },
                              "pageId": {
                                "type": "string"
                              }
                            }
                          },
                          "attributionSpec": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "eventType": {
                                  "type": "string",
                                  "enum": [
                                    "CLICK_THROUGH",
                                    "VIEW_THROUGH"
                                  ]
                                },
                                "windowDays": {
                                  "anyOf": [
                                    {
                                      "type": "number",
                                      "const": 1
                                    },
                                    {
                                      "type": "number",
                                      "const": 7
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "eventType",
                                "windowDays"
                              ]
                            }
                          },
                          "schedule": {
                            "type": "object",
                            "properties": {
                              "startTime": {
                                "type": "string"
                              },
                              "endTime": {
                                "type": "string"
                              },
                              "daypartingHours": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "days": {
                                      "type": "array",
                                      "items": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 6
                                      }
                                    },
                                    "startMinute": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 1440
                                    },
                                    "endMinute": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 1440
                                    }
                                  },
                                  "required": [
                                    "days",
                                    "startMinute",
                                    "endMinute"
                                  ]
                                }
                              }
                            }
                          },
                          "frequencyControl": {
                            "type": "object",
                            "properties": {
                              "event": {
                                "type": "string",
                                "const": "IMPRESSIONS"
                              },
                              "intervalDays": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "maxFrequency": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "event",
                              "intervalDays",
                              "maxFrequency"
                            ]
                          },
                          "targeting": {
                            "type": "object",
                            "properties": {
                              "geoLocations": {
                                "type": "object",
                                "properties": {
                                  "countries": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "cities": {
                                    "type": "array",
                                    "items": {}
                                  },
                                  "regions": {
                                    "type": "array",
                                    "items": {}
                                  },
                                  "zips": {
                                    "type": "array",
                                    "items": {}
                                  }
                                }
                              },
                              "excludedGeoLocations": {},
                              "ageMin": {
                                "type": "integer",
                                "minimum": 13,
                                "maximum": 65
                              },
                              "ageMax": {
                                "type": "integer",
                                "minimum": 13,
                                "maximum": 65
                              },
                              "genders": {
                                "type": "array",
                                "items": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                }
                              },
                              "locales": {
                                "type": "array",
                                "items": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                }
                              },
                              "flexibleSpec": {
                                "type": "array",
                                "items": {}
                              },
                              "exclusions": {},
                              "customAudiences": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "id"
                                  ]
                                }
                              },
                              "excludedCustomAudiences": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "id"
                                  ]
                                }
                              },
                              "publisherPlatforms": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "facebookPositions": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "instagramPositions": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "messengerPositions": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "audienceNetworkPositions": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "devicePlatforms": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      },
                      "ad": {
                        "type": "object",
                        "properties": {
                          "pageId": {
                            "type": "string"
                          },
                          "instagramActorId": {
                            "type": "string"
                          },
                          "callToAction": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string"
                              },
                              "value": {
                                "type": "object",
                                "properties": {
                                  "link": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "link"
                                ]
                              }
                            },
                            "required": [
                              "type",
                              "value"
                            ]
                          },
                          "urlTagsTemplate": {
                            "type": "string"
                          }
                        }
                      },
                      "account": {
                        "type": "object",
                        "properties": {
                          "defaultCurrency": {
                            "type": "string"
                          },
                          "defaultTimezoneId": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        }
                      },
                      "advantageDisables": {
                        "type": "object",
                        "properties": {
                          "audience": {
                            "type": "boolean"
                          },
                          "detailedTargeting": {
                            "type": "boolean"
                          },
                          "lookalikeExpansion": {
                            "type": "boolean"
                          },
                          "campaignBudget": {
                            "type": "boolean"
                          },
                          "placements": {
                            "type": "boolean"
                          },
                          "creativeStandardEnhancements": {
                            "type": "boolean"
                          },
                          "creativeTextGeneration": {
                            "type": "boolean"
                          },
                          "creativeMusic": {
                            "type": "boolean"
                          },
                          "creativeImageUncrop": {
                            "type": "boolean"
                          },
                          "multiAdvertiser": {
                            "type": "boolean"
                          }
                        }
                      },
                      "preflightOverrides": {
                        "type": "object",
                        "properties": {
                          "skipPersonalAttributesCheck": {
                            "type": "boolean"
                          },
                          "declareAsAiGenerated": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  },
                  "confirmedReadinessDismissals": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "adGenerationId",
                  "targetAdSetId",
                  "targetPageId",
                  "copy",
                  "destinationUrl"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/facebookUpload.list": {
      "post": {
        "operationId": "facebookUploadList",
        "summary": "List Meta uploads",
        "description": "List previously-uploaded ads, filterable by ad account and state.",
        "tags": [
          "Meta uploads"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "adAccountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "adGenerationId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "uploadState": {
                    "type": "string",
                    "enum": [
                      "QUEUED",
                      "PREFLIGHT_FAILED",
                      "READINESS_FAILED",
                      "IMAGE_UPLOADING",
                      "IMAGE_UPLOAD_FAILED",
                      "CREATIVE_CREATING",
                      "CREATIVE_FAILED",
                      "AD_CREATING",
                      "AD_CREATE_FAILED",
                      "UPLOADED_PAUSED",
                      "META_REJECTED",
                      "USER_DELETED"
                    ]
                  },
                  "search": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "limit": {
                    "default": 24,
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 100
                  },
                  "cursor": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/facebookUpload.get": {
      "post": {
        "operationId": "facebookUploadGet",
        "summary": "Get Meta upload",
        "description": "Get the upload state and Meta IDs of a single uploaded ad.",
        "tags": [
          "Meta uploads"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "uploadedAdId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "uploadedAdId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/facebookCampaignDraft.sourceAssets": {
      "post": {
        "operationId": "facebookCampaignDraftSourceAssets",
        "summary": "Get reusable Meta creatives",
        "description": "Resolve previously-uploaded Meta ads into reusable creative assets for a campaign draft.",
        "tags": [
          "Meta campaign drafts"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connectionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "adAccountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "platformAdIds": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "zernioAdIds": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "required": [
                  "connectionId",
                  "adAccountId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/facebookCampaignDraft.getAgentDraft": {
      "post": {
        "operationId": "facebookCampaignDraftGetAgentDraft",
        "summary": "Get campaign draft",
        "description": "Read a saved agent-created Facebook campaign draft by draft ID before pushing.",
        "tags": [
          "Meta campaign drafts"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "draftId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "draftId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/facebookCampaignDraft.pushAgentDraft": {
      "post": {
        "operationId": "facebookCampaignDraftPushAgentDraft",
        "summary": "Push campaign draft to Meta",
        "description": "Push a saved agent-created Facebook campaign draft to Meta as draft campaigns/ad sets/ads.",
        "tags": [
          "Meta campaign drafts"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:publish"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "draftId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "draftId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/facebookCampaignDraft.pushDraftCampaign": {
      "post": {
        "operationId": "facebookCampaignDraftPushDraftCampaign",
        "summary": "Create Meta draft campaign",
        "description": "Create Meta draft campaigns/ad sets/ads from explicit campaign data, ad sets, ad copy, and image URLs. Supports raw externally-hosted image URLs.",
        "tags": [
          "Meta campaign drafts"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:publish"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connectionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "adAccountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "pageId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "campaign": {
                    "type": "object",
                    "properties": {
                      "countries": {
                        "maxItems": 25,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Z]{2}$"
                        }
                      },
                      "ageMin": {
                        "type": "integer",
                        "minimum": 13,
                        "maximum": 65
                      },
                      "ageMax": {
                        "type": "integer",
                        "minimum": 13,
                        "maximum": 65
                      },
                      "gender": {
                        "type": "string",
                        "enum": [
                          "all",
                          "male",
                          "female"
                        ]
                      },
                      "interests": {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "id",
                            "name"
                          ]
                        }
                      },
                      "cities": {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        }
                      },
                      "regions": {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        }
                      },
                      "audienceId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "attributionSpec": {
                        "minItems": 1,
                        "maxItems": 3,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "eventType": {
                              "type": "string",
                              "minLength": 1
                            },
                            "windowDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 28
                            }
                          },
                          "required": [
                            "eventType",
                            "windowDays"
                          ]
                        }
                      },
                      "advantageAudience": {
                        "anyOf": [
                          {
                            "type": "number",
                            "const": 0
                          },
                          {
                            "type": "number",
                            "const": 1
                          }
                        ]
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      "goal": {
                        "type": "string",
                        "enum": [
                          "engagement",
                          "traffic",
                          "awareness",
                          "video_views",
                          "lead_generation",
                          "conversions",
                          "app_promotion"
                        ]
                      },
                      "budgetAmount": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      },
                      "budgetType": {
                        "type": "string",
                        "enum": [
                          "daily",
                          "lifetime"
                        ]
                      },
                      "currency": {
                        "type": "string",
                        "minLength": 3,
                        "maxLength": 8
                      },
                      "endDate": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                      },
                      "bidStrategy": {
                        "type": "string",
                        "minLength": 1
                      },
                      "bidAmount": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      },
                      "roasAverageFloor": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      },
                      "dsaBeneficiary": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "dsaPayor": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "promotedObject": {
                        "type": "object",
                        "properties": {
                          "pixelId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "customEventType": {
                            "type": "string",
                            "minLength": 1
                          },
                          "pageId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "applicationId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "objectStoreUrl": {
                            "type": "string",
                            "format": "uri"
                          },
                          "customConversionId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "productCatalogId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "productSetId": {
                            "type": "string",
                            "minLength": 1
                          }
                        }
                      }
                    },
                    "required": [
                      "name",
                      "goal"
                    ]
                  },
                  "adSets": {
                    "minItems": 1,
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "countries": {
                          "maxItems": 25,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^[A-Z]{2}$"
                          }
                        },
                        "ageMin": {
                          "type": "integer",
                          "minimum": 13,
                          "maximum": 65
                        },
                        "ageMax": {
                          "type": "integer",
                          "minimum": 13,
                          "maximum": 65
                        },
                        "gender": {
                          "type": "string",
                          "enum": [
                            "all",
                            "male",
                            "female"
                          ]
                        },
                        "interests": {
                          "maxItems": 50,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ]
                          }
                        },
                        "cities": {
                          "maxItems": 50,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          }
                        },
                        "regions": {
                          "maxItems": 50,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          }
                        },
                        "audienceId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "attributionSpec": {
                          "minItems": 1,
                          "maxItems": 3,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "eventType": {
                                "type": "string",
                                "minLength": 1
                              },
                              "windowDays": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 28
                              }
                            },
                            "required": [
                              "eventType",
                              "windowDays"
                            ]
                          }
                        },
                        "advantageAudience": {
                          "anyOf": [
                            {
                              "type": "number",
                              "const": 0
                            },
                            {
                              "type": "number",
                              "const": 1
                            }
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "goal": {
                          "type": "string",
                          "enum": [
                            "engagement",
                            "traffic",
                            "awareness",
                            "video_views",
                            "lead_generation",
                            "conversions",
                            "app_promotion"
                          ]
                        },
                        "budgetAmount": {
                          "type": "number",
                          "exclusiveMinimum": 0
                        },
                        "budgetType": {
                          "type": "string",
                          "enum": [
                            "daily",
                            "lifetime"
                          ]
                        },
                        "endDate": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "bidStrategy": {
                          "type": "string",
                          "minLength": 1
                        },
                        "bidAmount": {
                          "type": "number",
                          "exclusiveMinimum": 0
                        },
                        "roasAverageFloor": {
                          "type": "number",
                          "exclusiveMinimum": 0
                        },
                        "dsaBeneficiary": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "dsaPayor": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "promotedObject": {
                          "type": "object",
                          "properties": {
                            "pixelId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "customEventType": {
                              "type": "string",
                              "minLength": 1
                            },
                            "pageId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "applicationId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "objectStoreUrl": {
                              "type": "string",
                              "format": "uri"
                            },
                            "customConversionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "productCatalogId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "productSetId": {
                              "type": "string",
                              "minLength": 1
                            }
                          }
                        },
                        "ads": {
                          "minItems": 1,
                          "maxItems": 50,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string",
                                "maxLength": 255
                              },
                              "headlines": {
                                "minItems": 1,
                                "maxItems": 5,
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 255
                                }
                              },
                              "primaryTexts": {
                                "minItems": 1,
                                "maxItems": 5,
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 1000
                                }
                              },
                              "descriptions": {
                                "maxItems": 5,
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 255
                                }
                              },
                              "linkUrl": {
                                "type": "string",
                                "format": "uri"
                              },
                              "callToAction": {
                                "type": "string",
                                "enum": [
                                  "LEARN_MORE",
                                  "SHOP_NOW",
                                  "SIGN_UP",
                                  "BOOK_TRAVEL",
                                  "CONTACT_US",
                                  "DOWNLOAD",
                                  "GET_OFFER",
                                  "GET_QUOTE",
                                  "SUBSCRIBE",
                                  "WATCH_MORE",
                                  "REGISTER",
                                  "JOIN",
                                  "ATTEND",
                                  "REQUEST_DEMO",
                                  "VIEW_QUOTE",
                                  "APPLY",
                                  "SEE_MORE",
                                  "BUY_NOW"
                                ]
                              },
                              "imageUrls": {
                                "default": [],
                                "maxItems": 10,
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "format": "uri"
                                }
                              },
                              "video": {
                                "type": "object",
                                "properties": {
                                  "url": {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  "thumbnailUrl": {
                                    "type": "string",
                                    "format": "uri"
                                  }
                                },
                                "required": [
                                  "url"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "headlines",
                              "primaryTexts",
                              "linkUrl",
                              "callToAction"
                            ]
                          }
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "ads"
                      ]
                    }
                  }
                },
                "required": [
                  "connectionId",
                  "adAccountId",
                  "campaign",
                  "adSets"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/zernioAnalytics.accountOverview": {
      "post": {
        "operationId": "zernioAnalyticsAccountOverview",
        "summary": "Get ad account overview",
        "description": "Get total ad-account spend and performance (spend, impressions, clicks, CTR, CPC, conversions, ROAS) for a date range like last_30_days or last_month, with previous-period comparison.",
        "tags": [
          "Meta ad analytics"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connectionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "adAccountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "datePreset": {
                    "type": "string",
                    "enum": [
                      "last_7_days",
                      "last_14_days",
                      "last_30_days",
                      "last_90_days",
                      "this_month",
                      "last_month"
                    ]
                  },
                  "fromDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "toDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "compareToPrevious": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "connectionId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/zernioAnalytics.tree": {
      "post": {
        "operationId": "zernioAnalyticsTree",
        "summary": "Get campaign structure",
        "description": "Get the campaign → ad-set → ad hierarchy for an ad account.",
        "tags": [
          "Meta ad analytics"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connectionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "adAccountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "fromDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "toDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "paused",
                      "pending_review",
                      "rejected",
                      "completed",
                      "cancelled",
                      "error"
                    ]
                  },
                  "sort": {
                    "type": "string",
                    "enum": [
                      "newest",
                      "oldest",
                      "spend_desc",
                      "spend_asc"
                    ]
                  },
                  "page": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "limit": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 100
                  }
                },
                "required": [
                  "connectionId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/zernioAnalytics.timeline": {
      "post": {
        "operationId": "zernioAnalyticsTimeline",
        "summary": "Get performance timeline",
        "description": "Get time-series performance metrics for an ad account.",
        "tags": [
          "Meta ad analytics"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connectionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "adAccountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "fromDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "toDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  }
                },
                "required": [
                  "connectionId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/zernioAnalytics.listCampaigns": {
      "post": {
        "operationId": "zernioAnalyticsListCampaigns",
        "summary": "List campaign performance",
        "description": "List Meta campaigns with rolled-up performance metrics.",
        "tags": [
          "Meta ad analytics"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connectionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "adAccountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "paused",
                      "pending_review",
                      "rejected",
                      "completed",
                      "cancelled",
                      "error"
                    ]
                  },
                  "fromDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "toDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "page": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "limit": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 100
                  },
                  "sort": {
                    "type": "string",
                    "enum": [
                      "newest",
                      "oldest",
                      "spend_desc",
                      "spend_asc"
                    ]
                  }
                },
                "required": [
                  "connectionId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/zernioAnalytics.listAds": {
      "post": {
        "operationId": "zernioAnalyticsListAds",
        "summary": "List ad performance",
        "description": "List Meta ads under a campaign or ad set with performance metrics.",
        "tags": [
          "Meta ad analytics"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connectionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "adAccountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "campaignId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "paused",
                      "pending_review",
                      "rejected",
                      "completed",
                      "cancelled",
                      "error"
                    ]
                  },
                  "page": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "limit": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 100
                  },
                  "sort": {
                    "type": "string",
                    "enum": [
                      "newest",
                      "oldest",
                      "spend_desc",
                      "spend_asc"
                    ]
                  }
                },
                "required": [
                  "connectionId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/zernioAnalytics.getAd": {
      "post": {
        "operationId": "zernioAnalyticsGetAd",
        "summary": "Get Meta ad",
        "description": "Get a single Meta ad's metadata and creative.",
        "tags": [
          "Meta ad analytics"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connectionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "adId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "connectionId",
                  "adId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/zernioAnalytics.getAdAnalytics": {
      "post": {
        "operationId": "zernioAnalyticsGetAdAnalytics",
        "summary": "Get ad daily analytics",
        "description": "Get day-by-day analytics (spend, CTR, CPC, conversions) for a single Meta ad.",
        "tags": [
          "Meta ad analytics"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connectionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "adId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "fromDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "toDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "breakdowns": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "connectionId",
                  "adId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/zernioAnalytics.getAdComments": {
      "post": {
        "operationId": "zernioAnalyticsGetAdComments",
        "summary": "Get ad comments",
        "description": "List public comments on the boosted post behind a Meta ad (Facebook or Instagram placement).",
        "tags": [
          "Meta ad analytics"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "mcp:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connectionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "adId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "placement": {
                    "type": "string",
                    "enum": [
                      "facebook",
                      "instagram"
                    ]
                  },
                  "limit": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 100
                  },
                  "cursor": {
                    "type": "string"
                  }
                },
                "required": [
                  "connectionId",
                  "adId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Ok"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "API key from https://admakeai.com/dashboard/integrations/api."
      },
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key, or an OAuth 2.1 access token (amai_at_…)."
      },
      "oauth2": {
        "type": "oauth2",
        "description": "OAuth 2.1 with PKCE (S256). Register a client at https://admakeai.com/api/oauth/register (RFC 7591) or see https://admakeai.com/.well-known/oauth-authorization-server.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://admakeai.com/oauth/authorize",
            "tokenUrl": "https://admakeai.com/api/oauth/token",
            "refreshUrl": "https://admakeai.com/api/oauth/token",
            "scopes": {
              "mcp:read": "Profile, credit balance, projects, generated ads, and Facebook ad performance.",
              "mcp:write": "Generate ad images, upload source images, and prepare Facebook campaign drafts. Spends credits.",
              "mcp:publish": "Create real ads and campaign drafts in your connected Meta ad account. Launching, pausing, and resuming ads must be done in Meta Ads Manager.",
              "offline_access": "Issue a refresh token."
            }
          }
        }
      }
    },
    "schemas": {
      "ToolResult": {
        "type": "object",
        "required": [
          "ok",
          "tool",
          "data"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "tool": {
            "type": "string",
            "description": "The tool's dotted name."
          },
          "data": {
            "description": "The tool's return value."
          }
        }
      },
      "ToolError": {
        "type": "object",
        "required": [
          "ok",
          "error"
        ],
        "properties": {
          "ok": {
            "const": false
          },
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "examples": [
                  "BAD_REQUEST",
                  "NOT_FOUND"
                ]
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "RequestError": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "Ok": {
        "description": "The tool ran.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ToolResult"
            }
          }
        }
      },
      "BadRequest": {
        "description": "Input failed validation, or the tool rejected it.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ToolError"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing, malformed, expired or revoked credentials.",
        "content": {
          "application/json": {
            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/RequestError"
                },
                {
                  "$ref": "#/components/schemas/ToolError"
                }
              ]
            }
          }
        },
        "headers": {
          "WWW-Authenticate": {
            "description": "Bearer challenge, with the missing scope on insufficient_scope.",
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The OAuth token lacks this tool's scope, or the account may not use it.",
        "content": {
          "application/json": {
            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/RequestError"
                },
                {
                  "$ref": "#/components/schemas/ToolError"
                }
              ]
            }
          }
        },
        "headers": {
          "WWW-Authenticate": {
            "description": "Bearer challenge, with the missing scope on insufficient_scope.",
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "NotFound": {
        "description": "The tool or the record it was asked for does not exist.",
        "content": {
          "application/json": {
            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/RequestError"
                },
                {
                  "$ref": "#/components/schemas/ToolError"
                }
              ]
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Rate or daily generation limit reached.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ToolError"
            }
          }
        }
      },
      "ServerError": {
        "description": "Unexpected server error.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ToolError"
            }
          }
        }
      }
    }
  }
}