Create a saved contact segment.
curl --request POST \
--url https://dash.dmly.io/api/v1/segments \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "VIP clients gone quiet",
"stage": "9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90",
"include_tags": [
"3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31"
],
"exclude_tags": [
"a17e2b09-44cd-4e8f-9b21-0c3d5e6f7a82"
],
"min_days_inactive": 30
}
'import requests
url = "https://dash.dmly.io/api/v1/segments"
payload = {
"name": "VIP clients gone quiet",
"stage": "9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90",
"include_tags": ["3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31"],
"exclude_tags": ["a17e2b09-44cd-4e8f-9b21-0c3d5e6f7a82"],
"min_days_inactive": 30
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'VIP clients gone quiet',
stage: '9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90',
include_tags: ['3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31'],
exclude_tags: ['a17e2b09-44cd-4e8f-9b21-0c3d5e6f7a82'],
min_days_inactive: 30
})
};
fetch('https://dash.dmly.io/api/v1/segments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dash.dmly.io/api/v1/segments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'VIP clients gone quiet',
'stage' => '9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90',
'include_tags' => [
'3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31'
],
'exclude_tags' => [
'a17e2b09-44cd-4e8f-9b21-0c3d5e6f7a82'
],
'min_days_inactive' => 30
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dash.dmly.io/api/v1/segments"
payload := strings.NewReader("{\n \"name\": \"VIP clients gone quiet\",\n \"stage\": \"9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90\",\n \"include_tags\": [\n \"3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31\"\n ],\n \"exclude_tags\": [\n \"a17e2b09-44cd-4e8f-9b21-0c3d5e6f7a82\"\n ],\n \"min_days_inactive\": 30\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dash.dmly.io/api/v1/segments")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"VIP clients gone quiet\",\n \"stage\": \"9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90\",\n \"include_tags\": [\n \"3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31\"\n ],\n \"exclude_tags\": [\n \"a17e2b09-44cd-4e8f-9b21-0c3d5e6f7a82\"\n ],\n \"min_days_inactive\": 30\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.dmly.io/api/v1/segments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"VIP clients gone quiet\",\n \"stage\": \"9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90\",\n \"include_tags\": [\n \"3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31\"\n ],\n \"exclude_tags\": [\n \"a17e2b09-44cd-4e8f-9b21-0c3d5e6f7a82\"\n ],\n \"min_days_inactive\": 30\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Creates a new contact filter. name is required (max 80). stage is an optional stage uuid. include_tags/exclude_tags are arrays of tag uuids (contacts must have ALL include tags and NONE of the exclude tags). min_days_inactive filters to contacts with no interaction for at least N days.
POST
/
segments
Create a saved contact segment.
curl --request POST \
--url https://dash.dmly.io/api/v1/segments \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "VIP clients gone quiet",
"stage": "9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90",
"include_tags": [
"3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31"
],
"exclude_tags": [
"a17e2b09-44cd-4e8f-9b21-0c3d5e6f7a82"
],
"min_days_inactive": 30
}
'import requests
url = "https://dash.dmly.io/api/v1/segments"
payload = {
"name": "VIP clients gone quiet",
"stage": "9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90",
"include_tags": ["3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31"],
"exclude_tags": ["a17e2b09-44cd-4e8f-9b21-0c3d5e6f7a82"],
"min_days_inactive": 30
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'VIP clients gone quiet',
stage: '9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90',
include_tags: ['3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31'],
exclude_tags: ['a17e2b09-44cd-4e8f-9b21-0c3d5e6f7a82'],
min_days_inactive: 30
})
};
fetch('https://dash.dmly.io/api/v1/segments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dash.dmly.io/api/v1/segments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'VIP clients gone quiet',
'stage' => '9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90',
'include_tags' => [
'3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31'
],
'exclude_tags' => [
'a17e2b09-44cd-4e8f-9b21-0c3d5e6f7a82'
],
'min_days_inactive' => 30
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dash.dmly.io/api/v1/segments"
payload := strings.NewReader("{\n \"name\": \"VIP clients gone quiet\",\n \"stage\": \"9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90\",\n \"include_tags\": [\n \"3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31\"\n ],\n \"exclude_tags\": [\n \"a17e2b09-44cd-4e8f-9b21-0c3d5e6f7a82\"\n ],\n \"min_days_inactive\": 30\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dash.dmly.io/api/v1/segments")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"VIP clients gone quiet\",\n \"stage\": \"9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90\",\n \"include_tags\": [\n \"3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31\"\n ],\n \"exclude_tags\": [\n \"a17e2b09-44cd-4e8f-9b21-0c3d5e6f7a82\"\n ],\n \"min_days_inactive\": 30\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.dmly.io/api/v1/segments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"VIP clients gone quiet\",\n \"stage\": \"9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90\",\n \"include_tags\": [\n \"3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31\"\n ],\n \"exclude_tags\": [\n \"a17e2b09-44cd-4e8f-9b21-0c3d5e6f7a82\"\n ],\n \"min_days_inactive\": 30\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Was this page helpful?
⌘I

