Get current consent information for a specified customer. This is a definition of the Customer attributes method used to retrieve customer consents.

Use when you want to retrieve consent status and consent information about a specified customer. You need to have an explicit list of consent category names of which you want to retrieve the status.

Customer consents API is not used to track consents. If you want to learn how consents are tracked, please visit our Tracking consent article.

Authorization

Available access type

Permissions needed

Private access

Events > "consent" Get

Attributes object definition for Customer consents

Each consent attribute object in the Customer attributes method must have type, category, and mode properties.

Parameter

Value

type

"consent"

category

The category name of the consent you want to retrieve.

mode

What information about the consent should be fetched.

message - Returns a value from the message attribute for the last consent event category.
source - Returns a source for the last consent event.
timestamp - Returns a timestamp for the last consent event as a UNIX time.
valid - Default value. Returns whether consent is valid or not (true/false).
until - Returns a value from valid_until attribute for the last consent event.

Payload example

{
    "customer_ids": {
        "registered": "[email protected]"
    },
    "attributes": [
        {
            "type": "consent",
            "category": "newsletter",
            "mode": "valid"
        },
        {
            "type": "consent",
            "category": "newsletter",
            "mode": "message"
        },
        {
            "type": "consent",
            "category": "newsletter",
            "mode": "timestamp"
        },
        {
            "type": "consent",
            "category": "newsletter",
            "mode": "until"
        }
    ]
}
{
    "results": [
        {
            "success": true,
            "value": false
        },
        {
            "success": true,
            "value": null
        },
        {
            "success": true,
            "value": null
        },
        {
            "success": true,
            "value": null
        }
    ],
    "success": true
}
{
    "results": [
        {
            "error": "No permission",
            "success": false
        }
    ],
    "success": true
}