Allo

Créer un attribut d'entreprise

Champ Type Requis Description ------- ------ -------- ------------- label string oui Nom affiché, de 1 à 255 caractères, avec au moins une lettre ou un…

POST/v2/api/crm/companies/attributes

Champs du body

ChampTypeRequisDescription
labelstringouiNom affiché, de 1 à 255 caractères, avec au moins une lettre ou un chiffre
typestringouiTEXT, NUMBER, DATE, BOOLEAN ou DROPDOWN
optionsarrayDROPDOWN uniquementAu moins un objet { label, key? }. Refusé pour les autres types
promptstringnonConsigne que l'AI CRM Manager suit pour remplir cet attribut à partir des appels
should_prompt_overridebooleannonIndique si l'IA peut écraser une valeur déjà renseignée

Dérivation de la clé

La key est dérivée du label : minuscules, accents supprimés, séquences de caractères non alphanumériques remplacées par _, tronquée à 64 caractères. Industry segment devient industry_segment. Les clés d'options sont dérivées de la même façon.

Un label qui correspond à une clé réservée est refusé avec ATTRIBUTE_KEY_RESERVED. Les clés réservées sont : id, name, phone_numbers, website, industry, logo_url, last_activity, activity_history, sms_content, created_at et updated_at.

Réponse

Renvoie 201 avec l'attribut créé. source vaut allo et already_existed vaut false.

{
  "data": {
    "key": "industry_segment",
    "label": "Industry segment",
    "type": "DROPDOWN",
    "options": [
      { "key": "smb", "label": "SMB" },
      { "key": "enterprise", "label": "Enterprise" }
    ],
    "is_visible": true,
    "prompt": "Choisis le segment correspondant à la taille de l'entreprise mentionnée pendant l'appel.",
    "should_prompt_override": false,
    "source": "allo",
    "created_at": "2026-10-07T14:21:08",
    "updated_at": "2026-10-07T14:21:08",
    "already_existed": false
  }
}

Créer deux fois le même attribut

L'appel peut être répété sans risque. Si un attribut avec la même clé et le même type existe déjà, l'endpoint renvoie 201 avec cet attribut et already_existed à true. Rien n'est créé et la définition existante reste inchangée. Si la clé existe avec un autre type, la requête renvoie 409 ATTRIBUTE_KEY_CONFLICT.

Limites

Chaque type dispose d'un nombre fixe d'emplacements par équipe. Lorsqu'un type est plein, créer un autre attribut de ce type renvoie 409 ATTRIBUTE_SLOTS_EXHAUSTED. Supprimez un attribut inutilisé ou choisissez un autre type.

Les attributs personnalisés ne sont disponibles que pour les équipes qui utilisent le nouveau modèle de contacts. Les autres équipes reçoivent 404 TEAM_NOT_FOUND.

Erreurs

StatutCodeQuand
400ATTRIBUTE_LABEL_INVALIDlabel est vide, dépasse 255 caractères ou ne contient ni lettre ni chiffre
400ATTRIBUTE_KEY_RESERVEDLe label correspond à une clé réservée
400ATTRIBUTE_OPTION_INVALIDUn attribut DROPDOWN n'a aucune option, ou un label d'option est vide, dépasse 255 caractères ou est en doublon
400ATTRIBUTE_OPTIONS_NOT_SUPPORTEDoptions envoyé pour un type autre que DROPDOWN
400INVALID_REQUEST_BODYtype est absent ou inconnu
403API_KEY_INSUFFICIENT_SCOPELa clé n'a pas le scope CRM_WRITE
404TEAM_NOT_FOUNDLe workspace n'utilise pas le nouveau modèle de contacts
409ATTRIBUTE_KEY_CONFLICTUn attribut avec cette clé existe déjà avec un autre type
409ATTRIBUTE_SLOTS_EXHAUSTEDAucun emplacement libre pour ce type
409ATTRIBUTE_CONCURRENT_MODIFICATIONLes attributs ont été modifiés en même temps. Relancez la requête

Autorisation

Authorizationstring · headerrequis

Api-Key ak_live_…

Corps

labelstringrequis

Display name of the attribute. The attribute key is derived from it: lowercase, accents removed, runs of non-alphanumeric characters replaced by _, truncated to 64 characters. Labels that resolve to a reserved key are rejected.

typeenum<string>requis

TEXTNUMBERDATEBOOLEANDROPDOWN

optionsobject[]

Allowed values. Required, with at least one option, for DROPDOWN; rejected for other types.

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.

promptstring | null

Instruction the AI CRM Manager follows to fill this attribute from calls. A blank value clears it.

should_prompt_overrideboolean

Whether the AI may overwrite a value that is already set

Réponses

201The attribute that was created, or the existing one when already_existed is true
dataobject

A custom attribute on companies

11 champs
keystring

Unique key within your team

labelstring | null

Display name

typeenum<string>

TEXTNUMBERDATEBOOLEANDROPDOWN

optionsobject[]

Allowed values. Only set for DROPDOWN attributes.

2 champs
keystring
labelstring
is_visibleboolean

Whether the attribute is shown in the Allo apps

promptstring | null

Instruction the AI CRM Manager follows to fill this attribute from calls. A blank value clears it.

should_prompt_overrideboolean | null

Whether the AI may overwrite a value that is already set

sourcestring

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

created_atstring<date-time>
updated_atstring<date-time>
already_existedboolean

true when an attribute with the same key and type already existed and nothing was created

400
401
403
404
409
429