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

# Update Client

> Updates an existing client in your COR instance using its external ID

Updates an existing client in your COR instance using its external ID. Only the fields provided in the request body will be updated.

## Path Parameters

<ParamField path="id" type="string" required>
  External client ID that was used when creating the client
</ParamField>

## Request Body Requirements

<ParamField body="metadata" type="object" required>
  <Expandable title="properties">
    <ParamField body="source" type="string" required>
      Integration source identifier. Must match the source used when creating the client.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="name" type="string">
  Updated client name
</ParamField>

<ParamField body="business_name" type="string">
  Updated legal business name
</ParamField>

<ParamField body="email_contact" type="string">
  Updated contact email
</ParamField>

<ParamField body="name_contact" type="string">
  Updated contact first name
</ParamField>

<ParamField body="last_name_contact" type="string">
  Updated contact last name
</ParamField>

<ParamField body="phone" type="string">
  Updated phone number
</ParamField>

<ParamField body="website" type="string">
  Updated website URL
</ParamField>

<ParamField body="description" type="string">
  Updated description
</ParamField>

## Known Errors

* `ZC001` — Entity is not associated (client with the specified external ID not found)
* `ClientNotFoundError` — No client found with the specified external ID for this source
* `ValidationError` — Missing required `metadata.source` field

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/clients/SF-ACC-67890' \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "metadata": {
      "source": "SALESFORCE"
    },
    "name": "Acme Corp (Updated)",
    "phone": "+1 555-0200",
    "website": "https://www.acmecorp.com"
  }'
  ```

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

  url = "https://integrations.projectcor.com/v2/integrations/clients/SF-ACC-67890"

  payload = {
      "metadata": {
          "source": "SALESFORCE"
      },
      "name": "Acme Corp (Updated)",
      "phone": "+1 555-0200",
      "website": "https://www.acmecorp.com"
  }

  headers = {
      "Authorization": "Bearer YOUR_ACCESS_TOKEN",
      "Content-Type": "application/json"
  }

  response = requests.put(url, json=payload, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://integrations.projectcor.com/v2/integrations/clients/SF-ACC-67890',
    {
      method: 'PUT',
      headers: {
        'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        metadata: {
          source: 'SALESFORCE'
        },
        name: 'Acme Corp (Updated)',
        phone: '+1 555-0200',
        website: 'https://www.acmecorp.com'
      })
    }
  );

  const data = await response.json();
  console.log(data);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": 25855,
    "name": "Acme Corp (Updated)",
    "business_name": "Acme Corporation LLC",
    "email_contact": "contact@acme.com",
    "name_contact": "Jane",
    "last_name_contact": "Smith",
    "phone": "+1 555-0200",
    "website": "https://www.acmecorp.com",
    "description": "Enterprise software solutions provider",
    "company_id": 1234,
    "created_at": "2025-01-10T14:30:00Z",
    "updated_at": "2025-01-15T10:00:00Z"
  }
  ```

  ```json 404 theme={null}
  {
    "status": "ERROR",
    "code": "ZC001",
    "message": "Entity is not associated"
  }
  ```

  ```json 404 theme={null}
  {
    "error": "ClientNotFoundError",
    "message": "Client with external ID 'SF-ACC-67890' not found for source SALESFORCE",
    "code": "ZC004"
  }
  ```
</ResponseExample>
