Update a contact
curl --request PATCH \
--url https://lazyapp.in/v1/contacts/{contact} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>",
"email": "jsmith@example.com",
"external_id": "<string>",
"preferred_language": "<string>",
"timezone": "<string>",
"attributes": {}
}
'import requests
url = "https://lazyapp.in/v1/contacts/{contact}"
payload = {
"username": "<string>",
"email": "jsmith@example.com",
"external_id": "<string>",
"preferred_language": "<string>",
"timezone": "<string>",
"attributes": {}
}
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({
username: '<string>',
email: 'jsmith@example.com',
external_id: '<string>',
preferred_language: '<string>',
timezone: '<string>',
attributes: {}
})
};
fetch('https://lazyapp.in/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://lazyapp.in/v1/contacts/{contact}",
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([
'username' => '<string>',
'email' => 'jsmith@example.com',
'external_id' => '<string>',
'preferred_language' => '<string>',
'timezone' => '<string>',
'attributes' => [
]
]),
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/contacts/{contact}"
payload := strings.NewReader("{\n \"username\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"external_id\": \"<string>\",\n \"preferred_language\": \"<string>\",\n \"timezone\": \"<string>\",\n \"attributes\": {}\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/contacts/{contact}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"username\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"external_id\": \"<string>\",\n \"preferred_language\": \"<string>\",\n \"timezone\": \"<string>\",\n \"attributes\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lazyapp.in/v1/contacts/{contact}")
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 \"username\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"external_id\": \"<string>\",\n \"preferred_language\": \"<string>\",\n \"timezone\": \"<string>\",\n \"attributes\": {}\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"phone_number": "<string>",
"bsuid": "<string>",
"external_id": "<string>",
"crm_id": "<string>",
"identifiers": [
{
"type": "<string>",
"value": "<string>",
"is_primary": true
}
],
"username": "<string>",
"email": "<string>",
"preferred_language": "<string>",
"timezone": "<string>",
"attributes": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"identity": {
"key_hash": "<string>",
"changed_at": "2023-11-07T05:31:56Z"
}
}{
"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>",
"errors": {}
}{
"message": "<string>",
"code": "<string>"
}Contacts
Update a contact
Only the fields you send change.
Required scope: messages:send
PATCH
/
v1
/
contacts
/
{contact}
Update a contact
curl --request PATCH \
--url https://lazyapp.in/v1/contacts/{contact} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>",
"email": "jsmith@example.com",
"external_id": "<string>",
"preferred_language": "<string>",
"timezone": "<string>",
"attributes": {}
}
'import requests
url = "https://lazyapp.in/v1/contacts/{contact}"
payload = {
"username": "<string>",
"email": "jsmith@example.com",
"external_id": "<string>",
"preferred_language": "<string>",
"timezone": "<string>",
"attributes": {}
}
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({
username: '<string>',
email: 'jsmith@example.com',
external_id: '<string>',
preferred_language: '<string>',
timezone: '<string>',
attributes: {}
})
};
fetch('https://lazyapp.in/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://lazyapp.in/v1/contacts/{contact}",
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([
'username' => '<string>',
'email' => 'jsmith@example.com',
'external_id' => '<string>',
'preferred_language' => '<string>',
'timezone' => '<string>',
'attributes' => [
]
]),
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/contacts/{contact}"
payload := strings.NewReader("{\n \"username\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"external_id\": \"<string>\",\n \"preferred_language\": \"<string>\",\n \"timezone\": \"<string>\",\n \"attributes\": {}\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/contacts/{contact}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"username\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"external_id\": \"<string>\",\n \"preferred_language\": \"<string>\",\n \"timezone\": \"<string>\",\n \"attributes\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lazyapp.in/v1/contacts/{contact}")
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 \"username\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"external_id\": \"<string>\",\n \"preferred_language\": \"<string>\",\n \"timezone\": \"<string>\",\n \"attributes\": {}\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"phone_number": "<string>",
"bsuid": "<string>",
"external_id": "<string>",
"crm_id": "<string>",
"identifiers": [
{
"type": "<string>",
"value": "<string>",
"is_primary": true
}
],
"username": "<string>",
"email": "<string>",
"preferred_language": "<string>",
"timezone": "<string>",
"attributes": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"identity": {
"key_hash": "<string>",
"changed_at": "2023-11-07T05:31:56Z"
}
}{
"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>",
"errors": {}
}{
"message": "<string>",
"code": "<string>"
}Authorizations
Your API key, e.g. sk_live_... or sk_test_....
Headers
Optional. Makes this write safe to retry: the same key replays the first response instead of acting twice.
Maximum string length:
255Path Parameters
Contact uuid.
Body
application/json
Maximum string length:
128Maximum string length:
128Maximum string length:
16Merged into the stored attributes: keys you send are set, a key set to null is removed, and other keys are kept. Send "attributes": null to clear them all.
Response
Updated.
Business-scoped user id, when Meta gives one.
Show child attributes
Show child attributes
Show child attributes
Show child attributes