{
  "openapi": "3.1.0",
  "info": {
    "title": "Privacyboard agent setup",
    "version": "1.0.0",
    "description": "Lets a coding agent set up the cookie banner, privacy policy and cookie policy of the site it is building, without an account. Send only the site's public address and the project's package names, never environment values, keys or code. Nothing goes live until the site owner opens the claim link, checks the tools found, validates the documents and publishes. Docs: https://privacyboard.io/docs/getting-started/set-up-with-an-ai-agent",
    "contact": {
      "email": "hello@privacyboard.io",
      "url": "https://privacyboard.io/integrations/coding-agents"
    }
  },
  "servers": [
    {
      "url": "https://privacyboard.io"
    }
  ],
  "paths": {
    "/agents/setup": {
      "post": {
        "operationId": "createPrivacySetup",
        "summary": "Create a privacy setup for a website",
        "description": "Returns the banner script and where to place it, the footer links, the vendors recognised from the packages, how to start analytics SDKs after consent, and a claim link for the site owner (valid 14 days). Also available as the create_privacy_setup tool of the MCP server https://privacyboard.io/mcp/vendors.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetupInput"
              },
              "example": {
                "website": "acme.com",
                "name": "Acme",
                "framework": "next",
                "packages": [
                  "stripe",
                  "posthog-js",
                  "@sentry/nextjs"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The setup was created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetupAnswer"
                }
              }
            }
          },
          "400": {
            "description": "A field is missing or not allowed, or the website is not a public address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many setups from this address (10 an hour) or for this site (3 a day). Reuse the claim link you already have.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Setups are paused or unavailable for now. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SetupInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "website"
        ],
        "properties": {
          "website": {
            "type": "string",
            "description": "The site's public address, such as acme.com. Local and IP addresses are refused.",
            "minLength": 4,
            "maxLength": 300
          },
          "name": {
            "type": "string",
            "description": "The company or product name.",
            "maxLength": 200
          },
          "packages": {
            "type": "array",
            "maxItems": 400,
            "items": {
              "type": "string",
              "maxLength": 220
            },
            "description": "Package names from package.json, or from other ecosystems with a prefix: py:openai, rb:stripe, go:\u2026, php:\u2026. Names only."
          },
          "framework": {
            "type": "string",
            "enum": [
              "next",
              "remix",
              "sveltekit",
              "astro",
              "nuxt",
              "html",
              "other"
            ],
            "description": "Decides where the banner script goes."
          },
          "client": {
            "type": "string",
            "description": "The agent or tool making the call, such as claude-code.",
            "maxLength": 120
          }
        }
      },
      "SetupAnswer": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "pending_claim"
          },
          "website": {
            "type": "string"
          },
          "banner": {
            "type": "object",
            "properties": {
              "script": {
                "type": "string"
              },
              "src": {
                "type": "string"
              },
              "install": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "note": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "links": {
            "type": "object",
            "properties": {
              "privacyCenter": {
                "type": "string"
              },
              "privacyPolicy": {
                "type": "string"
              },
              "cookiePolicy": {
                "type": "string"
              },
              "footer": {
                "type": "string"
              }
            }
          },
          "vendorsFound": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "startAfterConsent": {
            "type": "object",
            "properties": {
              "install": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "note": {
                "type": "string"
              }
            }
          },
          "claimUrl": {
            "type": "string",
            "description": "Give it to the site owner: they create a free account, check and publish."
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "whatHappensNext": {
            "type": "string"
          },
          "forTheUser": {
            "type": "string",
            "description": "The sentence to pass on to the site owner."
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        }
      }
    }
  }
}
