Update a contact segment
curl --request PATCH \
--url https://lazyapp.in/v1/contact-segments/{segment} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"filters": {
"tags": {
"mode": "any",
"names": [
"admissions:intake-alerts"
],
"uuids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"ids": [
123
]
},
"attribute": {
"key": "tier",
"equals": "vip"
},
"suppressed": true
}
}
'import requests
url = "https://lazyapp.in/v1/contact-segments/{segment}"
payload = {
"name": "<string>",
"filters": {
"tags": {
"mode": "any",
"names": ["admissions:intake-alerts"],
"uuids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"ids": [123]
},
"attribute": {
"key": "tier",
"equals": "vip"
},
"suppressed": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
filters: {
tags: {
mode: 'any',
names: ['admissions:intake-alerts'],
uuids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
ids: [123]
},
attribute: {key: 'tier', equals: 'vip'},
suppressed: true
}
})
};
fetch('https://lazyapp.in/v1/contact-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://lazyapp.in/v1/contact-segments/{segment}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'filters' => [
'tags' => [
'mode' => 'any',
'names' => [
'admissions:intake-alerts'
],
'uuids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'ids' => [
123
]
],
'attribute' => [
'key' => 'tier',
'equals' => 'vip'
],
'suppressed' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://lazyapp.in/v1/contact-segments/{segment}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"filters\": {\n \"tags\": {\n \"mode\": \"any\",\n \"names\": [\n \"admissions:intake-alerts\"\n ],\n \"uuids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"ids\": [\n 123\n ]\n },\n \"attribute\": {\n \"key\": \"tier\",\n \"equals\": \"vip\"\n },\n \"suppressed\": true\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://lazyapp.in/v1/contact-segments/{segment}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"filters\": {\n \"tags\": {\n \"mode\": \"any\",\n \"names\": [\n \"admissions:intake-alerts\"\n ],\n \"uuids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"ids\": [\n 123\n ]\n },\n \"attribute\": {\n \"key\": \"tier\",\n \"equals\": \"vip\"\n },\n \"suppressed\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lazyapp.in/v1/contact-segments/{segment}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"filters\": {\n \"tags\": {\n \"mode\": \"any\",\n \"names\": [\n \"admissions:intake-alerts\"\n ],\n \"uuids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"ids\": [\n 123\n ]\n },\n \"attribute\": {\n \"key\": \"tier\",\n \"equals\": \"vip\"\n },\n \"suppressed\": true\n }\n}"
response = http.request(request)
puts response.read_body{}{
"message": "<string>",
"code": "<string>"
}{
"message": "The API is on the Pro plan. Upgrade in Billing to use live keys. Test keys keep working.",
"code": "plan_limit_reached"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>"
}Contacts
Update a contact segment
Required scope: messages:send
PATCH
/
v1
/
contact-segments
/
{segment}
Update a contact segment
curl --request PATCH \
--url https://lazyapp.in/v1/contact-segments/{segment} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"filters": {
"tags": {
"mode": "any",
"names": [
"admissions:intake-alerts"
],
"uuids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"ids": [
123
]
},
"attribute": {
"key": "tier",
"equals": "vip"
},
"suppressed": true
}
}
'import requests
url = "https://lazyapp.in/v1/contact-segments/{segment}"
payload = {
"name": "<string>",
"filters": {
"tags": {
"mode": "any",
"names": ["admissions:intake-alerts"],
"uuids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"ids": [123]
},
"attribute": {
"key": "tier",
"equals": "vip"
},
"suppressed": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
filters: {
tags: {
mode: 'any',
names: ['admissions:intake-alerts'],
uuids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
ids: [123]
},
attribute: {key: 'tier', equals: 'vip'},
suppressed: true
}
})
};
fetch('https://lazyapp.in/v1/contact-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://lazyapp.in/v1/contact-segments/{segment}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'filters' => [
'tags' => [
'mode' => 'any',
'names' => [
'admissions:intake-alerts'
],
'uuids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'ids' => [
123
]
],
'attribute' => [
'key' => 'tier',
'equals' => 'vip'
],
'suppressed' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://lazyapp.in/v1/contact-segments/{segment}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"filters\": {\n \"tags\": {\n \"mode\": \"any\",\n \"names\": [\n \"admissions:intake-alerts\"\n ],\n \"uuids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"ids\": [\n 123\n ]\n },\n \"attribute\": {\n \"key\": \"tier\",\n \"equals\": \"vip\"\n },\n \"suppressed\": true\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://lazyapp.in/v1/contact-segments/{segment}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"filters\": {\n \"tags\": {\n \"mode\": \"any\",\n \"names\": [\n \"admissions:intake-alerts\"\n ],\n \"uuids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"ids\": [\n 123\n ]\n },\n \"attribute\": {\n \"key\": \"tier\",\n \"equals\": \"vip\"\n },\n \"suppressed\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lazyapp.in/v1/contact-segments/{segment}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"filters\": {\n \"tags\": {\n \"mode\": \"any\",\n \"names\": [\n \"admissions:intake-alerts\"\n ],\n \"uuids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"ids\": [\n 123\n ]\n },\n \"attribute\": {\n \"key\": \"tier\",\n \"equals\": \"vip\"\n },\n \"suppressed\": true\n }\n}"
response = http.request(request)
puts response.read_body{}{
"message": "<string>",
"code": "<string>"
}{
"message": "The API is on the Pro plan. Upgrade in Billing to use live keys. Test keys keep working.",
"code": "plan_limit_reached"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>"
}