{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/apps/:app_id/segments/:id","auth":"required","params":[{"name":"app_id","type":"string","default":"","desc":"App ID. It can be fetched by using \"Apps: Get All (Index)\" or \"Apps: Get One (Show)\" endpoints.","required":true,"in":"path","ref":"","_id":"57ff8296159c7e0e003c4825"},{"name":"id:","type":"string","default":"","desc":"Segment ID. It can be fetched using \"Segments: Get All (Index)\" or \"Segments: Get One (Show)\" endpoints.","required":true,"in":"path","ref":"","_id":"58131d4fc420f70f0086b17c"},{"name":"segment","type":"object","default":"","desc":"Segment to be updated","required":true,"in":"body","ref":"","_id":"564c431b61008d17006ffa47"},{"name":"segment.name","type":"string","default":"","desc":"Name of the segment","required":false,"in":"body","ref":"","_id":"5876553536358c0f004bde60"},{"name":"segment.groups","type":"string","default":"","desc":"Array of groups for segment","required":false,"in":"body","ref":"","_id":"5876553536358c0f004bde5f"},{"name":"segment.groups[].rules","type":"string","default":"","desc":"Array of rules for group","required":false,"in":"body","ref":"","_id":"5876553536358c0f004bde5e"},{"name":"segment.groups[].rules[].type","type":"string","default":"","desc":"Type for the rule, use /api/v1/apps/:app_id/segments/rules for available rules types","required":false,"in":"body","ref":"","_id":"5876553536358c0f004bde5d"},{"name":"segment.groups[].rules[].time_frame","type":"string","default":"","desc":"Time frame for the rule, can be one of: ['', 'minutes', 'hours', 'days', 'weeks', 'months', 'years']","required":false,"in":"body","ref":"","_id":"5876553536358c0f004bde5c"},{"name":"segment.groups[].rules[].match_type","type":"string","default":"","desc":"Match type for the rule, use /api/v1/apps/:app_id/segments/rules for available rules match types","required":false,"in":"body","ref":"","_id":"5876553536358c0f004bde5b"},{"name":"segment.groups[].rules[].match_value","type":"string","default":"","desc":"Match value for the rule","required":false,"in":"body","ref":"","_id":"5876553536358c0f004bde5a"},{"name":"segment.groups[].rules[].match_end_value","type":"string","default":"","desc":"Match end value for the rule. Combined with match_value can be use for \"between\" rule","required":false,"in":"body","ref":"","_id":"5876553536358c0f004bde59"},{"name":"segment.groups[].rules[].event_resource_type","type":"string","default":"","desc":"Event resource type for the rule, can be one of: ['', 'beacon', 'geofence']","required":false,"in":"body","ref":"","_id":"5876553536358c0f004bde58"},{"name":"segment.groups[].rules[].event_resource","type":"object","default":"","desc":"Event resource for the rule","required":false,"in":"body","ref":"","_id":"5876553536358c0f004bde57"},{"name":"segment.groups[].rules[].event_resource.guid","type":"string","default":"","desc":"Geofence guid for the event resource","required":false,"in":"body","ref":"","_id":"5876553536358c0f004bde56"},{"name":"segment.groups[].rules[].event_resource.guid","type":"string","default":"","desc":"Beacons UUID for the event resource","required":false,"in":"body","ref":"","_id":"5876553536358c0f004bde55"},{"name":"segment.groups[].rules[].event_resource.major","type":"string","default":"","desc":"Beacons major for the event resource","required":false,"in":"body","ref":"","_id":"5876553536358c0f004bde54"},{"name":"segment.groups[].rules[].event_resource.minor","type":"string","default":"","desc":"Beacons minor for the event resource","required":false,"in":"body","ref":"","_id":"5876553536358c0f004bde53"},{"name":"segment.groups[].rules[].event_resource.id","type":"string","default":"","desc":"Group id, used for targeting groups of resources.","required":false,"in":"body","ref":"","_id":"599fe9f95bcba7000f92a922"},{"name":"segment.groups[].rules[].locations","type":"array_object","default":"","desc":"Locations for the rule","required":false,"in":"body","ref":"","_id":"5876553536358c0f004bde52"},{"name":"segment.groups[].rules[].locations[].values","type":"array_object","default":"","desc":"Values for the locations","required":false,"in":"body","ref":"","_id":"5876553536358c0f004bde51"},{"name":"segment.groups[].rules[].locations[].values.center","type":"array_double","default":"","desc":"Center location of geofence circle as [longitude, latitude]","required":false,"in":"body","ref":"","_id":"5876553536358c0f004bde50"},{"name":"segment.groups[].rules[].locations[].values.radius","type":"string","default":"","desc":"Radius for the values in meters","required":false,"in":"body","ref":"","_id":"5876553536358c0f004bde4f"},{"name":"segment.groups[].rules[].locations[].values.type","type":"string","default":"","desc":"Type of the value, can be one of: ['point']","required":false,"in":"body","ref":"","_id":"5876553536358c0f004bde4e"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"hidden\": true,\n  \"hidden_at\": \"2016-10-17T16:08:55+00:00\",\n  \"name\": \"new_segment_name\",\n  \"id\": \"segment_id\",\n  \"users_count\": 0,\n  \"groups\": [\n    {\n      \"join_type\": \"+\",\n      \"rules\": [\n        {\n          \"time_frame\": \"\",\n          \"match_value_type\": \"\",\n          \"match_type\": \"less\",\n          \"match_value\": \"123\",\n          \"match_end_value\": \"\",\n          \"event_resource_type\": \"Mobile::App::Geofence\",\n          \"event_resource_id\": \"geofence_id\",\n          \"in_app_event_name\": \"\",\n          \"type\": \"number_of_visits\",\n          \"locations\": null\n        }\n      ]\n    }\n  ]\n}","name":""}]},"settings":"564bbbf80cbcc91700b8171c","examples":{"codes":[{"name":"","code":"curl -X PUT \"https://control.pulsatehq.com/api/v1/apps/$APP_ID/segments/$ID\"\n  -H \"Authorization: Token token=$MY_ADMIN_API_TOKEN\"\n  -d '{\n      \"segment\": {\n          \"name\": \"new_segment_name\",\n          \"groups\": [\n              {\n                  \"rules\": [\n                      {\n                        \"time_frame\": \"\",\n                        \"match_type\": \"less\",\n                        \"match_value\": \"123\",\n                        \"match_end_value\": \"\",\n                        \"event_resource_type\": \"geofence\",\n                        \"event_resource\": {\n                          \"guid\": \"geofence_guid\"\n                        },\n                        \"type\": \"number_of_visits\"\n                      }\n                  ]\n              }\n          ]\n      }\n  }'","language":"shell"}]},"method":"put"},"next":{"description":"","pages":[]},"title":"Segments: Update One","type":"endpoint","slug":"segments-modify","excerpt":"","body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Please Note\",\n  \"body\": \"If you place a [:segment][:groups] parameter then all existing groups will be replaced with the parameter that you placed.\"\n}\n[/block]","updates":[],"order":55,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5e4fced159815700262d28f9","__v":5,"category":{"sync":{"isSync":false,"url":""},"pages":["5e4fced159815700262d28c6","5e4fced159815700262d28c7","5e4fced159815700262d28c8","5e4fced159815700262d28c9","5e4fced159815700262d28ca","5e4fced159815700262d28cb","5e4fced159815700262d28cc","5e4fced159815700262d28cd","5e4fced159815700262d28ce","564c68a93eb8f81700838a25"],"title":"Pulsate CMS API","slug":"pulsate-cms-api","order":1,"from_sync":false,"reference":true,"_id":"5e4fced159815700262d289e","__v":10,"createdAt":"2015-11-17T23:47:10.058Z","project":"54aa7f773b56130b0056c86e","version":"5e4fced159815700262d2930"},"createdAt":"2016-10-28T09:10:46.629Z","user":"54aa7f3f9bb00c0b00cb899b","project":"54aa7f773b56130b0056c86e","githubsync":"","parentDoc":null,"version":{"version":"2.2","version_clean":"2.2.0","codename":"CMS API","is_stable":false,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5e4fced159815700262d2899","55781fe35129590d003ff4f9","55781fe35129590d003ff4fa","5e4fced159815700262d289a","5e4fced159815700262d289b","5e4fced159815700262d289c","5e4fced159815700262d289d","5e4fced159815700262d289e","565b66c446118c0d00dcb0bb","56898269f8dc340d00308c13","5e4fced159815700262d289f","5e4fced159815700262d28a0","5c73dd27e8fdc000572a206a","5e4fced159815700262d28a1","5e53c04c1d11110018b56e12"],"_id":"5e4fced159815700262d2930","project":"54aa7f773b56130b0056c86e","forked_from":"55781fe25129590d003ff4f7","__v":1,"createdAt":"2015-06-10T11:30:42.700Z","releaseDate":"2015-06-10T11:30:42.700Z"}}

