Update an existing segment’s name and/or filters. The name parameter is always required. When filters are provided, all existing filters are replaced with the new ones.
name parameter is always required, even if you’re not changing it. When filters are provided, all existing filters are replaced with the new ones. Omit the filters parameter to keep existing filters intact. The filters array cannot be empty—if provided, it must contain at least one filter.name (required) and filters:
tag - Filter by user tagslast_session - Filter by last active timefirst_session - Filter by first session timesession_count - Filter by number of sessionssession_time - Filter by total usage durationlanguage - Filter by user languageapp_version - Filter by app versionlocation - Filter by GPS coordinatescountry - Filter by countryAND and OR operators to combine filters:
| Status Code | Description |
|---|---|
| 400 | Bad request - Invalid filters, duplicate segment name, or segment used by active Journey |
| 403 | Forbidden - API not available for your plan |
| 404 | Not found - Segment does not exist |
| 429 | Rate limit exceeded |
Your OneSignal App ID in UUID v4 format. See Keys & IDs.
The segment_id can be found in the URL of the segment when viewing it in the dashboard.
Required. The segment name. Maximum 128 characters.
Optional. When provided, replaces all existing filters. Filters define the segment based on user properties like tags, activity, or location using flexible AND/OR logic. Limited to 200 total entries, including fields and OR operators. See Create segment for filter syntax.
1 - 200 elementsRequired. The filter object.