Segments

GET https://webpushke.com/api/segments/
curl --request GET \
--url 'https://webpushke.com/api/segments/' \
--header 'Authorization: Bearer {api_key}' \
Paramètres Détails Description
page Optional Entier The page number that you want results from. Defaults to 1.
results_per_page Optional Entier How many results you want per page. Allowed values are: 10 , 25 , 50 , 100 , 250 , 500 , 1000. Defaults to 25.
{ "data": [ { "id": 1, "user_id": 1, "website_id": 1, "name": "API Sample", "settings": { "subscribers_ids": [1,2,3,4,5] }, "type": "custom", "total_subscribers": 5, "last_datetime": null, "datetime": "2025-04-04 18:28:09" } ], "meta": { "page": 1, "results_per_page": 25, "total": 1, "total_pages": 1 }, "links": { "first": "https://webpushke.com/api/segments?&page=1", "last": "https://webpushke.com/api/segments?&page=1", "next": null, "prev": null, "self": "https://webpushke.com/api/segments?&page=1" } }
GET https://webpushke.com/api/segments/{segment_id}
curl --request GET \
--url 'https://webpushke.com/api/segments/{segment_id}' \
--header 'Authorization: Bearer {api_key}' \
{ "data": { "id": 1, "user_id": 1, "website_id": 1, "name": "API Sample", "settings": { "subscribers_ids": [1,2,3,4,5] }, "type": "filter", "total_subscribers": 5, "last_datetime": null, "datetime": "2025-04-04 18:28:09" } }
POST https://webpushke.com/api/segments
Paramètres Détails Description
website_id Requis Entier -
name Requis Chaîne -
type Optional Chaîne Allowed values: custom , filter
subscribers_ids Optional Chaîne Available when: segment = custom
filters_custom_parameter_key[index] Optional Chaîne Available when: segment = filter
filters_custom_parameter_value[index] Optional Chaîne Available when: segment = filter
filters_custom_parameter_value[index] Optional Chaîne Available when: segment = filter
filters_subscribed_on_url Optional Chaîne Available when: segment = filter
filters_cities Optional Chaîne Available when: segment = filter
filters_countries[] Optional Chaîne Available when: segment = filter
filters_continents[] Optional Chaîne Available when: segment = filter
filters_device_type[] Optional Chaîne Available when: segment = filter
filters_languages[] Optional Chaîne Available when: segment = filter
filters_operating_systems[] Optional Chaîne Available when: segment = filter
filters_browsers[] Optional Chaîne Available when: segment = filter
curl --request POST \
--url 'https://webpushke.com/api/segments' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example name' \
--form 'website_id=1' \
--form 'type=custom' \
--form 'subscribers_ids=1,2,3,4,5' \
{ "data": { "id": 1 } }
POST https://webpushke.com/api/segments/{segment_id}
Paramètres Détails Description
website_id Optional Entier -
name Optional Chaîne -
type Optional Chaîne Allowed values: custom , filter
subscribers_ids Optional Chaîne Available when: segment = custom
filters_custom_parameter_key[index] Optional Chaîne Available when: segment = filter
filters_custom_parameter_value[index] Optional Chaîne Available when: segment = filter
filters_custom_parameter_value[index] Optional Chaîne Available when: segment = filter
filters_subscribed_on_url Optional Chaîne Available when: segment = filter
filters_cities Optional Chaîne Available when: segment = filter
filters_countries[] Optional Chaîne Available when: segment = filter
filters_continents[] Optional Chaîne Available when: segment = filter
filters_device_type[] Optional Chaîne Available when: segment = filter
filters_languages[] Optional Chaîne Available when: segment = filter
filters_operating_systems[] Optional Chaîne Available when: segment = filter
filters_browsers[] Optional Chaîne Available when: segment = filter
curl --request POST \
--url 'https://webpushke.com/api/segments/{segment_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example name' \
--form 'website_id=1' \
--form 'type=custom' \
--form 'subscribers_ids=1,2,3,4,5' \
{ "data": { "id": 1 } }
DELETE https://webpushke.com/api/segments/{segment_id}
curl --request DELETE \
--url 'https://webpushke.com/api/segments/{segment_id}' \
--header 'Authorization: Bearer {api_key}' \