Create Portal Rule
POST/api/portals/createportalrule
Tier: Internal — subject to change without notice.
Creates a portal rule of the given type, wiring its tuning parameters and components.
TemplateId must be the sys rule template for the rule type; its extended properties are the rule's
tuning parameters (timeouts/thresholds are in milliseconds unless individually noted otherwise — e.g.
heartbeat-related settings elsewhere in this domain are in seconds). On success raises an
Events.AgentNotificationDomainEvent so the portal device re-syncs its configuration.
Request
Responses
- 200
- 400
- 401
- 403
Returns the created rule. See PortalDtos.PortalRuleDetailDto.
RuleType does not name a known Enums.PortalRuleType member, or names
AccessControl — a member with no creation support (either way InvalidOperation, message "Unknown RuleType: '<value>'");
the organisation has no available licence quota for a licensed rule type (NoAvailableAgentLicenses,
with an agent-flavoured canned message even though the failing operation is a rule, not an agent — this
gate runs before any entity or component validation); missing required place/event components for the
configured Enums.PortalRuleAction bits (InvalidOperation with a per-rule-type field hint); or
missing required components for the rule type (e.g. an InputOutputRule with no sensors/actuators
wired returns two rows, fields ActuatorList and SensorList).
Caller is not authenticated.
Caller does not have Create permission on the Portal module.