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

# Create Client

> Creates a new client in your COR instance with external ID mapping

Creates a new client in your COR instance through the integrations service. The client is mapped to an external ID from your source system for bidirectional synchronization.

## Request Body Requirements

All requests require the `metadata.source` field to identify the integration source.

<ParamField body="metadata" type="object" required>
  <Expandable title="properties">
    <ParamField body="source" type="string" required>
      Integration source identifier. Must be one of: `JIRA`, `SALESFORCE`, `ADVERTMIND`, `QUICKBOOKS`, `ZAPIER`, `OKTA`, `MICROSOFT_DYNAMICS`, `GITHUB`, `MICROSOFT_TEAMS`, `VBS`, `SAP`, `GLOBANT`
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="id" type="string" required>
  External client ID from your source system. This ID will be used to reference the client in future operations.
</ParamField>

<ParamField body="name" type="string" required>
  Client display name
</ParamField>

<ParamField body="workspace_id" type="string" required>
  External workspace ID that the client belongs to
</ParamField>

<ParamField body="business_name" type="string">
  Legal business name for contracts and invoicing
</ParamField>

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

<ParamField body="name_contact" type="string">
  Contact person's first name
</ParamField>

<ParamField body="last_name_contact" type="string">
  Contact person's last name
</ParamField>

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

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

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

## Known Errors

* `ValidationError` — Missing required fields (`metadata.source`, `id`, or `name`)
* `DuplicateExternalIdError` — A client with this external ID already exists for this source
* `InvalidSourceError` — The `metadata.source` value is not a valid integration source
* `WS001` — workspace\_id is required or the workspace was not found in the system

<RequestExample>
  ```bash cURL theme={null}
  curl --location 'https://integrations.projectcor.com/v2/integrations/clients' \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "metadata": {
      "source": "SALESFORCE"
    },
    "id": "SF-ACC-67890",
    "name": "Acme Corporation",
    "workspace_id": "ws-clients-emea-region",
    "business_name": "Acme Corporation LLC",
    "email_contact": "contact@acme.com",
    "name_contact": "Jane",
    "last_name_contact": "Smith",
    "phone": "+1 555-0100",
    "website": "https://acme.com",
    "description": "Enterprise software solutions provider"
  }'
  ```

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

  url = "https://integrations.projectcor.com/v2/integrations/clients"

  payload = {
      "metadata": {
          "source": "SALESFORCE"
      },
      "id": "SF-ACC-67890",
      "name": "Acme Corporation",
      "workspace_id": "ws-clients-emea-region",
      "business_name": "Acme Corporation LLC",
      "email_contact": "contact@acme.com",
      "name_contact": "Jane",
      "last_name_contact": "Smith",
      "phone": "+1 555-0100",
      "website": "https://acme.com",
      "description": "Enterprise software solutions provider"
  }

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

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

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://integrations.projectcor.com/v2/integrations/clients',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        metadata: {
          source: 'SALESFORCE'
        },
        id: 'SF-ACC-67890',
        name: 'Acme Corporation',
        workspace_id: 'ws-clients-emea-region',
        business_name: 'Acme Corporation LLC',
        email_contact: 'contact@acme.com',
        name_contact: 'Jane',
        last_name_contact: 'Smith',
        phone: '+1 555-0100',
        website: 'https://acme.com',
        description: 'Enterprise software solutions provider'
      })
    }
  );

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

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

  ```json 400 theme={null}
  {
    "error": "ValidationError",
    "message": "Missing required field: name",
    "code": "ZC002"
  }
  ```
</ResponseExample>
