> ## 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>
  ID of the location that owns this custom field. Customer fields must belong to the top-level location; other record types are available across the location network..
</ParamField>

<ParamField body="Name" type="string" required>
  Required label shown for this custom field. It must be unique across the location network unless it is the linked resource/booking counterpart..
</ParamField>

<ParamField body="DisplayOrder" type="integer" required>
  Numeric display order for this field among the location's custom fields; lower values appear first and the server normalizes the ordering after changes..
</ParamField>

<ParamField body="RecordType" type="integer" required>
  Record type this field collects data for: Coworker, Team, FloorPlanDesk, CrmOpportunity, Visitor, Proposal, CoworkerInternal, HelpDeskMessage, HelpDeskDepartment, Product, Booking, CoworkerInvoice, Business, CoworkerContract, Tariff, Resource, FloorPlan, InventoryAsset, or Events. A Coworker field cannot later be changed to another type..
</ParamField>

<ParamField body="FieldType" type="integer" required>
  Input type and validation for captured values: Text, LongText, Boolean, Dropdown, Date, Integer, or Decimal. AvailableOptions is retained only for Dropdown..
</ParamField>

<ParamField body="CoworkerFieldPosition" type="integer" required>
  Customer-record tab where the field is placed: General, Contact, Profile, Billing, Access, or Notes. This applies when RecordType is Coworker..
</ParamField>

<ParamField body="Visibility" type="integer" required>
  Audience and editability: Visible allows customer editing, ReadOnly shows the field without customer editing, and Internal excludes it from public-facing field lists. ReadOnly cannot be Required..
</ParamField>

### Optional Fields

<ParamField body="AvailableOptions" type="string">
  Comma-separated permitted choices for a Dropdown field; submitted values must exactly match these trimmed options. The server clears this value for every other FieldType..
</ParamField>

<ParamField body="AllowMultipleOptions" type="boolean">
  Whether a Dropdown field accepts more than one comma-separated choice. This setting is meaningful only when FieldType is Dropdown..
</ParamField>

<ParamField body="Required" type="boolean">
  Whether a non-empty value is required when this field is submitted on its parent record. ReadOnly fields are automatically made not required..
</ParamField>

<ParamField body="GroupName" type="string">
  Optional label used to group related custom fields in supported forms..
</ParamField>

<ParamField body="DisplayInPublicProfile" type="boolean">
  Whether this customer field is shown on the customer's public profile..
</ParamField>

<ParamField body="DisplayInDirectorySearch" type="boolean">
  Whether this customer field is offered as a filter in the public customer directory search..
</ParamField>

<ParamField body="NameInSearch" type="string">
  Optional label shown for this field in customer-directory search; use it when the normal field label needs different search wording..
</ParamField>

<ParamField body="DisplayInSignUpForm" type="boolean">
  Whether this custom field is shown on the customer sign-up form..
</ParamField>

<ParamField body="DisplayInProfileForm" type="boolean">
  Whether this custom field is shown on the customer profile-edit form..
</ParamField>

<ParamField body="DisplayInTourForm" type="boolean">
  Whether this custom field is shown on the tour request form..
</ParamField>

<ParamField body="DisplayInEventSignUpForm" type="boolean">
  Whether this custom field is shown when a customer registers for an event..
</ParamField>

<ParamField body="ShowInBookingForm" type="boolean">
  Whether this field is shown on a resource booking form. For Resource record types, enabling this creates or synchronizes a linked Booking custom field..
</ParamField>

<ParamField body="DisplayInProductSignUpForm" type="boolean">
  Whether this custom field is shown when a customer buys a product..
</ParamField>

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

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

<ParamField body="DisplayInTariffSignUpForm" type="boolean">
  Whether this custom field is shown when a customer signs up for a plan (Tariff)..
</ParamField>

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

<ParamField body="DisplayInResourceSearch" type="boolean">
  Whether this custom field is offered as a filter in resource search..
</ParamField>

<ParamField body="Resources" type="integer[]">
  List of resources this Resource-record custom field applies to when it is shown in booking. An empty list means it applies to every resource; setting resources restricts it to those resources..
</ParamField>

<ParamField body="AddedResources" type="integer[]">
  IDs added to the Resources relationship..
</ParamField>

<ParamField body="RemovedResources" type="integer[]">
  IDs removed from the Resources relationship..
</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,
      "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,
        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,
          '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
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.