putSegments: Update One


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

app_id:
required
string
App ID. It can be fetched by using "Apps: Get All (Index)" or "Apps: Get One (Show)" endpoints.
id:
required
string
Segment ID. It can be fetched using "Segments: Get All (Index)" or "Segments: Get One (Show)" endpoints.

Body Params

segment:
required
object
Segment to be updated
segment.name:
string
Name of the segment
segment.groups:
string
Array of groups for segment
segment.groups[].rules:
string
Array of rules for group
segment.groups[].rules[].type:
string
Type for the rule, use /api/v1/apps/:app_id/segments/rules for available rules types
segment.groups[].rules[].time_frame:
string
Time frame for the rule, can be one of: ['', 'minutes', 'hours', 'days', 'weeks', 'months', 'years']
segment.groups[].rules[].match_type:
string
Match type for the rule, use /api/v1/apps/:app_id/segments/rules for available rules match types
segment.groups[].rules[].match_value:
string
Match value for the rule
segment.groups[].rules[].match_end_value:
string
Match end value for the rule. Combined with match_value can be use for "between" rule
segment.groups[].rules[].event_resource_type:
string
Event resource type for the rule, can be one of: ['', 'beacon', 'geofence']
segment.groups[].rules[].event_resource:
object
Event resource for the rule
segment.groups[].rules[].event_resource.guid:
string
Geofence guid for the event resource
segment.groups[].rules[].event_resource.guid:
string
Beacons UUID for the event resource
segment.groups[].rules[].event_resource.major:
string
Beacons major for the event resource
segment.groups[].rules[].event_resource.minor:
string
Beacons minor for the event resource
segment.groups[].rules[].event_resource.id:
string
Group id, used for targeting groups of resources.
segment.groups[].rules[].locations:
array of objects
Locations for the rule
segment.groups[].rules[].locations[].values:
array of objects
Values for the locations
segment.groups[].rules[].locations[].values.center:
array of doubles
Center location of geofence circle as [longitude, latitude]
segment.groups[].rules[].locations[].values.radius:
string
Radius for the values in meters
segment.groups[].rules[].locations[].values.type:
string
Type of the value, can be one of: ['point']

Examples


Result Format


Documentation

[block:callout] { "type": "warning", "title": "Please Note", "body": "If you place a [:segment][:groups] parameter then all existing groups will be replaced with the parameter that you placed." } [/block]

User Information

Try It Out

put
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}