Update custom contact field
curl --request PATCH \
--url https://api.withallo.com/v2/api/crm/attributes/{key} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "Lead temperature",
"options": [
{
"key": "hot",
"label": "Hot"
},
{
"label": "Warm"
},
{
"key": "cold",
"label": "Cold"
}
]
}
'import requests
url = "https://api.withallo.com/v2/api/crm/attributes/{key}"
payload = {
"label": "Lead temperature",
"options": [
{
"key": "hot",
"label": "Hot"
},
{ "label": "Warm" },
{
"key": "cold",
"label": "Cold"
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: 'Lead temperature',
options: [{key: 'hot', label: 'Hot'}, {label: 'Warm'}, {key: 'cold', label: 'Cold'}]
})
};
fetch('https://api.withallo.com/v2/api/crm/attributes/{key}', 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.withallo.com/v2/api/crm/attributes/{key}",
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([
'label' => 'Lead temperature',
'options' => [
[
'key' => 'hot',
'label' => 'Hot'
],
[
'label' => 'Warm'
],
[
'key' => 'cold',
'label' => 'Cold'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.withallo.com/v2/api/crm/attributes/{key}"
payload := strings.NewReader("{\n \"label\": \"Lead temperature\",\n \"options\": [\n {\n \"key\": \"hot\",\n \"label\": \"Hot\"\n },\n {\n \"label\": \"Warm\"\n },\n {\n \"key\": \"cold\",\n \"label\": \"Cold\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<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.patch("https://api.withallo.com/v2/api/crm/attributes/{key}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"Lead temperature\",\n \"options\": [\n {\n \"key\": \"hot\",\n \"label\": \"Hot\"\n },\n {\n \"label\": \"Warm\"\n },\n {\n \"key\": \"cold\",\n \"label\": \"Cold\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/crm/attributes/{key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"Lead temperature\",\n \"options\": [\n {\n \"key\": \"hot\",\n \"label\": \"Hot\"\n },\n {\n \"label\": \"Warm\"\n },\n {\n \"key\": \"cold\",\n \"label\": \"Cold\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"key": "lead_status",
"label": "Lead temperature",
"type": "DROPDOWN",
"options": [
{
"key": "hot",
"label": "Hot"
},
{
"key": "warm",
"label": "Warm"
},
{
"key": "cold",
"label": "Cold"
}
],
"source": "allo"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}Champs personnalisés
Mettre à jour un champ personnalisé
Partially updates a custom field on people: only the fields you send change. key and type cannot be changed. Fields synced from a CRM integration cannot be edited.
PATCH
/
v2
/
api
/
crm
/
attributes
/
{key}
Update custom contact field
curl --request PATCH \
--url https://api.withallo.com/v2/api/crm/attributes/{key} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "Lead temperature",
"options": [
{
"key": "hot",
"label": "Hot"
},
{
"label": "Warm"
},
{
"key": "cold",
"label": "Cold"
}
]
}
'import requests
url = "https://api.withallo.com/v2/api/crm/attributes/{key}"
payload = {
"label": "Lead temperature",
"options": [
{
"key": "hot",
"label": "Hot"
},
{ "label": "Warm" },
{
"key": "cold",
"label": "Cold"
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: 'Lead temperature',
options: [{key: 'hot', label: 'Hot'}, {label: 'Warm'}, {key: 'cold', label: 'Cold'}]
})
};
fetch('https://api.withallo.com/v2/api/crm/attributes/{key}', 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.withallo.com/v2/api/crm/attributes/{key}",
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([
'label' => 'Lead temperature',
'options' => [
[
'key' => 'hot',
'label' => 'Hot'
],
[
'label' => 'Warm'
],
[
'key' => 'cold',
'label' => 'Cold'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.withallo.com/v2/api/crm/attributes/{key}"
payload := strings.NewReader("{\n \"label\": \"Lead temperature\",\n \"options\": [\n {\n \"key\": \"hot\",\n \"label\": \"Hot\"\n },\n {\n \"label\": \"Warm\"\n },\n {\n \"key\": \"cold\",\n \"label\": \"Cold\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<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.patch("https://api.withallo.com/v2/api/crm/attributes/{key}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"Lead temperature\",\n \"options\": [\n {\n \"key\": \"hot\",\n \"label\": \"Hot\"\n },\n {\n \"label\": \"Warm\"\n },\n {\n \"key\": \"cold\",\n \"label\": \"Cold\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/crm/attributes/{key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"Lead temperature\",\n \"options\": [\n {\n \"key\": \"hot\",\n \"label\": \"Hot\"\n },\n {\n \"label\": \"Warm\"\n },\n {\n \"key\": \"cold\",\n \"label\": \"Cold\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"key": "lead_status",
"label": "Lead temperature",
"type": "DROPDOWN",
"options": [
{
"key": "hot",
"label": "Hot"
},
{
"key": "warm",
"label": "Warm"
},
{
"key": "cold",
"label": "Cold"
}
],
"source": "allo"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}Scope requis :
CRM_WRITEkey et type ne peuvent pas être modifiés.
Champs du body
| Champ | Type | Description |
|---|---|---|
label | string | Nouveau nom affiché |
description | string | Description du champ. Une valeur vide l’efface |
options | array | Remplace toute la liste d’options avec des objets { label, key? }. Champs DROPDOWN uniquement |
Renommer des options
Les clés d’options restent stables. Pour renommer une option, envoyez sakey actuelle avec le nouveau label. Une option envoyée sans key correspondante est considérée comme nouvelle et reçoit une clé dérivée de son label. Les options absentes de la liste sont supprimées.
Champs synchronisés depuis un CRM
Un champ dont lasource n’est pas allo est géré par votre intégration CRM et ne peut pas être modifié. Toute mise à jour renvoie 409 ATTRIBUTE_MANAGED_BY_INTEGRATION. Les champs natifs comme name ou company renvoient 400 ATTRIBUTE_BUILT_IN.
Réponse
Renvoie200 avec le champ mis à jour, dans le même format que Lister les champs personnalisés.
{
"data": {
"key": "lead_status",
"label": "Lead temperature",
"type": "DROPDOWN",
"options": [
{ "key": "hot", "label": "Hot" },
{ "key": "warm", "label": "Warm" },
{ "key": "cold", "label": "Cold" }
],
"source": "allo"
}
}
Erreurs
| Statut | Code | Quand |
|---|---|---|
400 | ATTRIBUTE_LABEL_INVALID | label est vide, dépasse 255 caractères ou ne contient ni lettre ni chiffre |
400 | ATTRIBUTE_OPTION_INVALID | Un label d’option est vide, dépasse 255 caractères ou est en doublon |
400 | ATTRIBUTE_OPTIONS_NOT_SUPPORTED | options envoyé pour un champ qui n’est pas DROPDOWN |
400 | ATTRIBUTE_BUILT_IN | La clé est celle d’un champ natif, pas d’un champ personnalisé |
403 | API_KEY_INSUFFICIENT_SCOPE | La clé n’a pas le scope CRM_WRITE |
404 | TEAM_NOT_FOUND | L’espace de travail n’utilise pas le nouveau modèle de contacts |
404 | ATTRIBUTE_NOT_FOUND | Aucun champ avec cette clé, ou le champ a été supprimé |
409 | ATTRIBUTE_MANAGED_BY_INTEGRATION | Le champ est géré par une intégration CRM |
Autorisations
Paramètres de chemin
Field key, as returned by the list endpoint
Exemple:
"lead_status"
Corps
application/json
All fields are optional
Réponse
The updated field
A custom field on people
Show child attributes
Show child attributes
Cette page vous a-t-elle été utile ?