Segments
GET https://app.pusherstudio.com/api/segments/
curl --request GET \
--url 'https://app.pusherstudio.com/api/segments/' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://app.pusherstudio.com/api/segments/' \
--header 'Authorization: Bearer {api_key}' \
Parameters | Details | Description |
---|---|---|
page | Optional Integer | The page number that you want results from. Defaults to 1 . |
results_per_page | Optional Integer | 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": "2024-08-09 03:05:04"
}
],
"meta": {
"page": 1,
"results_per_page": 25,
"total": 1,
"total_pages": 1
},
"links": {
"first": "https://app.pusherstudio.com/api/segments?&page=1",
"last": "https://app.pusherstudio.com/api/segments?&page=1",
"next": null,
"prev": null,
"self": "https://app.pusherstudio.com/api/segments?&page=1"
}
}
GET https://app.pusherstudio.com/api/segments/{segment_id}
curl --request GET \
--url 'https://app.pusherstudio.com/api/segments/{segment_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://app.pusherstudio.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": "2024-08-09 03:05:04"
}
}
POST https://app.pusherstudio.com/api/segments
Parameters | Details | Description |
---|---|---|
website_id | Required Integer | - |
name | Required String | - |
type | Optional String | Allowed values: custom , filter |
subscribers_ids | Optional String | Available when: segment = custom |
filters_custom_parameter_key[index] | Optional String | Available when: segment = filter |
filters_custom_parameter_value[index] | Optional String | Available when: segment = filter |
filters_custom_parameter_value[index] | Optional String | Available when: segment = filter |
filters_cities[] | Optional String | Available when: segment = filter |
filters_countries[] | Optional String | Available when: segment = filter |
filters_continents[] | Optional String | Available when: segment = filter |
filters_device_type[] | Optional String | Available when: segment = filter |
filters_languages[] | Optional String | Available when: segment = filter |
filters_operating_systems[] | Optional String | Available when: segment = filter |
filters_browsers[] | Optional String | Available when: segment = filter |
curl --request POST \
--url 'https://app.pusherstudio.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' \
--url 'https://app.pusherstudio.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://app.pusherstudio.com/api/segments/{segment_id}
Parameters | Details | Description |
---|---|---|
website_id | Optional Integer | - |
name | Optional String | - |
type | Optional String | Allowed values: custom , filter |
subscribers_ids | Optional String | Available when: segment = custom |
filters_custom_parameter_key[index] | Optional String | Available when: segment = filter |
filters_custom_parameter_value[index] | Optional String | Available when: segment = filter |
filters_custom_parameter_value[index] | Optional String | Available when: segment = filter |
filters_cities[] | Optional String | Available when: segment = filter |
filters_countries[] | Optional String | Available when: segment = filter |
filters_continents[] | Optional String | Available when: segment = filter |
filters_device_type[] | Optional String | Available when: segment = filter |
filters_languages[] | Optional String | Available when: segment = filter |
filters_operating_systems[] | Optional String | Available when: segment = filter |
filters_browsers[] | Optional String | Available when: segment = filter |
curl --request POST \
--url 'https://app.pusherstudio.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' \
--url 'https://app.pusherstudio.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://app.pusherstudio.com/api/segments/{segment_id}
curl --request DELETE \
--url 'https://app.pusherstudio.com/api/segments/{segment_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://app.pusherstudio.com/api/segments/{segment_id}' \
--header 'Authorization: Bearer {api_key}' \