> ## 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.

# 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.

<Note>
  **Scope requis :** `CRM_WRITE`
</Note>

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

| 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 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](/fr/v2/api-reference/crm/list-attributes).

```json theme={null}
{
  "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 |


## OpenAPI

````yaml PATCH /v2/api/crm/attributes/{key}
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/attributes/{key}:
    patch:
      tags:
        - CRM
      summary: Update custom contact field
      description: >-
        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.
      operationId: updateCrmAttribute
      parameters:
        - name: key
          in: path
          required: true
          description: Field key, as returned by the list endpoint
          schema:
            type: string
            example: lead_status
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCrmAttributeRequest'
            example:
              label: Lead temperature
              options:
                - key: hot
                  label: Hot
                - label: Warm
                - key: cold
                  label: Cold
      responses:
        '200':
          description: The updated field
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CrmAttribute'
              example:
                data:
                  key: lead_status
                  label: Lead temperature
                  type: DROPDOWN
                  options:
                    - key: hot
                      label: Hot
                    - key: warm
                      label: Warm
                    - key: cold
                      label: Cold
                  source: allo
        '400':
          $ref: '#/components/responses/ApiValidationError'
        '401':
          $ref: '#/components/responses/ApiUnauthorized'
        '403':
          $ref: '#/components/responses/ApiForbidden'
        '404':
          $ref: '#/components/responses/ApiNotFound'
        '409':
          $ref: '#/components/responses/ApiConflict'
        '429':
          $ref: '#/components/responses/ApiRateLimited'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    UpdateCrmAttributeRequest:
      type: object
      description: All fields are optional
      properties:
        label:
          type: string
          description: New display name. The key does not change.
        description:
          type: string
          description: Free-text description of the field. A blank value clears it.
        options:
          type: array
          description: >-
            Replaces the full option list. `DROPDOWN` fields only. Send an
            option's current `key` to keep it when renaming its label.
          items:
            $ref: '#/components/schemas/CompanyAttributeOptionInput'
    CrmAttribute:
      type: object
      description: A custom field on people
      properties:
        key:
          type: string
          description: Unique key of the field within your team
          example: budget
        label:
          type: string
          nullable: true
          description: Display name of the field
          example: Budget
        type:
          type: string
          nullable: true
          enum:
            - TEXT
            - NUMBER
            - DATE
            - BOOLEAN
            - DROPDOWN
          description: Value type
          example: NUMBER
        options:
          type: array
          nullable: true
          description: Allowed values. Only set for `DROPDOWN` fields.
          items:
            $ref: '#/components/schemas/CompanyAttributeOption'
        source:
          type: string
          description: >-
            `allo` for fields created in Allo or with the API, otherwise the
            lowercase name of the integration that manages it, such as `hubspot`
          example: allo
    CompanyAttributeOptionInput:
      type: object
      required:
        - label
      properties:
        label:
          type: string
          description: Display name of the option
          example: Enterprise
        key:
          type: string
          description: >-
            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.
          example: enterprise
    CompanyAttributeOption:
      type: object
      properties:
        key:
          type: string
          example: enterprise
        label:
          type: string
          example: Enterprise
    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'
    ApiConflict:
      description: Conflict with existing resource
      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.