Segments
GET https://sms.sociostacks.com/api/segments/
curl --request GET \
--url 'https://sms.sociostacks.com/api/segments/' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://sms.sociostacks.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,
"name": "Example",
"settings": {
"contacts_ids": [1,2,3,4,5]
},
"type": "custom",
"total_contacts": 5,
"last_datetime": null,
"datetime": "2025-10-29 03:25:04",
}
],
"meta": {
"page": 1,
"results_per_page": 25,
"total": 1,
"total_pages": 1
},
"links": {
"first": "https://sms.sociostacks.com/api/segments?page=1",
"last": "https://sms.sociostacks.com/api/segments?page=1",
"next": null,
"prev": null,
"self": "https://sms.sociostacks.com/api/segments?page=1"
}
}
GET https://sms.sociostacks.com/api/segments/{segment_id}
curl --request GET \
--url 'https://sms.sociostacks.com/api/segments/{segment_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://sms.sociostacks.com/api/segments/{segment_id}' \
--header 'Authorization: Bearer {api_key}' \
{
"data": {
"id": 1,
"user_id": 1,
"name": "Example",
"settings": {
"contacts_ids": [1,2,3,4,5]
},
"type": "filter",
"total_contacts": 5,
"last_datetime": null,
"datetime": "2025-10-29 03:25:04",
}
}
POST https://sms.sociostacks.com/api/segments
| Parameters | Details | Description |
|---|---|---|
| name | Required String | - |
| type | Optional String | Allowed values: bulk , custom , filter |
| phone_numbers | Optional String | Available when: segment = bulk |
| contacts_ids | Optional String | Available when: segment = custom |
| filters_custom_parameter_key[index] | Optional String | Available when: segment = filter |
| filters_custom_parameter_condition[index] | Optional String |
Allowed values: exact, not_exact, contains, not_contains, starts_with, not_starts_with, ends_with, not_ends_with, bigger_than, lower_than Available when: segment = filter |
| filters_custom_parameter_value[index] | Optional String | Available when: segment = filter |
| filters_countries[] | Optional String | Available when: segment = filter |
| filters_continents[] | Optional String | Available when: segment = filter |
curl --request POST \
--url 'https://sms.sociostacks.com/api/segments' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example name' \
--form 'type=custom' \
--form 'contacts_ids=1,2,3,4,5' \
--url 'https://sms.sociostacks.com/api/segments' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example name' \
--form 'type=custom' \
--form 'contacts_ids=1,2,3,4,5' \
{
"data": {
"id": 1
}
}
POST https://sms.sociostacks.com/api/segments/{segment_id}
| Parameters | Details | Description |
|---|---|---|
| name | Optional String | - |
| type | Optional String | Allowed values: bulk , custom , filter |
| phone_numbers | Optional String | Available when: segment = bulk |
| contacts_ids | Optional String | Available when: segment = custom |
| filters_custom_parameter_key[index] | Optional String | Available when: segment = filter |
| filters_custom_parameter_condition[index] | Optional String |
Allowed values: exact, not_exact, contains, not_contains, starts_with, not_starts_with, ends_with, not_ends_with, bigger_than, lower_than Available when: segment = filter |
| filters_custom_parameter_value[index] | Optional String | Available when: segment = filter |
| filters_countries[] | Optional String | Available when: segment = filter |
| filters_continents[] | Optional String | Available when: segment = filter |
curl --request POST \
--url 'https://sms.sociostacks.com/api/segments/{segment_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example name' \
--form 'type=custom' \
--form 'contacts_ids=1,2,3,4,5' \
--url 'https://sms.sociostacks.com/api/segments/{segment_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example name' \
--form 'type=custom' \
--form 'contacts_ids=1,2,3,4,5' \
{
"data": {
"id": 1
}
}
DELETE https://sms.sociostacks.com/api/segments/{segment_id}
curl --request DELETE \
--url 'https://sms.sociostacks.com/api/segments/{segment_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://sms.sociostacks.com/api/segments/{segment_id}' \
--header 'Authorization: Bearer {api_key}' \