{"openapi":"3.1.0","info":{"title":"Consentio API","version":"1.0.0","description":"Public API of Consentio, a cookie consent manager (CMP) with GDPR script blocking and Google Consent Mode v2. Free plans get a limited key (create/list your site, install check, health); consents and the rest need Pro or Agency. Create an API key in the dashboard (Panel → API) and send it as a Bearer token. A remote MCP server with the same capabilities is available at /api/mcp.","contact":{"name":"Consentio","url":"https://getconsentio.com"}},"servers":[{"url":"https://getconsentio.com/api/v1"}],"security":[{"bearerAuth":[]}],"paths":{"/sites":{"get":{"operationId":"listSites","summary":"List your sites","responses":{"200":{"description":"Sites of the authenticated user.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Site"}}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The plan does not include API access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (120 requests/minute).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createSite","summary":"Create a site","description":"Creates a site and returns its publicKey (the value for data-site-key in the script snippet). Respects the plan's site limit.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","domain"],"properties":{"name":{"type":"string","minLength":1,"maxLength":60},"domain":{"type":"string","minLength":3,"maxLength":120,"description":"Domain, with or without https:// (it is normalized)."}}}}}},"responses":{"201":{"description":"Site created.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreatedSite"}}}}}},"400":{"description":"Invalid input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan site limit reached or no API access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sites/{id}/consents":{"get":{"operationId":"listConsents","summary":"List a site's consent records (Pro and Agency only)","parameters":[{"name":"id","in":"path","required":true,"description":"Site id (the `id` field returned by GET /sites).","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"includeTest","in":"query","description":"Set to 1 to include sandbox (test) consents. Excluded by default.","schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"Paginated consent records (JSON)."},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Site not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sites/{id}/health":{"get":{"operationId":"getSiteHealth","summary":"Site health, uptime and badge","parameters":[{"name":"id","in":"path","required":true,"description":"Site id (the `id` field returned by GET /sites).","schema":{"type":"string"}}],"responses":{"200":{"description":"Health level, score and uptime."},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Site not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sites/{id}/install-check":{"post":{"operationId":"checkInstall","summary":"Re-check whether the Consentio snippet is installed","description":"Fetches the site and looks for the script with the matching site key. Limited to 30 requests/minute.","parameters":[{"name":"id","in":"path","required":true,"description":"Site id (the `id` field returned by GET /sites).","schema":{"type":"string"}}],"responses":{"200":{"description":"Install status.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InstallCheck"}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Site not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key from the dashboard, format csk_live_…"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},"Site":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"publicKey":{"type":"string","description":"Value for data-site-key."},"consents":{"type":"integer","description":"Real (non-sandbox) consent records."},"installOk":{"type":"boolean"},"installCheckedAt":{"type":["string","null"],"format":"date-time"},"scannedAt":{"type":["string","null"],"format":"date-time"},"detectedPlatform":{"type":["string","null"]},"health":{"type":"string"},"healthScore":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"}}},"CreatedSite":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"publicKey":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"InstallCheck":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"},"ok":{"type":"boolean"},"reachable":{"type":"boolean"},"consentioDetected":{"type":"boolean"},"siteKeyMatch":{"type":["boolean","null"]},"platform":{"type":["string","null"]},"health":{"type":"string"},"healthScore":{"type":"integer"},"checkedAt":{"type":"string","format":"date-time"}}}}}}