im trying to update a property from a group id, can I directly update with a webhook to point directly to the group id? does it have a distinct id as the users?
Hi Juan I., Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> 👋
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
Yes, you can update group profile properties directly using Mixpanel's API. Group profiles are similar to user profiles but are identified differently.
For group profiles:
- Instead of distinct_id (which is used for users), groups are identified by a combination of group_key and group_id
- The group_key is the event property that connects event data to a group (e.g., "company")
- The group_id is the specific identifier for a group (e.g., "mixpanel", "company_a")
To update a group property via a webhook or API call, you would need to make a request to the /groups API endpoint. The request should include the $token, $group_key, $group_id, and the properties you want to set in the $set operation.
Here's an example of what the JSON payload would look like:
```
{ "$token": "YOUR_PROJECT_TOKEN", "$group_key": "company", "$group_id": "mixpanel", "$set": { "Industry": "Analytics", "Name": "Mixpanel" } }
LBKSThis is different from user profiles which use `distinct_id` as their primary identifier. Group profiles have their own separate identification system using the `group_key` and `group_id` pair.
[Mixpanel SDKs: Javascript](https://docs.mixpanel.com/docs/tracking-methods/sdks/javascript#setting-group-profile-properties) provides more details on setting group profile properties.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
