<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
# Consent Management Platforms — API Reference

## Audit CMP

```bash
node scripts/agent.js --action audit --url https://example.com
```

## Validate TCF String

```bash
node scripts/agent.js --action validate-tcf --tc-string "CPyxRfAPyxRfA..."
```

## Check Consent Propagation

```bash
node scripts/agent.js --action check-propagation --url https://example.com
```

## Generate Consent Receipt

```bash
node scripts/agent.js --action generate-receipt --subject "user@example.com" --purposes "1,2,7"
```

## CMP Audit Checks

| ID | Check | Regulation |
|----|-------|------------|
| CMP-01 | Banner loads before non-essential cookies | ePrivacy Art. 5(3) |
| CMP-02 | Granular purpose selection available | GDPR Art. 7(1) |
| CMP-03 | No pre-checked consent boxes | GDPR Recital 32 |
| CMP-04 | Reject-all option equally prominent | EDPB Guidelines 05/2020 |
| CMP-05 | Consent withdrawal accessible | GDPR Art. 7(3) |
| CMP-06 | Consent receipt stored with timestamp | GDPR Art. 5(2) |
| CMP-07 | TC String properly encoded | IAB TCF v2.2 |
| CMP-08 | Vendor list matches declared processors | GDPR Art. 28 |

## Output Format

```json
{
  "tool": "cmp-auditor",
  "action": "audit",
  "url": "https://example.com",
  "total_checks": 8,
  "findings": [...]
}
```
