> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.goodflag.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.goodflag.com/_mcp/server.

# Modifier un contact

PATCH https://workflow-manager/api/contacts/{contactId}
Content-Type: application/json

Modifie un contact existant.

Aucun. Autorisés : le propriétaire.

Reference: https://docs.goodflag.com/wm/api-reference/documentation-api/token-portail/contacts/update-contact

## Authentication

- `Authorization` header (bearer token, required) — Authentification Bearer par jeton utilisateur ou jeton d'accès : `Authorization: Bearer <token>`.

## Request

### Path parameters

- `contactId` (string, required) — L'identifiant du contact.

### Headers

- `If-Match` (string, required) — L'ETag de la ressource, pour le contrôle de concurrence optimiste.

### Body (application/json)

This endpoint expects an object.

- `email` (string, optional) — L'adresse email du contact.
- `phoneNumber` (string, optional) — Le numéro de téléphone international du contact.
- `comments` (string, optional) — Les commentaires associés au contact.
- `firstName` (string, optional) — Le prénom du contact.
- `lastName` (string, optional) — Le nom du contact.
- `country` (string, optional) — Le pays du contact.

## Response

### 200

L'entité Contact mise à jour.

- `country` (string, required) — Le pays du contact.
- `created` (long, required) — La date de création de l'entité.
- `email` (string, required) — L'adresse email du contact.
- `firstName` (string, required) — Le prénom du contact.
- `id` (string, required) — L'identifiant du contact.
- `lastName` (string, required) — Le nom du contact.
- `name` (string, required) — Le nom complet du contact.
- `phoneNumber` (string, required) — Le numéro de téléphone international du contact.
- `tenantId` (string, required) — L'identifiant du tenant auquel appartient le contact.
- `updated` (long, required) — La date de dernière modification de l'entité.
- `userId` (string, required) — L'identifiant de l'utilisateur auquel appartient le contact.
- `comments` (string, optional) — Les commentaires associés au contact.

## Errors

### 400 Bad Request Error

InvalidEmailValue : Adresse email invalide. Utilisez un format standard sans caractères accentués, par exemple user@example.com. ; InvalidRequestField : Un champ de la requête porte une valeur incorrecte.

- `status` (integer, required) — Le code de statut HTTP.
- `error` (string, required) — Le message de statut HTTP.
- `message` (string, required) — Le message d'erreur.
- `code` (string, required) — Le code d'erreur.

### 403 Forbidden Error

AuthenticatedUserDisabled : L'utilisateur authentifié est désactivé. ; MissingBearerToken : Un jeton Bearer est requis. ; TenantInactive : Le tenant est inactif et n'autorise aucune opération. ; UserGroupDisabled : Le groupe de l'utilisateur spécifié est désactivé. ; UserNotAllowed : L'utilisateur authentifié n'est pas autorisé à effectuer cette opération.

- `status` (integer, required) — Le code de statut HTTP.
- `error` (string, required) — Le message de statut HTTP.
- `message` (string, required) — Le message d'erreur.
- `code` (string, required) — Le code d'erreur.

### 404 Not Found Error

ContactNotFound : Le contact spécifié est introuvable.

- `status` (integer, required) — Le code de statut HTTP.
- `error` (string, required) — Le message de statut HTTP.
- `message` (string, required) — Le message d'erreur.
- `code` (string, required) — Le code d'erreur.

### 409 Conflict Error

EntityLocked : L'entité est en cours de mise à jour.

- `status` (integer, required) — Le code de statut HTTP.
- `error` (string, required) — Le message de statut HTTP.
- `message` (string, required) — Le message d'erreur.
- `code` (string, required) — Le code d'erreur.

### 412 Precondition Failed Error

ConditionalUpdateFailed : Une condition de la requête de mise à jour n'est pas satisfaite.

- `status` (integer, required) — Le code de statut HTTP.
- `error` (string, required) — Le message de statut HTTP.
- `message` (string, required) — Le message d'erreur.
- `code` (string, required) — Le code d'erreur.

## Examples

**Request**

```json
{
  "email": "avery.thompson8848@my-company.com",
  "phoneNumber": "+33 6 12 34 56 78",
  "comments": "Accusamus nihil nisi magnam temporibus et odit alias.",
  "firstName": "Louis",
  "lastName": "Marie",
  "country": "FR"
}
```

**Response**

