Sync mixpanel cohort
const url = 'https://api.foldspace.ai/v1/mixpanel/cohort/sync';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"action":"members","parameters":{"mixpanel_project_id":"1234567","mixpanel_cohort_name":"Last seen in the past week","mixpanel_cohort_id":"1234567","mixpanel_cohort_description":"Users who have been seen in the past week","mixpanel_session_id":"example","page_info":{"total_pages":100,"page_count":1},"members":{"customProperties":{"additionalProperty":{}},"email":"user@company.com","mixpanel_distinct_id":"abcdef123456","first_name":"John","last_name":"Doe","phone_number":"+1234567890"}}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.foldspace.ai/v1/mixpanel/cohort/sync \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "action": "members", "parameters": { "mixpanel_project_id": "1234567", "mixpanel_cohort_name": "Last seen in the past week", "mixpanel_cohort_id": "1234567", "mixpanel_cohort_description": "Users who have been seen in the past week", "mixpanel_session_id": "example", "page_info": { "total_pages": 100, "page_count": 1 }, "members": { "customProperties": { "additionalProperty": {} }, "email": "user@company.com", "mixpanel_distinct_id": "abcdef123456", "first_name": "John", "last_name": "Doe", "phone_number": "+1234567890" } } }'Endpoint that supports mixpanel Cohort Sync webhook. Segments and user that does not exist in Foldspace will be created. See https://docs.mixpanel.com/docs/cohort-sync/webhooks for more details
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”DTO for Mixpanel cohort sync body as per https://docs.mixpanel.com/docs/cohort-sync/webhooks
object
Mixpanel cohort action
Example
membersDTO for Mixpanel cohort parameters as per https://docs.mixpanel.com/docs/cohort-sync/webhooks
object
The project ID of the Mixpanel project
Example
1234567The name of the Mixpanel cohort
Example
Last seen in the past weekThe ID of the Mixpanel cohort
Example
1234567The description of the Mixpanel cohort
Example
Users who have been seen in the past weekThe session ID of the Mixpanel session
DTO for Mixpanel page info
object
The number of total messages for the given session ID
Example
100The index of which page this message is
Example
1DTO for Mixpanel member
object
object
object
The email of the Mixpanel member
Example
user@company.comThe distinct ID of the Mixpanel member
Example
abcdef123456The first name of the Mixpanel member
Example
JohnThe last name of the Mixpanel member
Example
DoeThe phone number of the Mixpanel member
Example
+1234567890Responses
Section titled “ Responses ”Cohort sync successful
Example
{ "action": "members", "status": "success"}Unauthorized
Example
Missing API keyRate limit exceeded for subscription
Example
Rate limit exceeded for subscriptionInternal server error
Example
{ "action": "members", "status": "failure", "error": { "message": "Internal server error", "code": 500}