curl --request PUT \
--url https://dash.dmly.io/api/v1/contacts/{contact} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Ada Lovelace",
"email": "ada@new.example.com",
"stage": "00000000-0000-4000-8000-000000000000",
"custom_fields": {
"company": "Analytical Engines Ltd"
},
"marketing_opted_out": true
}
'import requests
url = "https://dash.dmly.io/api/v1/contacts/{contact}"
payload = {
"name": "Ada Lovelace",
"email": "ada@new.example.com",
"stage": "00000000-0000-4000-8000-000000000000",
"custom_fields": { "company": "Analytical Engines Ltd" },
"marketing_opted_out": True
}
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: 'Ada Lovelace',
email: 'ada@new.example.com',
stage: '00000000-0000-4000-8000-000000000000',
custom_fields: {company: 'Analytical Engines Ltd'},
marketing_opted_out: true
})
};
fetch('https://dash.dmly.io/api/v1/contacts/{contact}', 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/contacts/{contact}",
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' => 'Ada Lovelace',
'email' => 'ada@new.example.com',
'stage' => '00000000-0000-4000-8000-000000000000',
'custom_fields' => [
'company' => 'Analytical Engines Ltd'
],
'marketing_opted_out' => true
]),
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/contacts/{contact}"
payload := strings.NewReader("{\n \"name\": \"Ada Lovelace\",\n \"email\": \"ada@new.example.com\",\n \"stage\": \"00000000-0000-4000-8000-000000000000\",\n \"custom_fields\": {\n \"company\": \"Analytical Engines Ltd\"\n },\n \"marketing_opted_out\": true\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/contacts/{contact}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Ada Lovelace\",\n \"email\": \"ada@new.example.com\",\n \"stage\": \"00000000-0000-4000-8000-000000000000\",\n \"custom_fields\": {\n \"company\": \"Analytical Engines Ltd\"\n },\n \"marketing_opted_out\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.dmly.io/api/v1/contacts/{contact}")
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\": \"Ada Lovelace\",\n \"email\": \"ada@new.example.com\",\n \"stage\": \"00000000-0000-4000-8000-000000000000\",\n \"custom_fields\": {\n \"company\": \"Analytical Engines Ltd\"\n },\n \"marketing_opted_out\": true\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Update a contact
Updates a contact’s fields. Accepts PUT or PATCH; both are handled identically, so send only the fields you are changing. Fires the contact.updated webhook. Sending stage moves the pipeline stage exactly as Set a contact’s pipeline stage does, with the same contact.stage_changed webhook and automations. A stage that is not a pipeline stage id in this workspace is refused with 422 and nothing is saved; null clears it. marketing_opted_out=true opts the contact out of promotions only: promotional broadcasts (a Marketing template, or a broadcast whose purpose is promotional), sequences, review requests, gift card deliveries and automated Marketing templates are refused for them, while appointment reminders, receipts, invoices, utility templates, service-update broadcasts and any manual reply still go. false lets promotions reach them again; only send it when the person asked. Each change is recorded in their consent history. It never lifts a full opt-out (opted_out_at, set when the person replies STOP).
curl --request PUT \
--url https://dash.dmly.io/api/v1/contacts/{contact} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Ada Lovelace",
"email": "ada@new.example.com",
"stage": "00000000-0000-4000-8000-000000000000",
"custom_fields": {
"company": "Analytical Engines Ltd"
},
"marketing_opted_out": true
}
'import requests
url = "https://dash.dmly.io/api/v1/contacts/{contact}"
payload = {
"name": "Ada Lovelace",
"email": "ada@new.example.com",
"stage": "00000000-0000-4000-8000-000000000000",
"custom_fields": { "company": "Analytical Engines Ltd" },
"marketing_opted_out": True
}
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: 'Ada Lovelace',
email: 'ada@new.example.com',
stage: '00000000-0000-4000-8000-000000000000',
custom_fields: {company: 'Analytical Engines Ltd'},
marketing_opted_out: true
})
};
fetch('https://dash.dmly.io/api/v1/contacts/{contact}', 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/contacts/{contact}",
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' => 'Ada Lovelace',
'email' => 'ada@new.example.com',
'stage' => '00000000-0000-4000-8000-000000000000',
'custom_fields' => [
'company' => 'Analytical Engines Ltd'
],
'marketing_opted_out' => true
]),
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/contacts/{contact}"
payload := strings.NewReader("{\n \"name\": \"Ada Lovelace\",\n \"email\": \"ada@new.example.com\",\n \"stage\": \"00000000-0000-4000-8000-000000000000\",\n \"custom_fields\": {\n \"company\": \"Analytical Engines Ltd\"\n },\n \"marketing_opted_out\": true\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/contacts/{contact}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Ada Lovelace\",\n \"email\": \"ada@new.example.com\",\n \"stage\": \"00000000-0000-4000-8000-000000000000\",\n \"custom_fields\": {\n \"company\": \"Analytical Engines Ltd\"\n },\n \"marketing_opted_out\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.dmly.io/api/v1/contacts/{contact}")
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\": \"Ada Lovelace\",\n \"email\": \"ada@new.example.com\",\n \"stage\": \"00000000-0000-4000-8000-000000000000\",\n \"custom_fields\": {\n \"company\": \"Analytical Engines Ltd\"\n },\n \"marketing_opted_out\": true\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Authorizations
Body
Response
Success.
Was this page helpful?

