X

Create a filter selection

Creates an auto filter for a group.


[POST] https://api-us1.stannp.com/v1/selections/new

Parameters

group_id int Mandatory. The ID of the group to associate this selection with.
name string Name your filter.
filters string A specially formatted string to represent your filters. eg:

total_spent:::more_than:::300

The format is based on the following:
[column_name]:::[string_operator]:::[value]

The string operators available are: matches, contains, begins, ends, before, after, less_than, more_than, is_not.

You can chain multiple filters together like this:
total_spent:::more_than:::300:::AND:::country:::matches:::GB

Request

                import requests

data = {
    "group_id": "1",\n    "name": "update",\n    "filters": "Steve",\n
}

response = requests.post("https://api-us1.stannp.com/v1/selections/new?api_key={API_KEY}", data=data)
print(response.text)
            

Response

{
    "success": true,
    "data": [
        {
            "id": "1234"
        }
    ]
}