Allo

Créer une vue

Champ Type Requis Description ------- ------ -------- ------------- name string oui Nom affiché, 255 caractères maximum filters array non Conditions …

POST/v2/api/crm/views

Champs du corps

ChampTypeRequisDescription
namestringouiNom affiché, 255 caractères maximum
filtersarraynonConditions { field, operator, value }, combinées avec ET. 50 maximum
sortarraynon2 entrées { field, order } maximum. order vaut asc ou desc. field est un champ natif triable (name, company, job_title, website, created_at, updated_at, last_activity) ou la key d'un champ personnalisé triable issue de Lister les champs personnalisés
owner_typestringnonUSER (défaut, privée) ou TEAM (partagée avec votre équipe)
{
  "name": "Hot leads",
  "filters": [
    {
      "field": "company",
      "operator": "CONTAINS",
      "value": "Acme"
    }
  ],
  "sort": [
    {
      "field": "created_at",
      "order": "desc"
    }
  ],
  "owner_type": "USER"
}

Voir Filtres pour les champs et opérateurs utilisables.

Réponse

Renvoie 201 avec la vue.

{
  "data": {
    "id": "cvw_2abc",
    "name": "Hot leads",
    "filters": [
      {
        "field": "company",
        "operator": "CONTAINS",
        "value": "Acme"
      }
    ],
    "sort": [
      {
        "field": "created_at",
        "order": "desc"
      }
    ],
    "owner_type": "USER",
    "user_id": "usr_2abc",
    "team_id": null,
    "created_at": "2026-10-23T10:00:00",
    "updated_at": "2026-10-23T10:00:00"
  }
}

Erreurs

StatutCodeQuand
400INVALID_REQUEST_BODYname est absent, vide ou dépasse 255 caractères, filters compte plus de 50 entrées, ou owner_type n'est ni USER ni TEAM. Les erreurs par champ sont listées dans errors[] avec le field (name ou filters)
400INVALID_FILTER_FIELDLe field d'un filtre n'est ni un champ natif d'une personne ni la key d'un champ personnalisé issue de GET /v2/api/crm/attributes. param vaut filters
400INVALID_FILTER_OPERATORL'operator d'un filtre ne correspond pas au type de son champ. Le message nomme le champ. param vaut filters
400INVALID_FILTER_VALUELa value d'un filtre n'est pas lisible pour le type de son champ : un champ nombre attend une valeur numérique, un champ date attend une date ISO 8601 comme 2026-01-31 ou 2026-01-31T00:00:00Z. Le message nomme la valeur et le champ. param vaut filters
400INVALID_SORT_FIELDLe field d'un tri n'est ni un champ natif ni la key d'un champ personnalisé issue de GET /v2/api/crm/attributes. param vaut sort
400FIELD_NOT_SORTABLELe field d'un tri existe mais ne peut pas être trié. Utilisez un champ natif triable ou un champ personnalisé triable. param vaut sort
400USER_HAS_NO_TEAMowner_type vaut TEAM mais vous n'appartenez à aucune équipe. Utilisez USER. param vaut owner_type
403API_KEY_INSUFFICIENT_SCOPELa clé n'a pas le scope CRM_WRITE

Autorisation

Authorizationstring · headerrequis

Api-Key ak_live_…

Corps

namestringrequis
filtersobject[]

Conditions combined with AND. At most 50

3 champs
fieldstringrequis

A built-in person field (name, company, job_title, emails, phone_numbers, website, addresses, created_at, updated_at, last_activity, activity_history, sms_content (only when the team has SMS)) or the key of a custom field from GET /v2/api/crm/attributes. An unknown field returns 400 INVALID_FILTER_FIELD

operatorenum<string>requis

Comparison operator. It must match the type of the field, otherwise the request returns 400 INVALID_FILTER_OPERATOR

ISIS_NOTCONTAINSNOT_CONTAINSEMPTYNOT_EMPTYSTARTS_WITHENDS_WITHBEFOREAFTERDATE_EQUALSGREATER_THANGREATER_THAN_OR_EQUALLESS_THANLESS_THAN_OR_EQUALHAS

valuestringrequis

Value to compare to. It must be readable for the type of the field, otherwise the request returns 400 INVALID_FILTER_VALUE: numeric for a number field, an ISO 8601 date such as 2026-01-31 or date-time such as 2026-01-31T00:00:00Z for a date field. Ignored for EMPTY and NOT_EMPTY

sortobject[]

Up to 2 entries. Sortable built-in fields: name, company, job_title, website, created_at, updated_at, last_activity. A sortable custom field key from GET /v2/api/crm/attributes also works

2 champs
fieldstringrequis

A sortable built-in person field (name, company, job_title, website, created_at, updated_at, last_activity) or the key of a sortable custom field from GET /v2/api/crm/attributes

orderenum<string>requis

ascdesc

owner_typeenum<string>

USER is private to the API key's user. TEAM is shared with the user's team; it returns 400 USER_HAS_NO_TEAM when the user has no team.

USERTEAM

Réponses

201The view that was created
dataobject

A saved view: a named filter and sort over people. Views created in the Allo app and with the API are the same objects.

9 champs
idstring

Public ID of the view

namestring
filtersobject[]
3 champs
fieldstringrequis

A built-in person field (name, company, job_title, emails, phone_numbers, website, addresses, created_at, updated_at, last_activity, activity_history, sms_content (only when the team has SMS)) or the key of a custom field from GET /v2/api/crm/attributes. An unknown field returns 400 INVALID_FILTER_FIELD

operatorenum<string>requis

Comparison operator. It must match the type of the field, otherwise the request returns 400 INVALID_FILTER_OPERATOR

ISIS_NOTCONTAINSNOT_CONTAINSEMPTYNOT_EMPTYSTARTS_WITHENDS_WITHBEFOREAFTERDATE_EQUALSGREATER_THANGREATER_THAN_OR_EQUALLESS_THANLESS_THAN_OR_EQUALHAS

valuestringrequis

Value to compare to. It must be readable for the type of the field, otherwise the request returns 400 INVALID_FILTER_VALUE: numeric for a number field, an ISO 8601 date such as 2026-01-31 or date-time such as 2026-01-31T00:00:00Z for a date field. Ignored for EMPTY and NOT_EMPTY

sortobject[]
2 champs
fieldstringrequis

A sortable built-in person field (name, company, job_title, website, created_at, updated_at, last_activity) or the key of a sortable custom field from GET /v2/api/crm/attributes

orderenum<string>requis

ascdesc

owner_typeenum<string>

USER is private to the API key's user. TEAM is shared with the user's team.

USERTEAM

user_idstring | null

ID of the user who owns a USER view

team_idstring | null

ID of the team a TEAM view belongs to

created_atstring
updated_atstring
400
401
403
429