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.
Request parameters
| Name | Type | Required | Description |
|---|---|---|---|
| client_id | string | Required | Project identifier. |
| session_id | string | Required | Publisher session identifier. |
| source | string | Required | Consent source, such as publisher, cmp, or wavebird. |
| purposes | object | Required | Purpose-level consent flags. |
Returns
| Name | Type | Description |
|---|---|---|
| ok | boolean | Whether consent was recorded. |
| consent_id | string | Stored consent record identifier. |
| request_id | string | Support identifier. |
Request example
POST /v1/consent
record-consent.shbash
1curl -X POST https://api.wavebird.ai/v1/consent \2 -H "Authorization: Bearer sk_test_wavebird_demo_secret" \3 -H "Content-Type: application/json" \4 -d '{5 "client_id": "wbproj_demo_8jK42",6 "session_id": "sess_demo_123",7 "source": "publisher",8 "purposes": {9 "ads": true,10 "measurement": true11 }12 }'Response example
Response
response.jsonjson
1{2 "ok": true,3 "consent_id": "consent_demo_123",4 "request_id": "req_b0Mf8h"5}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.