{"_id":"5813161622a26a19004afb37","__v":5,"category":{"_id":"564bbc7e8841060d00abb2ee","__v":10,"pages":["564bbf454bf5c80d0020901e","564bc1b08b1c5521002bb914","564c387b9baa330d00faa622","564c3a7b61008d17006ffa3a","564c3e4083b72c2b00b36fb6","564c431b61008d17006ffa46","564c4bc9b9cdb41700a0eae7","564c4e955f9d102b00fc3b4a","564c5f32c241881700d85981","564c68a93eb8f81700838a25"],"project":"54aa7f773b56130b0056c86e","version":"55781fe25129590d003ff4f7","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-11-17T23:47:10.058Z","from_sync":false,"order":1,"slug":"pulsate-cms-api","title":"Pulsate CMS API"},"user":"54aa7f3f9bb00c0b00cb899b","project":"54aa7f773b56130b0056c86e","githubsync":"","parentDoc":null,"version":{"_id":"55781fe25129590d003ff4f7","project":"54aa7f773b56130b0056c86e","forked_from":"54aa7f773b56130b0056c871","__v":6,"createdAt":"2015-06-10T11:30:42.700Z","releaseDate":"2015-06-10T11:30:42.700Z","categories":["55781fe35129590d003ff4f8","55781fe35129590d003ff4f9","55781fe35129590d003ff4fa","55781fe35129590d003ff4fb","55781fe35129590d003ff4fc","55781fe35129590d003ff4fd","55781fe35129590d003ff4fe","564bbc7e8841060d00abb2ee","565b66c446118c0d00dcb0bb","56898269f8dc340d00308c13","582318b23b961a0f009516a1","594a848c9f4771001a43c959"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Developers","version_clean":"2.0.0","version":"2.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-10-28T09:10:46.629Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"name":"","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}","language":"json","status":200}]},"settings":"564bbbf80cbcc91700b8171c","examples":{"codes":[{"language":"shell","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  }'","name":""}]},"method":"put","auth":"required","params":[{"_id":"57ff8296159c7e0e003c4825","ref":"","in":"path","required":true,"desc":"App ID. It can be fetched by using \"Apps: Get All (Index)\" or \"Apps: Get One (Show)\" endpoints.","default":"","type":"string","name":"app_id"},{"_id":"58131d4fc420f70f0086b17c","ref":"","in":"path","required":true,"desc":"Segment ID. It can be fetched using \"Segments: Get All (Index)\" or \"Segments: Get One (Show)\" endpoints.","default":"","type":"string","name":"id:"},{"_id":"564c431b61008d17006ffa47","ref":"","in":"body","required":true,"desc":"Segment to be updated","default":"","type":"object","name":"segment"},{"_id":"5876553536358c0f004bde60","ref":"","in":"body","required":false,"desc":"Name of the segment","default":"","type":"string","name":"segment.name"},{"_id":"5876553536358c0f004bde5f","ref":"","in":"body","required":false,"desc":"Array of groups for segment","default":"","type":"string","name":"segment.groups"},{"_id":"5876553536358c0f004bde5e","ref":"","in":"body","required":false,"desc":"Array of rules for group","default":"","type":"string","name":"segment.groups[].rules"},{"_id":"5876553536358c0f004bde5d","ref":"","in":"body","required":false,"desc":"Type for the rule, use /api/v1/apps/:app_id/segments/rules for available rules types","default":"","type":"string","name":"segment.groups[].rules[].type"},{"_id":"5876553536358c0f004bde5c","ref":"","in":"body","required":false,"desc":"Time frame for the rule, can be one of: ['', 'minutes', 'hours', 'days', 'weeks', 'months', 'years']","default":"","type":"string","name":"segment.groups[].rules[].time_frame"},{"_id":"5876553536358c0f004bde5b","ref":"","in":"body","required":false,"desc":"Match type for the rule, use /api/v1/apps/:app_id/segments/rules for available rules match types","default":"","type":"string","name":"segment.groups[].rules[].match_type"},{"_id":"5876553536358c0f004bde5a","ref":"","in":"body","required":false,"desc":"Match value for the rule","default":"","type":"string","name":"segment.groups[].rules[].match_value"},{"_id":"5876553536358c0f004bde59","ref":"","in":"body","required":false,"desc":"Match end value for the rule. Combined with match_value can be use for \"between\" rule","default":"","type":"string","name":"segment.groups[].rules[].match_end_value"},{"_id":"5876553536358c0f004bde58","ref":"","in":"body","required":false,"desc":"Event resource type for the rule, can be one of: ['', 'beacon', 'geofence']","default":"","type":"string","name":"segment.groups[].rules[].event_resource_type"},{"_id":"5876553536358c0f004bde57","ref":"","in":"body","required":false,"desc":"Event resource for the rule","default":"","type":"object","name":"segment.groups[].rules[].event_resource"},{"_id":"5876553536358c0f004bde56","ref":"","in":"body","required":false,"desc":"Geofence guid for the event resource","default":"","type":"string","name":"segment.groups[].rules[].event_resource.guid"},{"_id":"5876553536358c0f004bde55","ref":"","in":"body","required":false,"desc":"Beacons UUID for the event resource","default":"","type":"string","name":"segment.groups[].rules[].event_resource.guid"},{"_id":"5876553536358c0f004bde54","ref":"","in":"body","required":false,"desc":"Beacons major for the event resource","default":"","type":"string","name":"segment.groups[].rules[].event_resource.major"},{"_id":"5876553536358c0f004bde53","ref":"","in":"body","required":false,"desc":"Beacons minor for the event resource","default":"","type":"string","name":"segment.groups[].rules[].event_resource.minor"},{"_id":"599fe9f95bcba7000f92a922","ref":"","in":"body","required":false,"desc":"Group id, used for targeting groups of resources.","default":"","type":"string","name":"segment.groups[].rules[].event_resource.id"},{"_id":"5876553536358c0f004bde52","ref":"","in":"body","required":false,"desc":"Locations for the rule","default":"","type":"array_object","name":"segment.groups[].rules[].locations"},{"_id":"5876553536358c0f004bde51","ref":"","in":"body","required":false,"desc":"Values for the locations","default":"","type":"array_object","name":"segment.groups[].rules[].locations[].values"},{"_id":"5876553536358c0f004bde50","ref":"","in":"body","required":false,"desc":"Center location of geofence circle as [longitude, latitude]","default":"","type":"array_double","name":"segment.groups[].rules[].locations[].values.center"},{"_id":"5876553536358c0f004bde4f","ref":"","in":"body","required":false,"desc":"Radius for the values in meters","default":"","type":"string","name":"segment.groups[].rules[].locations[].values.radius"},{"_id":"5876553536358c0f004bde4e","ref":"","in":"body","required":false,"desc":"Type of the value, can be one of: ['point']","default":"","type":"string","name":"segment.groups[].rules[].locations[].values.type"}],"url":"/apps/:app_id/segments/:id"},"isReference":true,"order":51,"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]","excerpt":"","slug":"segments-modify","type":"endpoint","title":"Segments: Update One"}

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 }}