Allo

Mettre à jour un champ personnalisé

Cet endpoint effectue une mise à jour partielle. Seuls les champs envoyés sont modifiés. key et type ne peuvent pas être modifiés.

PATCH/v2/api/crm/attributes/{key}

Cet endpoint effectue une mise à jour partielle. Seuls les champs envoyés sont modifiés. key et type ne peuvent pas être modifiés.

Champs du body

ChampTypeDescription
labelstringNouveau nom affiché
descriptionstringDescription du champ. Une valeur vide l'efface
optionsarrayRemplace 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 sa key 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 la source 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

Renvoie 200 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

StatutCodeQuand
400ATTRIBUTE_LABEL_INVALIDlabel est vide, dépasse 255 caractères ou ne contient ni lettre ni chiffre
400ATTRIBUTE_OPTION_INVALIDUn label d'option est vide, dépasse 255 caractères ou est en doublon
400ATTRIBUTE_OPTIONS_NOT_SUPPORTEDoptions envoyé pour un champ qui n'est pas DROPDOWN
400ATTRIBUTE_BUILT_INLa clé est celle d'un champ natif, pas d'un champ personnalisé
403API_KEY_INSUFFICIENT_SCOPELa clé n'a pas le scope CRM_WRITE
404TEAM_NOT_FOUNDL'espace de travail n'utilise pas le nouveau modèle de contacts
404ATTRIBUTE_NOT_FOUNDAucun champ avec cette clé, ou le champ a été supprimé
409ATTRIBUTE_MANAGED_BY_INTEGRATIONLe champ est géré par une intégration CRM

Autorisation

Authorizationstring · headerrequis

Api-Key ak_live_…

Paramètres de chemin

keystringrequis

Field key, as returned by the list endpoint

Corps

labelstring

New display name. The key does not change.

descriptionstring

Free-text description of the field. A blank value clears it.

optionsobject[]

Replaces the full option list. DROPDOWN fields only. Send an option's current key to keep it when renaming its label.

2 champs
labelstringrequis

Display name of the option

keystring

Existing option key. Send it when editing an attribute to keep the option's key stable while its label changes. Keys that do not match an existing option are ignored and a key is derived from the label.

Réponses

200The updated field
dataobject

A custom field on people

5 champs
keystring

Unique key of the field within your team

labelstring | null

Display name of the field

typeenum<string>

Value type

TEXTNUMBERDATEBOOLEANDROPDOWN

optionsobject[]

Allowed values. Only set for DROPDOWN fields.

2 champs
keystring
labelstring
sourcestring

allo for fields created in Allo or with the API, otherwise the lowercase name of the integration that manages it, such as hubspot

400
401
403
404
409
429