vevee.analytics.clearAttribute()DELETE /api/v1/attributes/valuessk_live_pk_live_ only when workspace flag is ON
Remove a previously-set attribute value. Idempotent — clearing an unset attribute returns cleared: false without error. The audit log retains a redacted entry for legal evidence.
Auth gating. Same rules as setAttribute(). Public-key clears only work when the workspace has “Client-side attribute writes” ON in Settings → Security. Default is OFF.
Signature
vevee.analytics.clearAttribute(args: {
distinctId: string;
attribute: string;
}): Promise<{
personId: string;
attribute: string;
cleared: boolean; // false if there was no value to clear
}>Parameters
| Name | Type | Description | |
|---|---|---|---|
distinctId | required | string | Your user’s identifier. |
attribute | required | string | The attribute’s key as declared in the dashboard. |
Returns
cleared is true when a value was found and removed, falsewhen there was nothing to clear. Both are success responses — no exception is thrown for the idempotent case.
Errors
| Code | Status | When |
|---|---|---|
attribute_not_defined | 400 | The key isn’t declared in the dashboard. |
attribute_archived | 400 | The attribute exists but has been archived. |
client_attribute_writes_disabled | 403 | Public-key write attempted but the workspace’s “Client-side attribute writes” flag is OFF. |
Example
const result = await vevee.analytics.clearAttribute({
distinctId: user.id,
attribute: 'persona',
});
if (result.cleared) console.log('value removed');
else console.log('nothing to clear');Related: setAttribute() to set a value, getAttributes() to read current values, and the Attributes guide.