Create segment

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Segmenter provides a simple way that allows customers to create segments with people from their own databases, CRM, ERP, etc.

How to create a segment ?

Send a request to this endpoint if you want to create a segment, you have the possibility to send it with people to associate them to the segment. In the body you can send it as "persons".

When you send the request with persons, it will save the persons in the database.

See the following example.

{
  "name": "string",
  "description": "string",
  "broadcastMediumId": "string",
  "segmentType":"string",
  "TagId"; "string",
  "filters": [],
  "persons": [
    {
      "substitutionTags": [{"tag": "string","value": "string"}],
      "externalId": "uuid",
      "firstName": "string",
      "lastName": "string",
      "phone": "string",
      "email": "string"
    },
    {   
      "externalId": "uuid",
      "firstName": "string",
      "lastName": "string",
      "phoneNumber": "string",
      "email": "string"
    }
  ]
}
📘

Substitution tags

Let's take a deeper look at the array of persons, as we can see inside persons you can also send substitutionTags which is an array of objects that accepts tag and value as properties. When sending the array of substitutionTags, it will save in the database the tags associated to the person. this is optional

"persons": [
  {
    "substitutionTags": [{"tag": "string","value": "string"}],
    "externalId": "uuid",
    "firstName": "string",
    "lastName": "string",
    "phone": "string",
    "email": "string"
  },
  {      
    "externalId": "uuid",
    "firstName": "string",
    "lastName": "string",
    "phoneNumber": "string",
    "email": "string"
  }
]

Authorization

📘

In order to send the request you must send the authorization api key in the header.

x-api-key: "API_TOKEN"

Responses

When a request is successful you will receive the endpoint will return code 200 and the response will look something like this

{
  "data": {
    "id": "Id of the segment created",
    "persons": [
      {
        "id": "Id of the person created",
        "externalId": "External id of the person created",
        "email": "email of the person created"
      }
    ]
  },
  "errorMessage": ""
}

If your body has some error, the endpoint may return 400, in that case you must validate that the json you are sending does not contain any error.

{
    "statusCode": 400,
    "message": "Here the system will try to show you the line where the error occurs",
    "error": "Bad Request"
}

If the system throws 401, you are facing an authorization error, in that case you must validate that the x-api-key that is passed through the header is the correct one.

{
    "statusCode": 401,
    "message": "Unauthorized"
}
Body Params
json
Defaults to { "name": "replace with the name of the segment", "description": "replace with description", "broadcastMediumId": "replace with broadcast medium Id", "segmentType":"replace with segment type", "tagId": "Replace with the tag Id", "filters": [], "persons": [ { "substitutionTags": [{"tag": "replace with name of the tag","value": "replace with value of the tag"}], "externalId": "replace with uuid", "firstName": "replace with first name", "lastName": "replace with last name", "phone": "replace with phone number", "email": "replace with email" } ] }

name: Replace with name of segment, description: Replace with description of segment, broadcastMediumId: Replace with id of the broadcast medium Id, segmentType: Replace with type of segment, persons, externalId: Replace with uuid, firstName: Replace with first name, lastName: Replace with last name, phone: Replace with mobile phone number, email: Replace with email, externalId: Replace with uuid, firstName: replace with name, lastName: Replace with last name, phone: Replace with mobile phone number

Headers
string

This API key is provided by Instaleap when starting the integration

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json