-
Notifications
You must be signed in to change notification settings - Fork 6
web sdk custom fields
Custom fields allow you to extend Security Center entities with additional properties specific to your business needs. This guide covers creating custom fields, reading/writing values, filtering by custom fields, and important limitations.
Custom fields are user-defined properties that can be added to Security Center entities. They allow you to store additional information beyond the standard entity properties.
- Employee badge numbers
- Department codes
- Building access levels
- Training dates
- Equipment identifiers
- Custom business logic data
Custom fields support these data types:
| Data type | Description | Example value | Notes |
|---|---|---|---|
Text |
String value | "Engineering" | Defaults to empty string if omitted. |
Numeric |
Integer value | 12345 | Signed 32-bit integer. |
Boolean |
True/false value | true | None. |
DateTime |
Date and time | "2025-01-15T10:30:00+08:00" | ISO 8601 format, supports timezone. |
Date |
Date only | "2025-01-15T00:00:00Z" | Time is always midnight UTC. |
Decimal |
Decimal number | 99.99 | Up to 15 significant digits. |
Image |
Binary image data | Base64-encoded | Write not supported through the Web SDK. |
Entity |
Reference to another entity | GUID | Links to Security Center entity. |
These routes require an account that can connect through the Web SDK.
Creating or deleting custom field definitions requires General settings > Modify custom field definitions.
Reading or updating custom field values also requires access to the target entity and access to the custom field in Security Center. For cardholders, cardholder groups, credentials, and visitors, updating values also requires the corresponding Modify custom fields privilege for that entity type.
Use the custom-field creation route to add one field definition to a specific entity type:
POST /customField/{entityType}/{customFieldName}/{dataType}/{defaultValue}-
entityType- Entity type (for example, Cardholder, Credential, Door). -
customFieldName- Name of the custom field (spaces are accepted but limitq=access; see Limitations). -
dataType- Data type (Text, Numeric, Boolean, DateTime, Date, Decimal, Image, Entity). -
defaultValue- Default value applied at creation. Required forNumeric,Boolean,DateTime,Date, andDecimal. Optional forText,Image, andEntity; omit with a trailing slash, for examplePOST /customField/Cardholder/MyField/Image/.
POST /customField/Cardholder/DepartmentCode/Text/IT
POST /customField/Cardholder/BadgeNumber/Numeric/0
POST /customField/Cardholder/IsContractor/Boolean/false
POST /customField/Cardholder/LastTrainingDate/DateTime/DateTime.NowFor DateTime fields, the special values DateTime.Now (current local time) and DateTime.UtcNow (current UTC time) are accepted as the default.
A successful request returns:
{
"Rsp": {
"Status": "Ok"
}
}A duplicate field name returns:
{
"Rsp": {
"Status": "Fail",
"Result": {
"Message": "The property Name is invalid. The property Name should be unique by EntityType, Owner and CustomEntityTypeId in case of CustomEntity EntityType."
}
}
}There are two ways to read custom field values: a dedicated endpoint and the entity query syntax.
Use the dedicated endpoint when you need to read a single custom field:
GET /customField/{entityId}/{customFieldName}For example:
GET /customField/{entity-guid}/DepartmentCodeThe response wraps the typed value in a Value field:
{
"Rsp": {
"Status": "Ok",
"Result": {
"Value": "Sales"
}
}
}The data type of the field is preserved in the response:
- Text fields return strings:
"Value": "Engineering". - Numeric fields return numbers:
"Value": 12345. - Boolean fields return booleans:
"Value": true. - DateTime fields return ISO 8601 strings:
"Value": "2025-01-15T10:30:00+08:00".
Custom fields can be queried like standard entity properties using the /entity endpoint. Use this approach when reading multiple fields in a single request:
GET /entity?q=entity={guid},CustomFieldNameRead a single custom field:
GET /entity?q=entity={entity-guid},DepartmentCodeRead multiple custom fields:
GET /entity?q=entity={entity-guid},DepartmentCode,BadgeNumber,IsContractorRead custom fields and standard properties together:
GET /entity?q=entity={entity-guid},Name,FirstName,LastName,DepartmentCode,BadgeNumberImportant
If a custom field name matches a standard entity property name on the same entity type, the custom field is returned first in /entity?q=.... For example, if an entity has a custom field named Name, GET /entity?q=entity={guid},Name returns the custom field value, not the built-in Name property. Use the /customField/... endpoint when you need unambiguous custom-field access.
The response merges custom field values with any requested standard properties:
{
"Rsp": {
"Status": "Ok",
"Result": {
"Name": "New_Cardholder_6225b1afcdf44f2798ccd531fd2d0320",
"FirstName": "Test",
"LastName": "User",
"DepartmentCode": "Sales",
"BadgeNumber": 12345
}
}
}There are two ways to set custom field values: a dedicated endpoint and the entity update syntax.
Use the dedicated endpoint when you need to update a single custom field:
PUT /customField/{entityId}/{customFieldName}/{value}Examples:
PUT /customField/{entity-guid}/DepartmentCode/Engineering
PUT /customField/{entity-guid}/BadgeNumber/12345
PUT /customField/{entity-guid}/IsContractor/true
PUT /customField/{entity-guid}/LastTrainingDate/2025-01-15T10:30:00Each data type accepts a string representation in the path:
- Text: Any string value.
- Numeric: Integer string (for example,
"12345"). - Boolean:
"true"or"false"(case-insensitive). - DateTime: ISO 8601 string, or
"DateTime.Now", or"DateTime.UtcNow". - Date: Date string (for example,
"2025-02-03"). The value is stored as midnight UTC. - Decimal: Decimal string (for example,
"99.99"). - Entity: Entity GUID, with or without braces.
LogicalId(...)is not accepted on the/customField/...route.
A successful update returns:
{
"Rsp": {
"Status": "Ok"
}
}Custom fields can be updated like standard entity properties using the /entity endpoint. Use this approach when updating multiple fields in a single request:
POST /entity?q=entity={guid},CustomFieldName=valueUpdate a single custom field:
POST /entity?q=entity={entity-guid},DepartmentCode=SalesUpdate multiple custom fields:
POST /entity?q=entity={entity-guid},DepartmentCode=Engineering,BadgeNumber=54321,IsContractor=falseUpdate custom fields and standard properties together:
POST /entity?q=entity={entity-guid},FirstName=Jane,DepartmentCode=Marketing,BadgeNumber=99999A successful update returns:
{
"Rsp": {
"Status": "Ok"
}
}Delete the field definition only after confirming it is no longer needed on any entity of that type. Deletion removes the custom field from all entities of the specified type.
DELETE /customField/{entityType}/{customFieldName}For example:
DELETE /customField/Cardholder/OldFieldNameA successful deletion returns:
{
"Rsp": {
"Status": "Ok"
}
}Important
Deleting a custom field removes it from all entities. This operation cannot be undone.
Custom fields can be used as filters in EntityConfiguration reports. Filtering by a DateTime custom field is not supported: a CustomField(...) expression that targets a DateTime-typed field fails with SdkErrorCode: InvalidOperation and a message that names the rejected field.
GET /report/{EntityType}Configuration?q=CustomFields@CustomField(customFieldGuid,value)The expression takes two arguments:
-
customFieldGuid- GUID of the custom field (not the field name). -
value- Value to filter by.
Important
You must use the custom field's GUID, not its name. Custom field GUIDs can be obtained by querying an entity with the custom field set (see example below).
Use these examples to adapt the pattern in this section to your scenario.
Filter cardholders by a single custom field:
GET /report/CardholderConfiguration?q=CustomFields@CustomField({custom-field-guid},IT)Filter by multiple custom fields (logical AND). Returns only entities where DepartmentCode is "IT" and IsContractor is true:
GET /report/CardholderConfiguration?q=CustomFields@CustomField({custom-field-guid},IT)@CustomField({custom-field-guid-2},true)Combine with an entity type filter:
GET /report/EntityConfiguration?q=EntityTypes@Cardholder,CustomFields@CustomField({custom-field-guid},Sales)A typical response returns the GUIDs of matching entities:
{
"Rsp": {
"Status": "Ok",
"Result": [
{"Guid": "984c7ac2-6c76-44c0-be2d-1de009b2a259"},
{"Guid": "631d3540-e293-469f-8a64-22b282cd7fd0"}
]
}
}To get a custom field's GUID, read the CustomFields property of any entity that has the custom field defined:
GET /entity?q=entity={entity-guid},CustomFieldsThe response contains an array of custom field entries. Each entry has a nested CustomField object with the field definition, including the GUID:
{
"Rsp": {
"Status": "Ok",
"Result": {
"CustomFields": [
{
"CustomField": {
"DefaultValue": "",
"CustomEntityTypeId": "00000000-0000-0000-0000-000000000000",
"EntityType": "Cardholder",
"GroupName": "",
"GroupPriority": 1,
"Guid": "{custom-field-guid}",
"Mandatory": false,
"IsEncrypted": false,
"Name": "DepartmentCode",
"Owner": "00000000-0000-0000-0000-000000000000",
"ShowInReports": true,
"Unique": false,
"ValueType": "Text",
"CustomDataType": null
},
"Name": "DepartmentCode",
"ValueType": "Text",
"Value": "Sales"
}
]
}
}
}Use the Guid value from the CustomField object in report filter queries.
When retrieving entity data, each custom field includes these properties:
-
Name(string) - Custom field name -
Guid(GUID) - Unique identifier for the custom field -
EntityType(enum) - Entity type this field applies to -
ValueType(enum) - Data type (Text, Numeric, Boolean, etc.) -
Value(varies) - Current value for this entity -
DefaultValue(varies) - Default value when not set
-
Mandatory(boolean) - Whether field is required -
Unique(boolean) - Whether values must be unique -
IsEncrypted(boolean) - Whether values are encrypted -
ShowInReports(boolean) - Whether field appears in reports -
GroupName(string) - UI grouping name -
GroupPriority(int) - Display order in UI -
Owner(GUID) - Owner entity GUID -
CustomEntityTypeId(GUID) - For custom entity types
- Use
GET /entity?q=entity={guid},FieldNameto read the value; it is returned as Base64. - The dedicated
GET /customField/{entityId}/{customFieldName}route rejects Image reads. - No documented Web SDK path accepts writes to Image values. Populate them through another mechanism.
Custom fields with spaces in names can be created through the /customField endpoints (URL-encode the name in the path, for example Audit%20Field), but they cannot be accessed through the q= query syntax. Even if you URL-encode the spaces (for example, /entity?q=entity={guid},Audit%20Field), the request fails.
Use camelCase or underscore naming for maximum compatibility. Examples: DepartmentCode, Badge_Number, EmployeeID.
The name must match the exact casing used when the field was created. This applies to both the /customField/ endpoints and the q= query syntax.
When you create a custom field with a default value, existing entities receive that value. New entities created after the custom field exists also receive the default value.
The /entity endpoint reads or updates entities that you already identified. It does not perform cross-entity filtering. To filter entities by a custom field value, use a configuration report such as /report/EntityConfiguration or /report/CardholderConfiguration.
Report filters require the custom field GUID, not the name. Custom field names cannot be used in CustomField() filter syntax.
Setting an invalid value for a data type returns an error. For example, setting "abc" for a Numeric field returns "Could not convert abc based on Numeric.".
Creating custom fields for CustomEntity is not supported.
-
The /entity endpoint: The
/entityendpoint and sharedq=query syntax. - Referencing entities: Entity discovery, search, and parameter formats.
- Overview
- Connecting to Security Center
- SDK certificates
- Referencing SDK assemblies
- SDK compatibility
- Entities
- Entity cache
- Entity loading, cache, and query options
- Transactions
- Events
- Actions
- Security Desk
- Custom events
- ReportManager
- ReportManager query reference
- Access control raw events
- DownloadAllRelatedData and StrictResults
- Privileges
- Partitions
- About custom fields
- About video
- About cameras
- Enrolling a video unit
- Archiver and auxiliary archiver roles
- Archive transfer
- About access control
- About cardholders and credentials
- About doors, areas, elevators, and access points
- About access rules and schedules
- About access control units and interface modules
- Enrolling an access control unit
- Door templates
- Visitors
- Mobile credentials
- About threat levels
- About alarms
- Maps
- Logging
- Overview
- Certificates
- Lifecycle
- Threading
- State management
- Configuration
- Restricted configuration
- Events
- Queries
- Request manager
- Database
- Entity ownership
- Engine extensions
- Entity mappings
- Server management
- Custom privileges
- Custom entity types
- Resolving non-SDK assemblies
- Deploying plugins
- .NET 8 support
- Overview
- Certificates
- Creating modules
- Tasks
- Pages
- Components
- Tile extensions
- Services
- Contextual actions
- Options extensions
- Configuration pages
- Monitors
- Shared components
- Commands
- Extending events
- Map extensions
- Timeline providers
- Image extractors
- Credential encoders
- Credential readers
- Cardholder fields extractors
- Badge printers
- Content builders
- Dashboard widgets
- Incidents
- Logon providers
- Pinnable content builders
- Custom report pages
- Overview
- Getting started
- MediaPlayer
- VideoSourceFilter
- MediaExporter
- MediaFile
- G64 converters
- FileCryptingManager
- PlaybackSequenceQuerier
- PlaybackStreamReader
- OverlayFactory
- PtzCoordinatesManager
- AudioTransmitter
- AudioRecorder
- AnalogMonitorController
- Camera blocking
- Overview
- Getting started
- Referencing entities
- Entity operations
- About access control in the Web SDK
- About video in the Web SDK
- Users and user groups
- Partitions
- Custom fields
- Custom card formats
- Actions
- Events and alarms
- Incidents
- Reports
- Tasks
- Macros
- Custom entity types
- System endpoints
- Performance guide
- Reference
- Under the hood
- Troubleshooting