Is there way to programmatically create a behavioral cohort via some API endpoint?
I have used the Dashboard REST API to build some custom event charts for some of my use cases, but was curious to know if we can input some basic parameters and clauses in a similar way to create cohorts as well.
Thanks!
Page 1 / 1
Hello Saish!
Amplitude offers the Behavioral Cohorts API. With this API you can create cohorts and/or add users to already existing cohorts.
The documentation is in the developers center, here.
Hi @eddie.gaona , Thanks for your response. Most of the references in the doc are for listing all the existing cohorts , fetching a single cohort and refreshing a cohort/uploading IDs.
I’m not able to find any end point in there using which I can create and save a cohort by supplying some parameters as in below :
Hello @Saish Redkar !
The Behavioral Cohort API will let you create a new cohort. However, the API does not let you define parameters such as the screenshot you shared.
You can only upload the users by Amplitude ID or User ID:
Above I am creating a new cohort and including the user with the User ID set to “Eddie Gaona”. There are not APIs currently that will let you create cohorts by parameters.
Thanks for the clarification @eddie.gaona ! So the above snippet mimics the “Import Cohort from File” functionality , correct?
Hello @Saish Redkar !
Yes, the snippet would mimic the “Import Cohort from File” functionality.
If you don't have an Amplitude account, you can create an Amplitude Starter account for free and enjoy direct access to the Community via SSO. Create an Amplitude account. You can also create a Guest account below!
If you're a current customer, select the domain you use to sign in with Amplitude.
If you don't have an Amplitude account, you can create an Amplitude Starter account for free and enjoy direct access to the Community via SSO. Create an Amplitude account. Want to sign up as a guest? Create a Community account.
If you're a current customer, select the domain you use to sign in with Amplitude.