> ## Documentation Index
> Fetch the complete documentation index at: https://help.withallo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Modifier une vue

> Partially updates a view: only the fields you send change. `filters: []` clears the filters. Updating a team view requires being its owner or a team ADMIN or MANAGER. Returns 400 `INVALID_REQUEST_BODY` (per-field `errors[]`) for a blank or too long `name` or more than 50 `filters`; `INVALID_FILTER_FIELD`, `INVALID_FILTER_OPERATOR`, `INVALID_FILTER_VALUE`, `INVALID_SORT_FIELD` or `FIELD_NOT_SORTABLE` for an invalid filter or sort; `USER_HAS_NO_TEAM` for `owner_type: TEAM` when the user has no team; 403 `VIEW_PERMISSION_DENIED` for a team view you do not own unless you are a team ADMIN or MANAGER; 404 `VIEW_NOT_FOUND` for a view you cannot see, such as another user's private view.

> [!NOTE]
>
> **Scope requis :** `CRM_WRITE`

Cet endpoint effectue une mise à jour partielle. Seuls les champs envoyés sont modifiés. Envoyez `filters: []` pour effacer les filtres.

## Champs du corps

| Champ | Type | Description |
| - | - | - |
| `name` | string | Nouveau nom affiché, 255 caractères maximum. Ne doit pas être vide s'il est envoyé |
| `filters` | array | Remplace toutes les conditions. `[]` les efface. 50 maximum |
| `sort` | array | Remplace le tri. 2 entrées maximum. `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](https://help.withallo.com/fr/v2/api-reference/crm/list-attributes.md) |
| `owner_type` | string | `USER` ou `TEAM` |

```json theme={null}
{ "name": "Acme leads" }
```

Modifier une vue d'équipe exige d'en être le propriétaire ou ADMIN ou MANAGER de l'équipe.

## Réponse

Renvoie `200` avec la vue mise à jour, au même format que [Obtenir une vue](https://help.withallo.com/fr/v2/api-reference/crm/get-view.md).

## Erreurs

| Statut | Code | Quand |
| - | - | - |
| `400` | `INVALID_REQUEST_BODY` | `name` est 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`) |
| `400` | `INVALID_FILTER_FIELD` | Le `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` |
| `400` | `INVALID_FILTER_OPERATOR` | L'`operator` d'un filtre ne correspond pas au type de son champ. Le message nomme le champ. `param` vaut `filters` |
| `400` | `INVALID_FILTER_VALUE` | La `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` |
| `400` | `INVALID_SORT_FIELD` | Le `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` |
| `400` | `FIELD_NOT_SORTABLE` | Le `field` d'un tri existe mais ne peut pas être trié. Utilisez un champ natif triable ou un champ personnalisé triable. `param` vaut `sort` |
| `400` | `USER_HAS_NO_TEAM` | `owner_type` vaut `TEAM` mais vous n'appartenez à aucune équipe. Utilisez `USER`. `param` vaut `owner_type` |
| `403` | `API_KEY_INSUFFICIENT_SCOPE` | La clé n'a pas le scope `CRM_WRITE` |
| `403` | `VIEW_PERMISSION_DENIED` | La vue est une vue d'équipe et vous n'en êtes ni le propriétaire ni ADMIN ou MANAGER de l'équipe |
| `404` | `VIEW_NOT_FOUND` | Aucune vue avec cet ID, ou vous ne pouvez pas la voir (par exemple la vue privée d'un autre utilisateur) |


## OpenAPI

````yaml PATCH /v2/api/crm/views/{id}
openapi: 3.0.3
info:
  title: Allo API
  description: >-
    Allo API provides programmatic access to your Allo account, allowing you to
    manage webhooks, retrieve calls and contacts, and send SMS messages.


    All requests to `/v1/api/**` endpoints automatically go through quota
    checking and scope validation.
  version: 1.0.0
  contact:
    name: Allo Support
servers:
  - url: https://api.withallo.com
    description: Production server
security: []
tags:
  - name: Summary Templates
    description: >-
      Manage call summary templates that control how AI-generated call summaries
      are structured for your team.
  - name: Webhooks
    description: >-
      Manage webhook endpoints to receive real-time notifications about events
      in your Allo account. Each endpoint subscribes to one or more event topics
      and is verified with a signing secret.
  - name: Calls
    description: >-
      Retrieve and search call records with filtering and pagination. Filter
      calls by your Allo phone number.
  - name: Contacts
    description: >-
      Search and retrieve contact information with sorting and pagination.
      Includes engagement level tracking.
  - name: SMS
    description: Send SMS messages to phone numbers using your Allo numbers.
  - name: Phone Numbers
    description: Retrieve information about your Allo phone numbers.
  - name: Analytics
    description: Pre-computed call metrics, team performance, and outbound dial funnel
  - name: CRM
    description: Manage people, companies, and deals in your CRM.
  - name: Notes
    description: >-
      Internal team notes on conversations and CRM people, with @mention
      support. Notes are never visible to the contact.
  - name: Threads
    description: >-
      Team discussion threads attached to a conversation item (call, SMS, or
      conversation note). One thread per item.
  - name: AI Receptionist
    description: >-
      Read and write the AI receptionist configuration of a phone line: business
      details, voice, prompt, capabilities, business hours, transfer rules,
      scheduling calendars and knowledge sources.
paths:
  /v2/api/crm/views/{id}:
    patch:
      tags:
        - CRM
      summary: Update contact view
      description: >-
        Partially updates a view: only the fields you send change. `filters: []`
        clears the filters. Updating a team view requires being its owner or a
        team ADMIN or MANAGER. Returns 400 `INVALID_REQUEST_BODY` (per-field
        `errors[]`) for a blank or too long `name` or more than 50 `filters`;
        `INVALID_FILTER_FIELD`, `INVALID_FILTER_OPERATOR`,
        `INVALID_FILTER_VALUE`, `INVALID_SORT_FIELD` or `FIELD_NOT_SORTABLE` for
        an invalid filter or sort; `USER_HAS_NO_TEAM` for `owner_type: TEAM`
        when the user has no team; 403 `VIEW_PERMISSION_DENIED` for a team view
        you do not own unless you are a team ADMIN or MANAGER; 404
        `VIEW_NOT_FOUND` for a view you cannot see, such as another user's
        private view.
      operationId: updateCrmView
      parameters:
        - name: id
          in: path
          required: true
          description: Public ID of the view, as returned by the list endpoint
          schema:
            type: string
            example: cvw_2abc
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCrmViewRequest'
            example:
              name: Acme leads
      responses:
        '200':
          description: The updated view
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CrmView'
              example:
                data:
                  id: cvw_2abc
                  name: Acme 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'
        '400':
          $ref: '#/components/responses/ApiValidationError'
        '401':
          $ref: '#/components/responses/ApiUnauthorized'
        '403':
          $ref: '#/components/responses/ApiForbidden'
        '404':
          $ref: '#/components/responses/ApiNotFound'
        '429':
          $ref: '#/components/responses/ApiRateLimited'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    UpdateCrmViewRequest:
      type: object
      description: >-
        All fields are optional. An omitted field is unchanged. `filters: []`
        clears the filters.
      properties:
        name:
          type: string
          maxLength: 255
          example: Hot leads
          description: New name. Must not be blank when sent
          pattern: \S
        filters:
          type: array
          description: Conditions combined with AND. At most 50
          items:
            $ref: '#/components/schemas/CrmViewFilter'
          maxItems: 50
        sort:
          type: array
          maxItems: 2
          items:
            $ref: '#/components/schemas/CrmViewSort'
          description: >-
            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
        owner_type:
          type: string
          enum:
            - USER
            - TEAM
          description: >-
            `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.
          example: USER
    CrmView:
      type: object
      description: >-
        A saved view: a named filter and sort over people. Views created in the
        Allo app and with the API are the same objects.
      properties:
        id:
          type: string
          description: Public ID of the view
          example: cvw_2abc
        name:
          type: string
          example: Hot leads
        filters:
          type: array
          items:
            $ref: '#/components/schemas/CrmViewFilter'
        sort:
          type: array
          items:
            $ref: '#/components/schemas/CrmViewSort'
        owner_type:
          type: string
          enum:
            - USER
            - TEAM
          description: >-
            `USER` is private to the API key's user. `TEAM` is shared with the
            user's team.
          example: USER
        user_id:
          type: string
          nullable: true
          description: ID of the user who owns a `USER` view
          example: usr_2abc
        team_id:
          type: string
          nullable: true
          description: ID of the team a `TEAM` view belongs to
        created_at:
          type: string
          example: '2026-10-23T10:00:00'
        updated_at:
          type: string
          example: '2026-10-23T10:00:00'
    CrmViewFilter:
      type: object
      required:
        - field
        - operator
        - value
      description: One condition of a view. All conditions of a view are combined with AND.
      properties:
        field:
          type: string
          description: >-
            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`
          example: company
        operator:
          type: string
          enum:
            - IS
            - IS_NOT
            - CONTAINS
            - NOT_CONTAINS
            - EMPTY
            - NOT_EMPTY
            - STARTS_WITH
            - ENDS_WITH
            - BEFORE
            - AFTER
            - DATE_EQUALS
            - GREATER_THAN
            - GREATER_THAN_OR_EQUAL
            - LESS_THAN
            - LESS_THAN_OR_EQUAL
            - HAS
          description: >-
            Comparison operator. It must match the type of the field, otherwise
            the request returns 400 `INVALID_FILTER_OPERATOR`
          example: CONTAINS
        value:
          type: string
          description: >-
            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`
          example: Acme
    CrmViewSort:
      type: object
      required:
        - field
        - order
      properties:
        field:
          type: string
          description: >-
            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`
          example: created_at
        order:
          type: string
          enum:
            - asc
            - desc
          example: desc
    ApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
            code:
              type: string
            message:
              type: string
            retryable:
              type: boolean
            request_id:
              type: string
            retry_after_seconds:
              type: integer
              nullable: true
  responses:
    ApiValidationError:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ApiUnauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ApiForbidden:
      description: API key lacks the required scope or access to the resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ApiNotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ApiRateLimited:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.