# Modifier un contact

## URL

<mark style="color:green;">`POST`</mark> `https://api.smspartner.fr/v1/contact/update`

#### **Paramètres**

<table><thead><tr><th width="262">Nom</th><th>Valeur</th></tr></thead><tbody><tr><td><code>apiKey</code></td><td><a href="https://my.smspartner.fr/dashboard/api">Votre clé API</a></td></tr><tr><td><code>contactId</code></td><td>L'id du contact à modifier</td></tr><tr><td><code>firstname</code></td><td>Prénom (32 caractères max.)</td></tr><tr><td><code>lastname</code></td><td>Nomm (32 caractères max.)</td></tr><tr><td><code>date</code></td><td>Date au format YYYY-MM-DD. Pourra être utilisé pour des envois automatique (ex: anniversaire )</td></tr><tr><td><code>url</code></td><td>Url , elle doit commencer par http:// ou https://</td></tr><tr><td><code>custom1</code></td><td>Champ personnalisé 1</td></tr><tr><td><code>custom2</code></td><td>Champ personnalisé 2</td></tr><tr><td><code>custom3</code></td><td>Champ personnalisé 3</td></tr><tr><td><code>custom4</code></td><td>Champ personnalisé 4</td></tr></tbody></table>

#### Requête

{% tabs %}
{% tab title="Exemple" %}

```
{
  "url": "http://api.smspartner.fr/v1/contact/update",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json"
  },
  "data": {
    "apiKey": "YOUR_API_KEY",
    "contactId": "ID CONTACT",
    "contact": {
      "phoneNumber": "+xxxxxxxxx",
      "firstname": "prénom",
      "lastname": "nom",
      "url": "",
      "date": "12-06-2020",
      "custom2": "custom2"
    }
  }
}
```

{% endtab %}
{% endtabs %}

#### **Réponse**

{% tabs %}
{% tab title="json" %}

```json
{
  "success": true,
  "code": 200,
  "contact": {
    "phoneNumber": "+xxxxxxxx",
    "firstname": "prénom",
    "lastname": "nom",
    "url": "",
    "date": "12-06-2020",
    "custom2": "custom2",
    "contactId": "ID CONTACT"
  }
}
```

{% endtab %}
{% endtabs %}

#### Erreurs

{% tabs %}
{% tab title="json" %}

```json
{
  "success": false,
  "code": 10,
  "message": "Clef API incorrecte"
}
```

{% endtab %}
{% endtabs %}

#### **Code erreurs**

<table><thead><tr><th width="234">Code de réponse</th><th>Réponse</th></tr></thead><tbody><tr><td>1</td><td>Le groupId est requis</td></tr><tr><td>2</td><td>Les infos du contact sont requises</td></tr><tr><td>10</td><td>La Clé API est requise</td></tr><tr><td>15</td><td>Le numéro est déjà dans le groupe</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.docpartner.dev/api/sms-partner/gestion-des-contacts/modifier-un-contact.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
