Segment Update

Update A segment.

# You can upsert (insert if new, update if exists)
# by POSTing to api and the ALIAS will be used to lookup
# the existing one and update it.
curl -s -XPOST "https://api.lytics.io/api/segment" \
    -H "Content-type: text/plain" \
    -H "Authorization: $LIOKEY" \
    -d'

FILTER AND (
    visits > 5,
    last_visit >= "now-30d",
    scores.momentum >  10
)
ALIAS our_test_activelist

' | jq '.'


# Json Api Allows a few more fields such as description
curl -s -XPUT "https://api.lytics.io/api/segment/123456id" \
    -H "Authorization: $LIOKEY" \
    -H "Content-type: application/json" \
    -d'
{
    "name":"Most Active Users",
    "segment_ql": "FILTER AND (visits > 5,last_visit >= \"now-30d\", scores.momentum >  10)",
    "slug_name":"our_test_activelist",
    "is_public": true,
    "description":"a description of what this is for"
}
' | jq '.'

Language
Authorization
Header
Click Try It! to start a request and see the response here!