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

# Create ContractContact

> Create a new ContractContact record.

A **ContractContact** is a key contact entry on a virtual office contract (`CoworkerContract`). Contacts can be directors, company aliases, or nominated recipients, and are used to identify, validate, and handle mail and deliveries addressed to anyone connected to a virtual office contract.

Each entry can be linked to an existing coworker via `CoworkerId`, in which case the coworker's name and email are resolved automatically. Alternatively, provide `FullName` and `Email` directly for contacts who do not have a coworker record.

Use `ContractContactType` to classify the contact:

| Type                 | Description                                                                 |
| -------------------- | --------------------------------------------------------------------------- |
| `Director`           | A director of the company registered under the virtual office contract      |
| `CompanyAlias`       | A trading name or alias used by the company                                 |
| `NominatedRecipient` | A person authorised to receive mail and deliveries on behalf of the company |

## Authentication

<Note>
  This endpoint requires OAuth2 authentication. Include a valid bearer token in the `Authorization` header.
  The authenticated user must be a full unrestricted administrator or have the **`ContractContact-Create`** role.
</Note>

## Enums

<Accordion title="eContractContactType — ContractContactType values">
  | Value | Name               |
  | ----- | ------------------ |
  | 0     | None               |
  | 1     | Director           |
  | 2     | CompanyAlias       |
  | 3     | NominatedRecipient |
</Accordion>

## Request Body

### Required Fields

<ParamField body="CoworkerContractId" type="integer" required>
  Coworker Contract Id.
</ParamField>

<ParamField body="FullName" type="string" required>
  Full name of the contact. Used when the contact is not linked to a coworker record.
</ParamField>

<ParamField body="ContractContactType" type="integer" required>
  Role of this contact: Director (a company director), CompanyAlias (a trading name), or NominatedRecipient (authorised to receive mail on behalf of the company). Defaults to `eContractContactType.Director`.
</ParamField>

### Optional Fields

<ParamField body="CoworkerId" type="integer">
  Coworker Id.
</ParamField>

<ParamField body="Email" type="string">
  Email address of the contact. Used when the contact is not linked to a coworker record.
</ParamField>

<ParamField body="DateOfBirth" type="string">
  Date of birth. Used for identity verification purposes.
</ParamField>

<ParamField body="Address" type="string">
  Address.
</ParamField>

<ParamField body="PostCode" type="string">
  Post code.
</ParamField>

<ParamField body="CityName" type="string">
  City name.
</ParamField>

<ParamField body="State" type="string">
  State.
</ParamField>

<ParamField body="CountryId" type="integer">
  Country Id.
</ParamField>

<ParamField body="PhoneNumber" type="string">
  Phone number.
</ParamField>

<ParamField body="Notes" type="string">
  Notes.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST \
    "https://spaces.nexudus.com/api/billing/contractcontacts" \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "CoworkerContractId": 0,
      "FullName": "",
      "ContractContactType": 0
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/billing/contractcontacts',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        CoworkerContractId: 0,
        FullName: '',
        ContractContactType: 0
      })
    }
  );

  const data = await response.json();
  ```

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

  response = requests.post(
      'https://spaces.nexudus.com/api/billing/contractcontacts',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN',
          'Content-Type': 'application/json'
      },
      json={
          'CoworkerContractId': 0,
          'FullName': '',
          'ContractContactType': 0
      }
  )

  data = response.json()
  ```
</CodeGroup>

## Response

### 200

<ResponseField name="Status" type="integer">
  HTTP status code. `200` on success.
</ResponseField>

<ResponseField name="Message" type="string">
  A human-readable message confirming the creation.
</ResponseField>

<ResponseField name="Value" type="object">
  Contains the `Id` of the newly created record.
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `true` if the contractcontact was created successfully.
</ResponseField>

<ResponseField name="Errors" type="array">
  `null` on success.
</ResponseField>

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "ContractContact was successfully created.",
  "Value": {
    "Id": 87654321
  },
  "OpenInDialog": false,
  "OpenInWindow": false,
  "RedirectURL": null,
  "JavaScript": null,
  "UpdatedOn": "2025-01-15T10:30:00Z",
  "UpdatedBy": "admin@example.com",
  "Errors": null,
  "WasSuccessful": true
}
```

### 400

<ResponseField name="Message" type="string">
  A summary of the validation error(s), in the format `PropertyName: error message`.
</ResponseField>

<ResponseField name="Value" type="any">
  `null` on validation failure.
</ResponseField>

<ResponseField name="Errors" type="object[]">
  Array of validation errors.

  <Expandable>
    <ResponseField name="AttemptedValue" type="any">
      The value that was submitted for the field, or `null` if missing.
    </ResponseField>

    <ResponseField name="Message" type="string">
      The validation error message.
    </ResponseField>

    <ResponseField name="PropertyName" type="string">
      The name of the property that failed validation.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `false` when the request fails validation.
</ResponseField>

```json Example Response theme={null}
{
  "Message": "FullName: is a required field",
  "Value": null,
  "Errors": [
    {
      "AttemptedValue": null,
      "Message": "is a required field",
      "PropertyName": "FullName"
    }
  ],
  "WasSuccessful": false
}
```
