POST
/v1/consentRecord consent
Use this when you collect consent outside the built-in Script Tag dialog or need to sync a CMP result into wavebird.
Auth: Secret key, or activation token for browser flows
Request parameters
| Name | Type | Required | Description |
|---|---|---|---|
| client_id | string | Yes | Project identifier. |
| session_id | string | Yes | Publisher session identifier. |
| source | string | Yes | Consent source, such as publisher, cmp, or wavebird. |
| purposes | object | Yes | Purpose-level consent flags. |
Response fields
| Name | Type | Required | Description |
|---|---|---|---|
| ok | boolean | Yes | Whether consent was recorded. |
| consent_id | string | No | Stored consent record identifier. |
| request_id | string | Yes | Support identifier. |
Examples
record-consent.sh
curl -X POST https://api.wavebird.ai/v1/consent \
-H "Authorization: Bearer sk_test_wavebird_demo_secret" \
-H "Content-Type: application/json" \
-d '{
"client_id": "wbproj_demo_8jK42",
"session_id": "sess_demo_123",
"source": "publisher",
"purposes": {
"ads": true,
"measurement": true
}
}'Response example
{
"ok": true,
"consent_id": "consent_demo_123",
"request_id": "req_b0Mf8h"
}Errors
unauthorized401Missing auth.
forbidden403Publishable key origin is not allowed, or raw publishable-key auth was used instead of a browser activation token.
validation_error400Consent purposes are missing or malformed.