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

# Mettre à jour un contact

> Mettre à jour partiellement un contact

## Autorisation

<ParamField header="Authorization" type="string" required>
  Jeton Bearer. Format : `Bearer qwoty_your_token`
</ParamField>

## Paramètres de chemin

<ParamField path="id" type="string" required>
  UUID du contact à mettre à jour
</ParamField>

## Corps de la requête

Tous les champs sont optionnels. Seuls les champs fournis seront mis à jour.

<ParamField body="first_name" type="string">
  Prénom du contact
</ParamField>

<ParamField body="last_name" type="string">
  Nom du contact
</ParamField>

<ParamField body="email" type="string">
  Adresse e-mail
</ParamField>

<ParamField body="phone" type="string | null">
  Numéro de téléphone. Définir à `null` pour effacer.
</ParamField>

<ParamField body="role" type="array">
  Rôles assignés. Valeurs autorisées : `"buyer"`, `"signer"`, `"billing"`,
  `"shipping"`, `"legal"`, `"admin"`
</ParamField>

<ParamField body="id_crm" type="string | null">
  ID CRM externe
</ParamField>

<ParamField body="id_erp" type="string | null">
  ID ERP externe
</ParamField>

<ParamField body="id_accounting" type="string | null">
  ID comptabilité externe
</ParamField>

<Note>`customer_id` ne peut pas être modifié après la création.</Note>

## Exemples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PATCH https://qwoty.app/api/contacts/660e8400-e29b-41d4-a716-446655440001 \
    -H "Authorization: Bearer qwoty_your_token" \
    -H "Content-Type: application/json" \
    -d '{
      "phone": "+33 6 99 88 77 66",
      "role": ["buyer", "billing"]
    }'
  ```

  ```javascript JavaScript theme={null}
  const contactId = '660e8400-e29b-41d4-a716-446655440001'

  const response = await fetch(`https://qwoty.app/api/contacts/${contactId}`, {
    method: 'PATCH',
    headers: {
      Authorization: 'Bearer qwoty_your_token',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      phone: '+33 6 99 88 77 66',
      role: ['buyer', 'billing'],
    }),
  })
  const data = await response.json()
  ```

  ```python Python theme={null}
  import requests

  contact_id = '660e8400-e29b-41d4-a716-446655440001'

  response = requests.patch(
      f'https://qwoty.app/api/contacts/{contact_id}',
      headers={
          'Authorization': 'Bearer qwoty_your_token',
          'Content-Type': 'application/json',
      },
      json={'phone': '+33 6 99 88 77 66', 'role': ['buyer', 'billing']},
  )
  data = response.json()
  ```
</CodeGroup>

## Réponse

<ResponseField name="success" type="boolean">
  `true` si la mise à jour a réussi
</ResponseField>

<ResponseField name="data" type="object">
  L'objet contact mis à jour (même structure que [Obtenir un
  contact](/api-reference/contacts/get))
</ResponseField>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "success": true,
    "data": {
      "id": "660e8400-e29b-41d4-a716-446655440001",
      "customer_id": "550e8400-e29b-41d4-a716-446655440000",
      "first_name": "Jean",
      "last_name": "Dupont",
      "email": "jean.dupont@acme.com",
      "phone": "+33 6 99 88 77 66",
      "role": ["buyer", "billing"],
      "id_crm": null,
      "id_erp": null,
      "id_accounting": null,
      "created_at": "2026-01-15T10:30:00Z",
      "updated_at": "2026-03-24T14:00:00Z"
    }
  }
  ```

  ```json Not Found theme={null}
  {
    "success": false,
    "error": "Contact not found"
  }
  ```
</ResponseExample>
