# Edit Contact

## URL

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

#### **Parameters**

| Name        | Value                                                                          |
| ----------- | ------------------------------------------------------------------------------ |
| `apiKey`    | [Your API key](https://my.smspartner.fr/dashboard/api)                         |
| `contactId` | The ID of the contact to be updated                                            |
| `firstname` | First name (max 32 characters)                                                 |
| `lastname`  | Last name (max 32 characters)                                                  |
| `date`      | Date in format YYYY-MM-DD. Can be used for automatic messages (e.g. birthdays) |
| `url`       | URL, must start with http\:// or https\://                                     |
| `custom1`   | Custom field 1                                                                 |
| `custom2`   | Custom field 2                                                                 |
| `custom3`   | Custom field 3                                                                 |
| `custom4`   | Custom field 4                                                                 |

#### Request

{% 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 %}

#### **Response**

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

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

{% endtab %}
{% endtabs %}

#### Errors

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

```json
{
  "success": false,
  "code": 10,
  "message": "Invalid API key"
}
```

{% endtab %}
{% endtabs %}

**Error Codes**

| Response Code | Message                                |
| ------------- | -------------------------------------- |
| 1             | groupId is required                    |
| 2             | Contact information is required        |
| 10            | API key is required                    |
| 15            | The number already exists in the group |


---

# 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/en/api/sms-partner/contact-management/edit-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.
