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

# Update CustomField

> Update an existing CustomField record.

Updates an existing CustomField record. You must include the `Id` of the record to update along with all required fields.

## 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 **`CustomField-Edit`** role.
</Note>

## Enums

<Accordion title="eCustomFieldRecordType — RecordType values">
  | Value | Name               |
  | ----- | ------------------ |
  | 1     | Coworker           |
  | 2     | Team               |
  | 3     | FloorPlanDesk      |
  | 4     | CrmOpportunity     |
  | 5     | Visitor            |
  | 6     | Proposal           |
  | 7     | CoworkerInternal   |
  | 8     | HelpDeskMessage    |
  | 9     | HelpDeskDepartment |
  | 10    | Product            |
  | 11    | Booking            |
  | 12    | CoworkerInvoice    |
  | 13    | Business           |
  | 14    | CoworkerContract   |
  | 15    | Tariff             |
  | 16    | Resource           |
  | 17    | FloorPlan          |
  | 18    | InventoryAsset     |
</Accordion>

<Accordion title="eFieldType — FieldType values">
  | Value | Name     |
  | ----- | -------- |
  | 1     | Text     |
  | 2     | LongText |
  | 3     | Boolean  |
  | 4     | Dropdown |
  | 5     | Date     |
  | 6     | Integer  |
  | 7     | Decimal  |
</Accordion>

<Accordion title="eCoworkerFieldPosition — CoworkerFieldPosition values">
  | Value | Name    |
  | ----- | ------- |
  | 1     | General |
  | 2     | Contact |
  | 3     | Profile |
  | 4     | Billing |
  | 5     | Access  |
  | 6     | Notes   |
</Accordion>

<Accordion title="eFieldVisibility — Visibility values">
  | Value | Name     |
  | ----- | -------- |
  | 1     | Visible  |
  | 2     | ReadOnly |
  | 3     | Internal |
</Accordion>

## Request Body

### Required Fields

<ParamField body="Id" type="integer" required>
  The Id of the CustomField record to update.
</ParamField>

<ParamField body="BusinessId" type="integer" required>
  Business this custom field belongs to.
</ParamField>

<ParamField body="Name" type="string" required>
  Field label displayed to users.
</ParamField>

<ParamField body="DisplayOrder" type="integer" required>
  Sort order when multiple custom fields are shown together.
</ParamField>

<ParamField body="RecordType" type="integer" required>
  Entity type this field applies to: Coworker, Team, Booking, Product, Resource, etc..
</ParamField>

<ParamField body="FieldType" type="integer" required>
  Data type of the field: Text, LongText, Boolean, Dropdown, Date, Integer, or Decimal.
</ParamField>

<ParamField body="CoworkerFieldPosition" type="integer" required>
  Tab where this field appears on the coworker record: General, Contact, Profile, Billing, Access, or Notes.
</ParamField>

<ParamField body="CustomFieldIndex" type="integer" required>
  Unique index identifying this field within its record type and business.
</ParamField>

<ParamField body="Visibility" type="integer" required>
  Visibility level: Visible (editable by customer), ReadOnly (shown but not editable), or Internal (admin only).
</ParamField>

### Optional Fields

<ParamField body="AvailableOptions" type="string">
  Comma-separated list of choices for Dropdown fields.
</ParamField>

<ParamField body="AllowMultipleOptions" type="boolean">
  Whether multiple options can be selected for Dropdown fields.
</ParamField>

<ParamField body="Required" type="boolean">
  Whether a value must be provided when saving the parent entity.
</ParamField>

<ParamField body="GroupName" type="string">
  Optional group name used to visually group related custom fields together.
</ParamField>

<ParamField body="DisplayInPublicProfile" type="boolean">
  Show this field on the coworker's public profile page.
</ParamField>

<ParamField body="DisplayInDirectorySearch" type="boolean">
  Show this field as a filter in the member directory search.
</ParamField>

<ParamField body="NameInSearch" type="string">
  Alternative label shown when this field appears in directory search filters.
</ParamField>

<ParamField body="DisplayInSignUpForm" type="boolean">
  Show this field on the member sign-up form.
</ParamField>

<ParamField body="DisplayInProfileForm" type="boolean">
  Show this field on the member profile edit form.
</ParamField>

<ParamField body="DisplayInTourForm" type="boolean">
  Show this field on the tour booking form.
</ParamField>

<ParamField body="DisplayInEventSignUpForm" type="boolean">
  Show this field on the event sign-up form.
</ParamField>

<ParamField body="ShowInBookingForm" type="boolean">
  Show this field on the resource booking form.
</ParamField>

<ParamField body="DisplayInProductSignUpForm" type="boolean">
  Show this field on the product purchase form.
</ParamField>

<ParamField body="DisplayInTeamSignUpForm" type="boolean">
  Show this field on the team sign-up form.
</ParamField>

<ParamField body="DisplayInCourseSignUpForm" type="boolean">
  Show this field on the course sign-up form.
</ParamField>

<ParamField body="DisplayInTariffSignUpForm" type="boolean">
  Show this field on the pricing plan (tariff) sign-up form.
</ParamField>

<ParamField body="DisplayInBookingSignUpForm" type="boolean">
  Show this field on the booking sign-up form.
</ParamField>

<ParamField body="DisplayInResourceSearch" type="boolean">
  Show this field as a filter in resource search.
</ParamField>

<ParamField body="Resources" type="integer[]">
  Resources this custom field is linked to (for FloorPlanDesk or Resource record types).
</ParamField>

<ParamField body="AddedResources" type="integer[]">
  Added Resources.
</ParamField>

<ParamField body="RemovedResources" type="integer[]">
  Removed Resources.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT \
    "https://spaces.nexudus.com/api/crm/customfields" \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "BusinessId": 0,
      "Name": "",
      "DisplayOrder": 0,
      "RecordType": 0,
      "FieldType": 0,
      "CoworkerFieldPosition": 0,
      "CustomFieldIndex": 0,
      "Visibility": 0,
      "Id": 87654321
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/crm/customfields',
    {
      method: 'PUT',
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        BusinessId: 0,
        Name: '',
        DisplayOrder: 0,
        RecordType: 0,
        FieldType: 0,
        CoworkerFieldPosition: 0,
        CustomFieldIndex: 0,
        Visibility: 0,
        Id: 87654321
      })
    }
  );

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

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

  response = requests.put(
      'https://spaces.nexudus.com/api/crm/customfields',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN',
          'Content-Type': 'application/json'
      },
      json={
          'BusinessId': 0,
          'Name': '',
          'DisplayOrder': 0,
          'RecordType': 0,
          'FieldType': 0,
          'CoworkerFieldPosition': 0,
          'CustomFieldIndex': 0,
          'Visibility': 0,
          'Id': 87654321
      }
  )

  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 update.
</ResponseField>

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

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

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

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "CustomField was successfully updated.",
  "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": "Name: is a required field",
  "Value": null,
  "Errors": [
    {
      "AttemptedValue": null,
      "Message": "is a required field",
      "PropertyName": "Name"
    }
  ],
  "WasSuccessful": false
}
```
