POST/v1/consent

Record consent

Use this when you collect consent outside the built-in Script Tag dialog or need to sync a CMP result into wavebird.

Secret key requiredSecret key, or activation token for browser flowsSandbox this

Request parameters

NameTypeRequiredDescription
client_idstringRequiredProject identifier.
session_idstringRequiredPublisher session identifier.
sourcestringRequiredConsent source, such as publisher, cmp, or wavebird.
purposesobjectRequiredPurpose-level consent flags.

Returns

NameTypeDescription
okbooleanWhether consent was recorded.
consent_idstringStored consent record identifier.
request_idstringSupport 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

unauthorized401

Missing auth.

forbidden403

Publishable key origin is not allowed, or raw publishable-key auth was used instead of a browser activation token.

validation_error400

Consent purposes are missing or malformed.

Related

Need rollout review?

Start with the Server API. Use contact only when you need rollout review, enterprise coordination, or non-standard integration help.