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