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

> Create a new CustomField record.

A custom field defines an additional data field for a selected Nexudus record type, including customers, plans, bookings, products, and resources. It controls the input type, validation, visibility, placement, and supported public forms for values stored with those records.

## 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-Create`** role.

## Enums

> [accordion] 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] eFieldType — FieldType values
>
> | Value | Name |
> | - | - |
> | 1 | Text |
> | 2 | LongText |
> | 3 | Boolean |
> | 4 | Dropdown |
> | 5 | Date |
> | 6 | Integer |
> | 7 | Decimal |

> [accordion] eCoworkerFieldPosition — CoworkerFieldPosition values
>
> | Value | Name |
> | - | - |
> | 1 | General |
> | 2 | Contact |
> | 3 | Profile |
> | 4 | Billing |
> | 5 | Access |
> | 6 | Notes |

> [accordion] eFieldVisibility — Visibility values
>
> | Value | Name |
> | - | - |
> | 1 | Visible |
> | 2 | ReadOnly |
> | 3 | Internal |

## Request Body

### Required Fields

**BusinessId** `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..

**Name** `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..

**DisplayOrder** `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..

**RecordType** `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..

**FieldType** `integer` *required*

Input type and validation for captured values: Text, LongText, Boolean, Dropdown, Date, Integer, or Decimal. AvailableOptions is retained only for Dropdown..

**CoworkerFieldPosition** `integer` *required*

Customer-record tab where the field is placed: General, Contact, Profile, Billing, Access, or Notes. This applies when RecordType is Coworker..

**Visibility** `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..

### Optional Fields

**AvailableOptions** `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..

**AllowMultipleOptions** `boolean`

Whether a Dropdown field accepts more than one comma-separated choice. This setting is meaningful only when FieldType is Dropdown..

**Required** `boolean`

Whether a non-empty value is required when this field is submitted on its parent record. ReadOnly fields are automatically made not required..

**GroupName** `string`

Optional label used to group related custom fields in supported forms..

**DisplayInPublicProfile** `boolean`

Whether this customer field is shown on the customer's public profile..

**DisplayInDirectorySearch** `boolean`

Whether this customer field is offered as a filter in the public customer directory search..

**NameInSearch** `string`

Optional label shown for this field in customer-directory search; use it when the normal field label needs different search wording..

**DisplayInSignUpForm** `boolean`

Whether this custom field is shown on the customer sign-up form..

**DisplayInProfileForm** `boolean`

Whether this custom field is shown on the customer profile-edit form..

**DisplayInTourForm** `boolean`

Whether this custom field is shown on the tour request form..

**DisplayInEventSignUpForm** `boolean`

Whether this custom field is shown when a customer registers for an event..

**ShowInBookingForm** `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..

**DisplayInProductSignUpForm** `boolean`

Whether this custom field is shown when a customer buys a product..

**DisplayInTeamSignUpForm** `boolean`

Whether this custom field is shown on the team sign-up form..

**DisplayInCourseSignUpForm** `boolean`

Whether this custom field is shown on the course sign-up form..

**DisplayInTariffSignUpForm** `boolean`

Whether this custom field is shown when a customer signs up for a plan (Tariff)..

**DisplayInBookingSignUpForm** `boolean`

Whether this custom field is shown on the booking sign-up form..

**DisplayInResourceSearch** `boolean`

Whether this custom field is offered as a filter in resource search..

**Resources** `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..

## Code Examples

```bash cURL theme={null}
curl -X POST \
  "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
}'
```

```javascript JavaScript theme={null}
const response = await fetch(
  'https://spaces.nexudus.com/api/crm/customfields',
  {
    method: 'POST',
    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
    })
  }
);

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

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

response = requests.post(
    '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
    }
)

data = response.json()
```

## Response

### 200

**Status** `integer`

HTTP status code. `200` on success.

**Message** `string`

A human-readable message confirming the creation.

**Value** `object`

Contains the `Id` of the newly created record.

**WasSuccessful** `boolean`

`true` if the customfield was created successfully.

**Errors** `array`

`null` on success.

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "CustomField 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

**Message** `string`

A summary of the validation error(s), in the format `PropertyName: error message`.

**Value** `any`

`null` on validation failure.

**Errors** `object[]`

Array of validation errors.

**AttemptedValue** `any`

The value that was submitted for the field, or `null` if missing.

**Message** `string`

The validation error message.

**PropertyName** `string`

The name of the property that failed validation.

**WasSuccessful** `boolean`

`false` when the request fails validation.

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