Skip to content
FacebookYouTubeX (Twitter)

Segments

You can use the API to get or set segment information. A segment is a collection of contacts, defined by a specific set of attributes, used to filter them in a marketing campaign. User segmentation is the process of separating leads into distinct groups, or segments, based on shared characteristics. A company might segment leads based on language preferences, product version, geographical region.

FieldTypeDescription
idStringThe unique identifier for the segment which is given by Pingstreams.
nameStringThe segment name
matchStringall or any
createdAtStringThe time (ISO-8601 date string) when the segment was created.
filtersArraySegment filters
createdByStringThe unique identifier of the row creator
id_projectStringThe unique identifier of the project

GET https://api.pingstreams.com/v3/:project_id/segments

curl -v -X GET -H 'Content-Type: application/json' -u user@example.com:123456 https://api.pingstreams.com/v3/5b55e806c93dde00143163dd/segments

GET https://api.pingstreams.com/v3/:project_id/segments/:id

Fetches a segment by his or her segment ID

ParameterTypeDescription
idstringthe segment identifier
project_idstringThe project_id is a unique code assigned to your project when you create it in Pingstreams
HeaderTypeDescription
AuthorizationstringAuthorization token. Basic Auth or JWT. Minumun role: agent
Content-Typestringuse “application/json” value
curl -v -X GET -H 'Content-Type: application/json' -u user@example.com:123456 https://api.pingstreams.com/v3/5b55e806c93dde00143163dd/segments/5c81593adf767b0017d1aa66

POST https://api.pingstreams.com/v3/:project_id/segments

Allows to add more segments.

ParameterTypeDescription
project_idstringThe project_id is a unique code assigned to your project when you create it in Pingstreams
HeaderTypeDescription
AuthorizationstringAuthorization token. Basic Auth or JWT. Minumun role: agent
Content-Typestringuse “application/json” value
FieldTypeDescription
namestringThe segment name
matchstringThe segment match type. All or Any
filtersarrayThe segment filters
curl -v -X POST -H 'Content-Type: application/json' -u user@example.com:123456 -d '{ "name":"segment1", "filters": [{"field":"field1","operator":"=","value":"value1"}]}' https://api.pingstreams.com/v3/5b55e806c93dde00143163dd/segments

PUT https://api.pingstreams.com/v3/:project_id/segments/:id

Allows to update a segment.

ParameterTypeDescription
project_idstringThe project_id is a unique code assigned to your project when you create it in Pingstreams
idstringThe id is the segment indentifier.
HeaderTypeDescription
AuthorizationstringAuthorization token. Basic Auth or JWT. Minumun role: agent
Content-Typestringuse “application/json” value
FieldTypeDescription
namestringThe segment name
matchstringThe segment match type. All or Any
filtersarrayThe segment filters

DELETE https://api.pingstreams.com/v3/:project_id/segments/:id

Allows to delete a segment.

ParameterTypeDescription
project_idstringThe project_id is a unique code assigned to your project when you create it in Pingstreams
idstringThe id is the segment indentifier.
HeaderTypeDescription
AuthorizationstringAuthorization token. Basic Auth or JWT. Minumun role: agent