Update a saved contact segment.
curl --request PUT \
--url https://dash.dmly.io/api/v1/segments/{segment} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "VIP clients gone quiet (60d)",
"stage": "9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90",
"include_tags": [
"3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31"
],
"exclude_tags": [],
"min_days_inactive": 60
}
'import requests
url = "https://dash.dmly.io/api/v1/segments/{segment}"
payload = {
"name": "VIP clients gone quiet (60d)",
"stage": "9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90",
"include_tags": ["3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31"],
"exclude_tags": [],
"min_days_inactive": 60
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'VIP clients gone quiet (60d)',
stage: '9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90',
include_tags: ['3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31'],
exclude_tags: [],
min_days_inactive: 60
})
};
fetch('https://dash.dmly.io/api/v1/segments/{segment}', 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/{segment}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'VIP clients gone quiet (60d)',
'stage' => '9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90',
'include_tags' => [
'3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31'
],
'exclude_tags' => [
],
'min_days_inactive' => 60
]),
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/{segment}"
payload := strings.NewReader("{\n \"name\": \"VIP clients gone quiet (60d)\",\n \"stage\": \"9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90\",\n \"include_tags\": [\n \"3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31\"\n ],\n \"exclude_tags\": [],\n \"min_days_inactive\": 60\n}")
req, _ := http.NewRequest("PUT", 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.put("https://dash.dmly.io/api/v1/segments/{segment}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"VIP clients gone quiet (60d)\",\n \"stage\": \"9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90\",\n \"include_tags\": [\n \"3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31\"\n ],\n \"exclude_tags\": [],\n \"min_days_inactive\": 60\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.dmly.io/api/v1/segments/{segment}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"VIP clients gone quiet (60d)\",\n \"stage\": \"9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90\",\n \"include_tags\": [\n \"3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31\"\n ],\n \"exclude_tags\": [],\n \"min_days_inactive\": 60\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Updates a segment by uuid. All fields are optional; only supplied fields are changed. Same validation rules as create (name max 80, stage uuid, tag uuid arrays, min_days_inactive >= 0). Accepts PUT or PATCH.
PUT
/
segments
/
{segment}
Update a saved contact segment.
curl --request PUT \
--url https://dash.dmly.io/api/v1/segments/{segment} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "VIP clients gone quiet (60d)",
"stage": "9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90",
"include_tags": [
"3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31"
],
"exclude_tags": [],
"min_days_inactive": 60
}
'import requests
url = "https://dash.dmly.io/api/v1/segments/{segment}"
payload = {
"name": "VIP clients gone quiet (60d)",
"stage": "9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90",
"include_tags": ["3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31"],
"exclude_tags": [],
"min_days_inactive": 60
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'VIP clients gone quiet (60d)',
stage: '9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90',
include_tags: ['3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31'],
exclude_tags: [],
min_days_inactive: 60
})
};
fetch('https://dash.dmly.io/api/v1/segments/{segment}', 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/{segment}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'VIP clients gone quiet (60d)',
'stage' => '9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90',
'include_tags' => [
'3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31'
],
'exclude_tags' => [
],
'min_days_inactive' => 60
]),
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/{segment}"
payload := strings.NewReader("{\n \"name\": \"VIP clients gone quiet (60d)\",\n \"stage\": \"9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90\",\n \"include_tags\": [\n \"3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31\"\n ],\n \"exclude_tags\": [],\n \"min_days_inactive\": 60\n}")
req, _ := http.NewRequest("PUT", 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.put("https://dash.dmly.io/api/v1/segments/{segment}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"VIP clients gone quiet (60d)\",\n \"stage\": \"9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90\",\n \"include_tags\": [\n \"3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31\"\n ],\n \"exclude_tags\": [],\n \"min_days_inactive\": 60\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.dmly.io/api/v1/segments/{segment}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"VIP clients gone quiet (60d)\",\n \"stage\": \"9b1d3f2a-7c4e-4a11-8f0a-2d6e5c4b1a90\",\n \"include_tags\": [\n \"3f8c1a02-9d44-4b6e-bb12-7a9e0c5d2f31\"\n ],\n \"exclude_tags\": [],\n \"min_days_inactive\": 60\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Authorizations
apiKeyAuthbearerAuth
Your workspace API key. It both authenticates the caller and selects the workspace.
Path Parameters
Segment id.
Body
application/json
Response
Success.
Was this page helpful?
⌘I

