Update a customer
curl --request PATCH \
--url https://api.trama.so/v1/customers/{customerId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"city": "<string>",
"contacts": [
{
"identifierValue": "+5491122334455"
}
],
"country": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"summary": "<string>",
"tags": [
"<string>"
]
}
'import requests
url = "https://api.trama.so/v1/customers/{customerId}"
payload = {
"city": "<string>",
"contacts": [{ "identifierValue": "+5491122334455" }],
"country": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"summary": "<string>",
"tags": ["<string>"]
}
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({
city: '<string>',
contacts: [{identifierValue: '+5491122334455'}],
country: '<string>',
firstName: '<string>',
lastName: '<string>',
summary: '<string>',
tags: ['<string>']
})
};
fetch('https://api.trama.so/v1/customers/{customerId}', 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://api.trama.so/v1/customers/{customerId}",
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([
'city' => '<string>',
'contacts' => [
[
'identifierValue' => '+5491122334455'
]
],
'country' => '<string>',
'firstName' => '<string>',
'lastName' => '<string>',
'summary' => '<string>',
'tags' => [
'<string>'
]
]),
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://api.trama.so/v1/customers/{customerId}"
payload := strings.NewReader("{\n \"city\": \"<string>\",\n \"contacts\": [\n {\n \"identifierValue\": \"+5491122334455\"\n }\n ],\n \"country\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"summary\": \"<string>\",\n \"tags\": [\n \"<string>\"\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://api.trama.so/v1/customers/{customerId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"city\": \"<string>\",\n \"contacts\": [\n {\n \"identifierValue\": \"+5491122334455\"\n }\n ],\n \"country\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"summary\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trama.so/v1/customers/{customerId}")
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 \"city\": \"<string>\",\n \"contacts\": [\n {\n \"identifierValue\": \"+5491122334455\"\n }\n ],\n \"country\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"summary\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"city": "<string>",
"contacts": [
{
"displayName": "<string>",
"id": "<string>",
"identifierValue": "<string>",
"phoneNumber": "<string>"
}
],
"country": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"displayName": "<string>",
"firstName": "<string>",
"id": "<string>",
"lastName": "<string>",
"preferredLanguage": "<string>",
"summary": "<string>",
"tags": [
"<string>"
],
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "CATALOG_PRODUCT_NOT_FOUND",
"message": "The catalog product does not exist."
}
}{
"error": {
"code": "CATALOG_PRODUCT_NOT_FOUND",
"message": "The catalog product does not exist."
}
}{
"error": {
"code": "CATALOG_PRODUCT_NOT_FOUND",
"message": "The catalog product does not exist."
}
}{
"error": {
"code": "CATALOG_PRODUCT_NOT_FOUND",
"message": "The catalog product does not exist."
}
}{
"error": {
"code": "CATALOG_PRODUCT_NOT_FOUND",
"message": "The catalog product does not exist."
}
}Customers
Update a customer
Only touches the fields present in the body. contacts, when present, REPLACES the whole list; when absent, the existing list is preserved.
PATCH
/
v1
/
customers
/
{customerId}
Update a customer
curl --request PATCH \
--url https://api.trama.so/v1/customers/{customerId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"city": "<string>",
"contacts": [
{
"identifierValue": "+5491122334455"
}
],
"country": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"summary": "<string>",
"tags": [
"<string>"
]
}
'import requests
url = "https://api.trama.so/v1/customers/{customerId}"
payload = {
"city": "<string>",
"contacts": [{ "identifierValue": "+5491122334455" }],
"country": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"summary": "<string>",
"tags": ["<string>"]
}
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({
city: '<string>',
contacts: [{identifierValue: '+5491122334455'}],
country: '<string>',
firstName: '<string>',
lastName: '<string>',
summary: '<string>',
tags: ['<string>']
})
};
fetch('https://api.trama.so/v1/customers/{customerId}', 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://api.trama.so/v1/customers/{customerId}",
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([
'city' => '<string>',
'contacts' => [
[
'identifierValue' => '+5491122334455'
]
],
'country' => '<string>',
'firstName' => '<string>',
'lastName' => '<string>',
'summary' => '<string>',
'tags' => [
'<string>'
]
]),
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://api.trama.so/v1/customers/{customerId}"
payload := strings.NewReader("{\n \"city\": \"<string>\",\n \"contacts\": [\n {\n \"identifierValue\": \"+5491122334455\"\n }\n ],\n \"country\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"summary\": \"<string>\",\n \"tags\": [\n \"<string>\"\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://api.trama.so/v1/customers/{customerId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"city\": \"<string>\",\n \"contacts\": [\n {\n \"identifierValue\": \"+5491122334455\"\n }\n ],\n \"country\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"summary\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trama.so/v1/customers/{customerId}")
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 \"city\": \"<string>\",\n \"contacts\": [\n {\n \"identifierValue\": \"+5491122334455\"\n }\n ],\n \"country\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"summary\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"city": "<string>",
"contacts": [
{
"displayName": "<string>",
"id": "<string>",
"identifierValue": "<string>",
"phoneNumber": "<string>"
}
],
"country": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"displayName": "<string>",
"firstName": "<string>",
"id": "<string>",
"lastName": "<string>",
"preferredLanguage": "<string>",
"summary": "<string>",
"tags": [
"<string>"
],
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "CATALOG_PRODUCT_NOT_FOUND",
"message": "The catalog product does not exist."
}
}{
"error": {
"code": "CATALOG_PRODUCT_NOT_FOUND",
"message": "The catalog product does not exist."
}
}{
"error": {
"code": "CATALOG_PRODUCT_NOT_FOUND",
"message": "The catalog product does not exist."
}
}{
"error": {
"code": "CATALOG_PRODUCT_NOT_FOUND",
"message": "The catalog product does not exist."
}
}{
"error": {
"code": "CATALOG_PRODUCT_NOT_FOUND",
"message": "The catalog product does not exist."
}
}Authorizations
bearerAuthapiKeyHeader
The organization API key, sent as Authorization: Bearer <key>.
Path Parameters
Body
application/json
At least one. The first in the list becomes the primary contact.
Minimum array length:
1Show child attributes
Show child attributes
Available options:
es, pt, en, null Response
The updated customer.
Show child attributes
Show child attributes
First and last name joined. Null when the person has not said their name yet — an anonymous lead is still a valid lead.
⌘I