Segments

Create a New Segment

Creates a new segmentRequest for the specified account and dataset using the provided configuration. This includes applying filters and setting up any email notification preferences.

post/v1/segments

Request

  • Base URL: https://api.leadboxer.com
  • URL: https://api.leadboxer.com/v1/segments
  • Auth: API key in header x-api-key

Query parameters

emailstring required

The email address of the user creating the segmentRequest.

Request body

namestring required

Segment name.

accountIdstring required

Leadboxer accountId.

datasetIdstring required

The dataset for which to create segment.

type'USER' | 'ACCOUNT' required

Defines the visibility of the segment.<br/><br/><b>Possible values:</b><br/><b>USER</b> – Visible only to the current user.<br/><b>ACCOUNT</b> – Shared with all users of the account.

textFilterstring

Text-based filter expression used to filter result fields.Format: field|operator|value. Multiple filters are comma-separated.

numberFilterstring

Numeric filter expression used to filter results based on numeric fields. Format: field|operator|value. Multiple filters are comma-separated. Supported numeric operators include greaterthan, lessthan, is, isnot, between, and notbetween. The between and notbetween operators use the format min-max.

timeFilterstring

Time-based filter expression used to filter results by time field. Format: field|operator|value.

Allowed fields (same as timeField parameter):

  • eventEsTimestamp : Last Seen
  • first_session_unix_timestamp : First Seen

Supported operators:

  • exactly → integer value (0 = Today, 1 = Yesterday)
  • lessthan → integer value (e.g. 6 = last 7 days)
  • between → date range in format dd/MM/yyyy-dd/MM/yyyy

Locale settings are taken into account while interpreting dates and returning results.

fieldFilterstring

Field-based filter used to include leads based on field presence.

Format: operator|field1;field2

Allowed operator:

  • hasanyvalue

Allowed fields:

  • firstName
  • lastName
  • email

Multiple fields can be provided using semicolons.

exitLinkFilterstring

Exit link filter used to include or exclude leads based on exit link values.

Format: field|operator|value

Supported operators:

  • contains
  • is
  • isnot
  • doesnotcontain

Multiple values can be provided using semicolons.

leadscoreFilterinteger

Filters leads based on given minimum leadscore.

displayFilterstring

Display filter used to control which types of leads are returned.

Supported values:

  • company
  • person
  • unidentified

Selecting 'unidentified' returns leads that could not be identified as a company or a person.

Multiple values can be provided using semicolons.

fromFilterstring

Filters leads based on specified from user

ownerstring

Filters leads based specified owner(userId)

hiddenstring

Filters leads based on presetInclusionList

searchstring

Keyword search.

emailView'NONE' | 'LEAD' | 'ACCOUNT'

Email view type.<br/>Possible values : NONE, LEAD, ACCOUNT<br/>

notificationType'NONE' | 'DAILY' | 'WEEKLY'

Set notification frequency.<br/><br/><b>Possible values:</b><br/><b>NONE</b> : Do not send any notification.<br/><b>DAILY</b> : Send notification daily.<br/><b>WEEKLY</b> : Send notification weekly.

notificationMailIdsstring

List of comma separated email addresses for notification.

mailTemplatestring

Set headlines for the notification email.

formatstring

Format for the segment notification.<br/>Possible values : html, csv

dayOfWeekinteger

Day of week on which weekly notification will be sent. Possible values include numbers from 1 to 7 (where 1 refers to Monday).

additionalCsvFieldsstring

List of comma separated fields to be included in CSV.

sortBystring

Field to sort result.<br/>Possible values :<br/><b>_score</b> : records sorted by leadscore.<br/><b>lastEvent</b> : records sorted by activity time.<br/>Default : _score

sortOrderstring

Sort order.<br/>Possible values : asc, desc<br/>Default : desc

viewTypestring

View type.<br/>Possible values : B2B, B2C<br/>Default : B2B

liststring

Filters list file saved using List Settings Page.

timeFieldstring
csvSetNamestring

Example request

{
  "type": "USER",
  "exitLinkFilter": "exitLinkFilter|contains|leads",
  "emailView": "LEAD",
  "notificationType": "DAILY",
  "notificationMailIds": "user1@example.com,user2@example.com",
  "mailTemplate": "Weekly Lead Summary",
  "format": "html",
  "dayOfWeek": 1,
  "additionalCsvFields": "email,companyName,jobTitle",
  "sortBy": "_score",
  "sortOrder": "desc",
  "viewType": "B2B"
}

Response

OK

Changes

No recorded changes to this operation across all 1 revision of this API.