-
Notifications
You must be signed in to change notification settings - Fork 4
Web SDK Entity Operations
The /entity endpoint supports retrieving, updating, creating, deleting, and executing actions on entities.
The request must use the q= query parameter to describe which entities and what actions are involved.
- Retrieving specific fields (e.g.,
Name,Description,BuildingCode) - Updating field values (e.g.,
Name=Front Lobby,IsEnabled=true) - Modifying multi-value fields (e.g.,
UnlockSchedules@{guid}) - Executing methods (e.g.,
SetBuzzerState(true)) - Creating new entities (e.g.,
NewEntity(Credential)) - Deleting entities using
DELETE /entity/{guid}) - Combining multiple operations (create, read, update) across multiple entities in a single
POSTrequest
- Use
GETto retrieve field values - Use
POSTfor updating, creating and executing actions - Use
DELETEto delete an entity - The operations are encoded in the
q=parameter (no JSON body)
GET /entity?q=entity={entityGuid},Name,Descriptionor using a logical identifier:
GET /entity?q=entity=LogicalID(Cardholder,1),Name- Retrieves entities by GUID or LogicalID
- The
LogicalIDsyntax takes two parameters: the entity type and the logical number
A projection defines which fields to return in the response. You must specify them explicitly otherwise, no data will be returned.
GET /entity?q=entity={entityGuid},EntityType,ModifiedOn,CustomField1- Fields must be listed explicitly after the
entity=...portion - Field names are case-insensitive, but values preserve casing
- You must specify at least one field to retrieve
Multiple entity= segments must be combined under a single q= parameter. Each entity= entry must be followed by one or more fields to retrieve.
GET /entity?q=entity={guid1},Name,entity={guid2},Name,DescriptionGET /entity?q=entity=LogicalID(Cardholder,12),Name,MobilePhoneNumberGET /entity?q=entity={guid1},Name,entity={guid2},Name- Each
entity=entry must specify at least one projected field - Responses include one result per entity
- You must include at least one field to retrieve
GET /entity?q=entity={guid},BuildingCode- Custom fields must be referenced using their exact configured name
- Custom field names containing spaces or special characters are not supported
For comprehensive custom field documentation including creation, deletion, filtering, and data types, see Working with Custom Fields.
POST /entity?q=entity={guid},Name=New Name,Description=Updated description- Updates must use the
POSTmethod - All changes are encoded in the
q=query string - No request body is used
Multi-value fields are lists, collections, one-to-many relations, etc. They can contain any data type and represent fields that can hold multiple values rather than a single value.
Examples of multi-value fields:
-
UnlockSchedules- list of schedule GUIDs - Collections of strings, numbers, or other data types
- One-to-many entity relationships
- Not all multi-value fields support set operations - some only support add/remove
- Some multi-value fields are read-only - just as some single-value fields are read-only
- Read-only multi-value fields may provide specific methods for modifications
Example of method-based modification for read-only multi-value field:
POST /entity?q=entity={elevator},AddCamera({camera})
POST /entity?q=entity={elevator},RemoveCamera({camera})
GET /entity?q=entity={elevator},CamerasSome multi-value field operations support both symbolic syntax and method-based syntax:
Add operations:
POST /entity?q=entity={door},UnlockSchedules@{scheduleId}
POST /entity?q=entity={door},UnlockSchedules.Add({scheduleId})Remove operations:
POST /entity?q=entity={door},UnlockSchedules-{scheduleId}
POST /entity?q=entity={door},UnlockSchedules.Remove({scheduleId})Clear operations:
POST /entity?q=entity={door},UnlockSchedules*
POST /entity?q=entity={door},UnlockSchedules.Clear()Important limitation: The symbolic syntax supports multiple values in one operation, but the method syntax does NOT support chaining:
Supported (symbolic syntax):
POST /entity?q=entity={door},UnlockSchedules@{scheduleId1}@{scheduleId2}@{scheduleId3}NOT supported (method chaining):
POST /entity?q=entity={door},UnlockSchedules.Add({scheduleId1}).Add({scheduleId2})Therefore:
- For single operations: Choose either syntax based on preference
- For multiple values: Must use symbolic syntax (
@{id1}@{id2}@{id3})
Add:
POST /entity?q=entity={doorGuid},UnlockSchedules@{scheduleGuid}Remove:
POST /entity?q=entity={doorGuid},UnlockSchedules-{scheduleGuid}Clear All:
POST /entity?q=entity={doorGuid},UnlockSchedules*Clear and Add:
POST /entity?q=entity={doorGuid},UnlockSchedules*@{scheduleGuid}Add Multiple:
POST /entity?q=entity=201c7625-97b6-4ea6-a4d6-ff5cf279cdb4,UnlockSchedules@fdc60e2e-5c02-41fc-9ea2-5aa57f30cfb1@a8a69df6-2ba5-4434-bf7f-4a4d911d56b2Remove Multiple:
POST /entity?q=entity=201c7625-97b6-4ea6-a4d6-ff5cf279cdb4,UnlockSchedules-fdc60e2e-5c02-41fc-9ea2-5aa57f30cfb1Set single (when supported):
POST /entity?q=entity={doorGuid},UnlockSchedules={guid1}@{guid2}Set multiple (when supported):
POST /entity?q=entity=201c7625-97b6-4ea6-a4d6-ff5cf279cdb4,UnlockSchedules={guid1}@{guid2}@{guid3}- Multiple values are separated by the '@' character for adding
- Multiple values are separated by the '-' character for removing
- The '*' character clears all values
- You can combine clear with add:
*@{value}clears all then adds specified values - The '=' character sets all values (when supported by the field)
- This syntax applies to any supported multi-value field
POST /entity?q=entity={doorGuid},SetBuzzerState(true)- Must use the
POSTmethod - Method name is followed by arguments in parentheses
- Only entity-supported methods are allowed
POST /entity?q=entity=NewEntity(Credential),Name=Test Card,Guid- Use
NewEntity(EntityType)to create a new entity (see EntityType Enumeration for all available types) - Additional attributes can be initialized inline
- Creatable entity types: Cardholder, Credential, CardholderGroup, Alarm, Schedule, Visitor, AccessRule, CustomEntity
- If no
Nameis specified, an auto-generated name will be assigned
Creating an AccessRule:
POST /entity?q=entity=NewEntity(AccessRule),Name=My Access Rule,Guid
POST /entity?q=entity=NewEntity(AccessRule,Temporary),Name=Temporary Rule,Guid- AccessRule supports an optional second parameter for
AccessRuleType - Accepted values:
Permanent(default),Temporary
Creating a CustomEntity:
POST /entity?q=entity=NewEntity(CustomEntity,{descriptorGuid}),Name=My Custom Entity,Guid- CustomEntity requires a descriptor GUID as the second parameter
- The descriptor GUID defines the custom entity type
DELETE /entity/{guid}- Deletes the entity identified by GUID or LogicalID
POST /entity?q=entity=NewEntity(Cardholder),Name=Alice Smith,FirstName=Alice,LastName=Smith,Guid,entity=LogicalID(Credential,42),Name=My Credential,entity=ba98dc20-dc61-48ec-b70f-71c987777401,Name,Description- This request creates a cardholder, updates a credential, and retrieves fields from another entity
- You can combine creation, updates, and field projections for multiple entities, including different entity types in a single
POSTrequest - It is valid to create one entity, update another, and retrieve fields from others, all in the same request
Performance tip: For best practices on batch operations and optimizing multi-entity requests, see the Performance Guide.
Retrieve fields from a single entity:
GET /entity?q=entity=ba98dc20-dc61-48ec-b70f-71c987777401,Name,DescriptionRetrieve fields from multiple entities:
GET /entity?q=entity=ba98dc20-dc61-48ec-b70f-71c987777401,Name,entity=fcbbe59a-7036-4dc7-ae5a-2e4a23011e0c,Name,ModifiedOnRetrieve a custom field:
GET /entity?q=entity=1c9ae058-d65e-44b6-8a03-8ae663e15963,BuildingCodeBuildingCode is the custom field name.
Update multiple fields:
POST /entity?q=entity=1c9ae058-d65e-44b6-8a03-8ae663e15963,Name=South Door,Description=Exit near loading dockCall a method:
POST /entity?q=entity=cb7cd9c5-44ef-447e-b35e-bb2cd8cdee41,SetBuzzerState(true)Create a cardholder:
POST /entity?q=entity=NewEntity(Cardholder),FirstName=John,LastName=DoeDelete an entity:
DELETE /entity/63e17dc2-0c51-4667-b8e3-1894d652558fSet multiple value field
POST /entity?q=entity=201c7625-97b6-4ea6-a4d6-ff5cf279cdb4,UnlockSchedules={guid1}@{guid2}@{guid3}Certain characters must be backslash-escaped when used in property values or method arguments to prevent interference with query parsing.
1. Commas (,)
Commas must always be backslashed in values:
POST /entity?q=entity={guid},Description=fun\,crazy\,cool\,wonderful
POST /entity?q=entity={guid},MethodName(param1,value with\, comma)2. Collection Operators (@, -, *)
These characters must be backslashed when used in values:
POST /entity?q=entity={guid},Emails@user\@example.com@admin\@example.com
POST /entity?q=entity={guid},Description=Price is 10\@50% off3. Parentheses ((, ))
Opening and closing parentheses must be backslashed in values:
POST /entity?q=entity={guid},Description=Check this smiley :\)
POST /entity?q=entity={guid},Note=Formula: \(a+b\)*cNon-basic Latin characters or URL special characters should be replaced with their percent-encoded decimal Unicode value:
POST /entity?q=entity={guid},Description=Temperature: 25%C2%B0C-
%C2%B0represents the degree symbol (°) - Use standard URL encoding for characters like
+,&,#
Binary data must be Base64-encoded:
POST /entity?q=entity={guid},Picture=iVBORw0KGgoAAAANSUhEUgAAAAUA...- Field names are case-insensitive, but values preserve their original casing
- Custom field names with spaces or special characters are not supported
- You must specify at least one field to retrieve
- The endpoint supports GET for reading field values and POST for applying updates
- Use GET when retrieving entity data only
- Use POST when modifying one or more fields or multi-value fields
- A single POST can include both queries and updates
- Multiple entity types may be included in the same request
- GET requests are limited by maximum URL length. If the request exceeds this limit, the server will return HTTP status code 414 URI Too Long
Single Entity Query:
{
"Rsp": {
"Status": "Ok",
"Result": {
"Name": "cxvsdfg",
"Description": "",
"EntityType": "Door"
}
}
}Multiple Entity Query:
{
"Rsp": {
"Status": "Ok",
"Result": [
{ "Name": "Entity 1", "Description": "First entity" },
{ "Name": "Entity 2", "Description": "Second entity" }
]
}
}Entity Creation:
{
"Rsp": {
"Status": "Ok",
"Result": {
"Guid": "12345678-1234-1234-1234-123456789abc"
}
}
}Update or Method Call (No Return Value):
{
"Rsp": {
"Status": "Ok"
}
}Entity Not Found:
{
"Rsp": {
"Status": "Fail",
"Result": {
"SdkErrorCode": "UnableToRetrieveEntity",
"Message": "Could not get the entity, does it exist? Guid: 12345678-1234-1234-1234-123456789999"
}
}
}Invalid Operation:
{
"Rsp": {
"Status": "Fail",
"Result": {
"SdkErrorCode": "InvalidOperation",
"Message": "Must supply entity query."
}
}
}Transaction Failed:
{
"Rsp": {
"Status": "Fail",
"Result": {
"SdkErrorCode": "TransactionFailed",
"Message": "Transaction Failed: Property 'InvalidProperty' not found on entity."
}
}
}The ?q= syntax is the primary operational interface for entity management. It's the only way to create, update, execute methods, and modify multi-value fields.
The following endpoints provide read-only convenience access:
GET /entity/{id}
- Returns ALL properties (base + type-specific) of a single entity
- Base properties: Name, Description, LogicalID, Guid, EntityType, CreatedOn, etc.
- Type-specific properties: FirstName, LastName (Cardholder), IsLocked (Door), etc.
- Supports both GUID and LogicalID format:
LogicalID(EntityType,ID)
GET /entity/basic/{id}
- Returns only base class properties (Name, Description, LogicalID, Guid, EntityType, CreatedOn, etc.)
- No type-specific properties included
GET /entity/exists/{id}
- Validates that an entity exists
- Returns:
{"Rsp": {"Status": "Ok", "Result": {"Value": true}}}
- Referencing Entities - Entity discovery, search, and GUID formats
- Custom Fields - Working with custom entity properties
- Performance Guide - Optimization tips for entity operations
- Under the Hood - Technical architecture and reflection-based endpoints
-
Security Center SDK Developer Guide Overview of the SDK framework and how to build integrations with Security Center.
-
Platform SDK
- Platform SDK Overview Introduction to the Platform SDK and core concepts.
- SDK Certificates Details certificates, licensing, and connection validation.
- Entity Guide Explains the core entity model, inheritance, and how to work with entities.
- Entity Cache Guide Describes the engine's local entity cache and synchronization.
- SDK Transactions Covers batching operations for performance and consistency.
- ReportManager Querying entities and activity data from Security Center.
- Events and Actions Subscribing to events and handling actions.
- Logging with the Genetec SDK How to configure logging, diagnostics, and debug methods.
- Referencing SDK Assemblies Best practices for referencing assemblies and resolving them at runtime.
- SDK Compatibility Guide Understanding backward compatibility and versioning in the SDK.
-
Plugin SDK
- Plugin SDK Overview Introduction to plugin architecture and capabilities.
- Plugin SDK Certificates SDK certificate requirements for plugin roles.
- Plugin SDK Lifecycle Initialization and disposal patterns.
- Plugin SDK Threading Threading model, QueueUpdate, and async patterns.
- Plugin SDK Configuration Configuration storage and monitoring.
- Plugin SDK Restricted Configuration Secure credential storage and admin-only configuration.
- Plugin SDK Database Database integration and schema management.
- Plugin SDK Events Event subscription and handling.
- Plugin SDK Queries Query processing and response handling.
- Plugin SDK Request Manager Request/response communication with clients.
- Plugin SDK Entity Ownership Understanding plugin-owned entities, running state management, and ownership release.
- Plugin SDK Entity Mappings Using EntityMappings for plugin-specific configuration and external system integration.
- Plugin SDK State Management Reporting plugin health and diagnostics.
- Plugin SDK Server Management High availability and server failover.
- Custom Privileges Defining and enforcing custom privileges.
- Resolving Non-SDK Assemblies Handling third-party dependencies in plugins and workspace modules.
- Deploying Plugins Registering and deploying plugins and workspace modules.
-
- Macro SDK Developer Guide Complete guide to creating server-side automation scripts in Security Center using C#.
- Getting Started Setup, authentication, and basic configuration for the Web SDK.
- Referencing Entities Entity discovery, search capabilities, and parameter formats.
- Entity Operations CRUD operations, multi-value fields, and method execution.
- Partitions Managing partitions, entity membership, and user access control.
- Custom Fields Creating, reading, writing, and filtering custom entity fields.
- Custom Card Formats Managing custom credential card format definitions.
- Actions Control operations for doors, cameras, macros, and notifications.
- Events and Alarms Real-time event monitoring, alarm monitoring, and custom events.
- Incidents Incident management, creation, and attachment handling.
- Reports Activity reports, entity queries, and historical data retrieval.
- Performance Guide Optimization tips and best practices for efficient API usage.
- Reference Entity GUIDs, EntityType enumeration, and EventType enumeration.
- Under the Hood Technical architecture, query reflection, and SDK internals.
- Troubleshooting Common error resolution and debugging techniques.
- Media Gateway Guide Setup and configuration of the Media Gateway role for video streaming.
- Web Player Guide Complete guide to integrating GWP for live and playback video streaming.
- Web Player API Reference Full API documentation with interfaces, methods, properties, and events.
- Web Player Sample Application Comprehensive demo showcasing all GWP features with timeline and PTZ controls.
- Genetec Web Player Multiplexing Sample Multi-camera grid demo using a shared WebSocket connection.