Forum Discussion
API to create/update Segments
We have this same issue, as we have a segment that needs to have it's criteria changed at midnight every quarter. Real pain for whoever draws the short straw on NYE, you know?
So far, there's only one way I've found to successfully update a segment by api, and it's pretty clunky:
I used to use this back in the day with SFMC, but the Braze endpoints are a little more finicky:
If you use inspect mode in your browser, while on the network tab you save an update to the segment in question. From the network tab you'll be able to copy the actual request to Braze that includes your users authentication.
You can import that into postman, curl etc and modify as you see fit. It should work until your user auth tokens expire.
Note: There are a ton of problems with this: It basically tricks Braze into thinking you're in your browser and clicking the buttons, so of course permissions are only scoped to that user, there are issues with how you authenticate users (SSO, IP whitelisting etc), issues if they ever change anything in the format of the api call etc. This basically works when you know you have one specific thing to do later this evening... But it DOES work.
Related Content
- 11 months ago