```json
{
  "country": "FR",
  "created": 1782821797838,
  "email": "avery.thompson8848@my-company.com",
  "firstName": "Louis",
  "id": "con_CWzc1YmShH2uu3iGnKaLUrKj",
  "lastName": "Marie",
  "name": "Louis Marie",
  "phoneNumber": "+33 6 12 34 56 78",
  "tenantId": "ten_Hm5gqY6oKADYdg9cjhsVbQDH",
  "updated": 1782821797862,
  "userId": "usr_JCwoLDH99mzqizvqyAYJx4gV",
  "comments": "Accusamus nihil nisi magnam temporibus et odit alias."
}
```

**SDK Code**

```python Requête réussie.
import requests

url = "https://workflow-manager/api/contacts/contactId"

payload = {
    "email": "avery.thompson8848@my-company.com",
    "phoneNumber": "+33 6 12 34 56 78",
    "comments": "Accusamus nihil nisi magnam temporibus et odit alias.",
    "firstName": "Louis",
    "lastName": "Marie",
    "country": "FR"
}
headers = {
    "If-Match": "If-Match",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Requête réussie.
const url = 'https://workflow-manager/api/contacts/contactId';
const options = {
  method: 'PATCH',
  headers: {
    'If-Match': 'If-Match',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"email":"avery.thompson8848@my-company.com","phoneNumber":"+33 6 12 34 56 78","comments":"Accusamus nihil nisi magnam temporibus et odit alias.","firstName":"Louis","lastName":"Marie","country":"FR"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Requête réussie.
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://workflow-manager/api/contacts/contactId"

	payload := strings.NewReader("{\n  \"email\": \"avery.thompson8848@my-company.com\",\n  \"phoneNumber\": \"+33 6 12 34 56 78\",\n  \"comments\": \"Accusamus nihil nisi magnam temporibus et odit alias.\",\n  \"firstName\": \"Louis\",\n  \"lastName\": \"Marie\",\n  \"country\": \"FR\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("If-Match", "If-Match")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Requête réussie.
require 'uri'
require 'net/http'

url = URI("https://workflow-manager/api/contacts/contactId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["If-Match"] = 'If-Match'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"email\": \"avery.thompson8848@my-company.com\",\n  \"phoneNumber\": \"+33 6 12 34 56 78\",\n  \"comments\": \"Accusamus nihil nisi magnam temporibus et odit alias.\",\n  \"firstName\": \"Louis\",\n  \"lastName\": \"Marie\",\n  \"country\": \"FR\"\n}"

response = http.request(request)
puts response.read_body
```

```java Requête réussie.
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://workflow-manager/api/contacts/contactId")
  .header("If-Match", "If-Match")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"email\": \"avery.thompson8848@my-company.com\",\n  \"phoneNumber\": \"+33 6 12 34 56 78\",\n  \"comments\": \"Accusamus nihil nisi magnam temporibus et odit alias.\",\n  \"firstName\": \"Louis\",\n  \"lastName\": \"Marie\",\n  \"country\": \"FR\"\n}")
  .asString();
```

```php Requête réussie.
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://workflow-manager/api/contacts/contactId', [
  'body' => '{
  "email": "avery.thompson8848@my-company.com",
  "phoneNumber": "+33 6 12 34 56 78",
  "comments": "Accusamus nihil nisi magnam temporibus et odit alias.",
  "firstName": "Louis",
  "lastName": "Marie",
  "country": "FR"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'If-Match' => 'If-Match',
  ],
]);

echo $response->getBody();
```

```csharp Requête réussie.
using RestSharp;

var client = new RestClient("https://workflow-manager/api/contacts/contactId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("If-Match", "If-Match");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"email\": \"avery.thompson8848@my-company.com\",\n  \"phoneNumber\": \"+33 6 12 34 56 78\",\n  \"comments\": \"Accusamus nihil nisi magnam temporibus et odit alias.\",\n  \"firstName\": \"Louis\",\n  \"lastName\": \"Marie\",\n  \"country\": \"FR\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Requête réussie.
import Foundation

let headers = [
  "If-Match": "If-Match",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "email": "avery.thompson8848@my-company.com",
  "phoneNumber": "+33 6 12 34 56 78",
  "comments": "Accusamus nihil nisi magnam temporibus et odit alias.",
  "firstName": "Louis",
  "lastName": "Marie",
  "country": "FR"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://workflow-manager/api/contacts/contactId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```