vevee.analytics.getAttributes()GET /api/v1/attributes/valuessk_live_pk_live_
Read a person’s current attribute values. Returns only attributes that have been set — unset attributes are absent (not null). Pass keys to filter the response.
Signature
vevee.analytics.getAttributes(args: {
distinctId: string;
keys?: string[]; // optional - return only these keys
}): Promise<{
personId: string;
attributes: Record<string, string | number | boolean | string[]>;
}>Parameters
| Name | Type | Description | |
|---|---|---|---|
distinctId | required | string | Your user’s identifier. |
keys | optional | string[] | If provided, the response includes only these attribute keys. Useful when you need one or two fields and don’t want to transfer the full profile. |
Examples
Read all set attributes:
const { attributes } = await vevee.analytics.getAttributes({ distinctId: user.id });
// attributes === { persona: 'teacher', goal: 'lesson_planning' }Read a subset:
const { attributes } = await vevee.analytics.getAttributes({
distinctId: user.id,
keys: ['persona'],
});
// attributes === { persona: 'teacher' } (goal omitted)Errors
| Code | Status | When |
|---|---|---|
invalid_key | 401 | Bad or revoked API key. |
invalid_request | 400 | Missing or empty distinctId. |
Gotchas
- The dashboard’s schema (the list of declared attributes) is not returned by this call — only the values for this specific person. To inspect the schema, use the Attributes section in the dashboard.
- Archived attributes are filtered out of the response even if a value was previously written. The value still exists in storage; it reappears if the attribute is unarchived.
- A person who has never had any attributes set returns an empty
attributesobject ({}), not a 404.
Related: setAttribute() to set one value, setAttributes() for bulk writes, clearAttribute() to remove a value, and the Attributes guide.