{"openapi":"3.0.1","info":{"title":"Workflows","description":"Workflows","version":"v3"},"servers":[{"url":"https://talk.perspio.io/workflows/v3","description":"AU Region"},{"url":"https://us-talk.perspio.io/workflows/v3","description":"US Region"}],"paths":{"/eventtypes":{"get":{"tags":["Workflow Helpers"],"summary":"Get Event Types","description":"List event types within the current tenant.","operationId":"geteventtypes","responses":{"200":{"description":"The request was applied.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Display name."},"title":{"type":"string","description":"Title."},"value":{"type":"string","description":"Value."}}}},"example":[{"name":"temperature","title":"Temperature Sensor","value":"75"},{"name":"speed","title":"Vehicle Speed","value":"65"},{"name":"fuelLevel","title":"Fuel Level","value":"45%"}]}}},"400":{"description":"Invalid Request"},"401":{"description":"Invalid API Key provided or Invalid Access token"},"500":{"description":"Internal Server Error"}}}},"/assets":{"get":{"tags":["Workflow Helpers"],"summary":"Get Assets","description":"List assets within the current tenant.","operationId":"getassets","responses":{"200":{"description":"The request was applied.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Asset id."},"assetName":{"type":"string","description":"Asset name."},"customerAssetId":{"type":"string","description":"Customer-assigned asset id."},"assetTypeId":{"type":"string","description":"Asset type id."}}}},"example":[{}]}}},"400":{"description":"Invalid Request"},"401":{"description":"Invalid API Key provided or Invalid Access token"},"500":{"description":"Internal Server Error"}}},"post":{"tags":["Workflow Helpers"],"summary":"Get Workflow Scope Assets","description":"Create a request to fetch assets from scope of a workflow.","operationId":"getWorkflowScopeAssets","parameters":[{"name":"signals","in":"query","description":"Restrict the scope evaluation to these signals.","schema":{"type":"array","items":{"type":"string"}}},{"name":"includedisabledassets","in":"header","description":"When true, disabled assets are included in the tenant scope applied to this request. Defaults to false.","schema":{"type":"boolean"},"example":"False"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"type":"object","description":"Asset scope to evaluate."},"conditions":{"type":"object","description":"Rule condition to apply (RuleLine)."}},"description":"Scope and condition to evaluate (AssetScopeAndCondition)."},"example":{"scope":{},"conditions":{}}}}},"responses":{"200":{"description":"The request was applied.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Asset id."},"assetName":{"type":"string","description":"Asset name."},"customerAssetId":{"type":"string","description":"Customer-assigned asset id."},"assetTypeId":{"type":"string","description":"Asset type id."}}}},"example":[{"id":"A-1","assetName":"Excavator 12","customerAssetId":"EX-12","assetTypeId":"AT-1"}]}}},"400":{"description":"Invalid Request"},"401":{"description":"Invalid API Key provided or Invalid Access token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleMetadataApi.GetAssetsFromRuleScopeAndCondition","errorType":"NullReferenceException","statusCode":500,"request":"POST /api/assets","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/groups":{"get":{"tags":["Workflow Helpers"],"summary":"Get Groups","description":"List groups within the current tenant.","operationId":"getgroups","responses":{"200":{"description":"The request was applied.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"assetCount":{"type":"integer","description":"Asset Count.","format":"int32","nullable":true},"assetGroupName":{"type":"string","description":"Asset Group Name."},"assetIds":{"type":"array","items":{"type":"string"}},"category":{"type":"string","description":"Category."},"correlationId":{"type":"string","description":"Correlation Id."},"createdBy":{"type":"string","description":"User or system that created the record."},"createdDate":{"type":"string","description":"UTC timestamp when the record was created.","format":"date-time"},"deleted":{"type":"boolean","description":"Deleted."},"description":{"type":"string","description":"Free-text description."},"geofenceIds":{"type":"array","items":{"type":"string"}},"id":{"type":"string","description":"Unique identifier."},"ownedBy":{"type":"string","description":"Owned By."},"ownerId":{"type":"string","description":"Owner Id."},"rbacIds":{"type":"array","items":{"type":"string"}},"type":{"type":"string","description":"Type."},"tags":{"type":"array","items":{"type":"string"}},"updatedBy":{"type":"string","description":"User or system that last modified the record."},"updatedDate":{"type":"string","description":"UTC timestamp when the record was last modified.","format":"date-time"}}}},"example":[{"assetCount":12,"assetGroupName":"Group Alpha","assetIds":["asset-001","asset-002","asset-003"],"category":"Vehicle","correlationId":"corr-1001","createdBy":"user1","createdDate":"2025-07-02T08:30:00.0000000+00:00","deleted":false,"description":"Fleet assets for region A","geofenceIds":["in-gf-000123","in-gf-000456"],"id":"group-001","ownedBy":"Department A","ownerId":"owner-789","rbacIds":["rbac-001","rbac-002"],"type":"FleetGroup","tags":["priority","regional"],"updatedBy":"user2","updatedDate":"2025-07-02T09:00:00.0000000+00:00"},{"assetCount":null,"assetGroupName":"Group Beta","assetIds":["asset-010","asset-011"],"category":"Equipment","correlationId":"corr-1002","createdBy":"user3","createdDate":"2025-06-15T02:00:00.0000000+00:00","deleted":true,"description":"Archived equipment assets","geofenceIds":[],"id":"group-002","ownedBy":"Department B","ownerId":"owner-123","rbacIds":[],"type":"EquipmentGroup","tags":["archived"],"updatedBy":"user4","updatedDate":"2025-06-20T10:00:00.0000000+00:00"}]}}},"400":{"description":"Invalid Request"},"401":{"description":"Invalid API Key provided or Invalid Access token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleMetadataApi.GetGroups","errorType":"NullReferenceException","statusCode":500,"request":"GET /api/groups","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/metadata":{"get":{"tags":["Workflow Helpers"],"summary":"Get Metadata","description":"Get metadata within the current tenant.","operationId":"getmetadata","responses":{"200":{"description":"The request was applied.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"factLength":{"type":"integer","description":"Fact Length.","format":"int32","nullable":true},"name":{"type":"string","description":"Display name."},"Obsolete":{"type":"boolean","description":"Obsolete."},"title":{"type":"string","description":"Title."},"valueLength":{"type":"integer","description":"Value Length.","format":"int32","nullable":true}}}},"example":[{"factLength":null,"name":"Idle alert","Obsolete":false,"title":"value","valueLength":null}]}}},"400":{"description":"Invalid Request"},"401":{"description":"Invalid API Key provided or Invalid Access token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleMetadataApi.GetRuleMetadata","errorType":"NullReferenceException","statusCode":500,"request":"GET /api/metadata","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/{id}":{"get":{"tags":["Workflow Management"],"summary":"Get Workflow","description":"Get workflow within the current tenant.","operationId":"getWorkflow","parameters":[{"name":"id","in":"path","description":"Rule Id","required":true,"schema":{"type":"string","example":"IN-WF-000123"}}],"responses":{"200":{"description":"The request was applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowResponseObject"},"example":{"id":"rule-001","name":"High Engine Temperature Alert","enabled":true,"description":"Triggers when engine temperature exceeds threshold","scopeType":1,"triggerType":2,"createdBy":"admin@company.com","createdDate":"2024-07-01T09:00:00.0000000+00:00","updatedBy":"admin@company.com","updatedDate":"2024-07-15T10:30:00.0000000+00:00","lastExecuted":"2024-07-20T11:00:00.0000000+00:00"}}}},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.GetRuleById","errorType":"ArgumentException","statusCode":400,"request":"GET /api/workflows/IN-WF-000123","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid rule id format: 'abc123'. Expected format: xx-wf-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Access token"},"404":{"description":"Resource Not Found"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.GetRuleById","errorType":"NullReferenceException","statusCode":500,"request":"GET /api/workflows/IN-WF-000123","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}},"delete":{"tags":["Workflow Management"],"summary":"Delete Workflow","description":"Delete workflow by id within the current tenant.","operationId":"deleteWorkflow","parameters":[{"name":"id","in":"path","description":"Rule Id","required":true,"schema":{"type":"string","example":"IN-WF-000123"}}],"responses":{"200":{"description":"The workflow was deleted."},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.DeleteRuleById","errorType":"ArgumentException","statusCode":400,"request":"DELETE /api/workflows/IN-WF-000123","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid rule id format: 'abc123'. Expected format: xx-wf-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Access token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.DeleteRuleById","errorType":"NullReferenceException","statusCode":500,"request":"DELETE /api/workflows/IN-WF-000123","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/":{"get":{"tags":["Workflow Management"],"summary":"Get Workflows","description":"List workflows within the current tenant.","operationId":"getWorkflows","responses":{"200":{"description":"The request was applied.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowResponseObject"}},"example":[{"id":"rule-001","name":"High Engine Temperature Alert","enabled":true,"description":"Triggers when engine temperature exceeds threshold","scopeType":1,"triggerType":2,"createdBy":"admin@company.com","createdDate":"2024-07-01T09:00:00.0000000+00:00","updatedBy":"admin@company.com","updatedDate":"2024-07-15T10:30:00.0000000+00:00","lastExecuted":"2024-07-20T11:00:00.0000000+00:00"}]}}},"400":{"description":"Invalid Request"},"401":{"description":"Invalid API Key provided or Invalid Access token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.GetRules","errorType":"NullReferenceException","statusCode":500,"request":"GET /api/workflows","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}},"post":{"tags":["Workflow Management"],"summary":"Update Workflow","description":"Update workflow by id within the current tenant.","operationId":"updateWorkflow","parameters":[{"name":"clearsuppression","in":"query","description":"When true (default), clear suppression on the rule when updating it.","schema":{"type":"boolean"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRule-RequestObject"},"example":{"name":"Occupancy Hourly Update (SMS)","description":"Hourly update between 7AM-7PM","enabled":true,"isGlobal":false,"scope":{"scopeType":1,"objectRefs":["sc-000107"]},"trigger":{"startDate":null,"endDate":null,"timeZone":null,"schedule":[{"dayOfWeek":1,"timeIntervals":"07:00-19:00"},{"dayOfWeek":2,"timeIntervals":"07:00-19:00"},{"dayOfWeek":3,"timeIntervals":"07:00-19:00"},{"dayOfWeek":4,"timeIntervals":"07:00-19:00"},{"dayOfWeek":5,"timeIntervals":"07:00-19:00"}],"pollingBasedRepeatEvery":null,"suppressionTimeout":"3600s","triggerType":0,"isPollingBased":false},"conditions":{"fact":"occupants","operator":"greaterthan","value":"1"},"actions":[{"actionTemplateId":"sms","actionInput":{"to":["+61433114944"],"body":"{{occupants}} people inside SC HQ."}},{"actionTemplateId":"sms","actionInput":{"to":["+61402000660"],"body":"{{occupants}} people inside SC HQ."}}],"workflowType":1}}}},"responses":{"200":{"description":"The request was applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowResponseObject"},"example":{"id":"value","name":"value","enabled":false,"description":"value","scopeType":0,"triggerType":0,"createdBy":"value","createdDate":"value","updatedBy":"value","updatedDate":"value","lastExecuted":"value"}}}},"400":{"description":"Invalid Request"},"401":{"description":"Invalid API Key provided or Invalid Access token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.UpdateRule","errorType":"NullReferenceException","statusCode":500,"request":"POST /api/workflows","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/{id}/copy":{"post":{"tags":["Workflow Management"],"summary":"Copy Workflow","description":"Copy a workflow to a new workflow. The copy is always created disabled. The request body is optional: a non-blank name and/or description overrides the corresponding default and is trimmed. Values that are omitted, null or blank (whitespace only) fall back to their defaults - the copy is named 'Copy of <original name>' and keeps the original workflow's description.","operationId":"copyWorkflow","parameters":[{"name":"id","in":"path","description":"Rule Id","required":true,"schema":{"type":"string","example":"IN-WF-000123"}}],"requestBody":{"description":"Optional copy workflow request data. Omit the body - or leave either value omitted, null or blank (whitespace only) - to use the default name and description. Non-blank values override the defaults and are trimmed.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name of the new copied workflow; optional. A non-blank value overrides the default and is trimmed; omitted, null or blank (whitespace only) values default to 'Copy of <original name>'."},"description":{"type":"string","description":"Description for the new workflow; optional. A non-blank value overrides the default and is trimmed; omitted, null or blank (whitespace only) values default to the original workflow's description."}}},"example":{"name":"Copied Workflow Name","description":"Optional description for the copied workflow"}}}},"responses":{"200":{"description":"The request was applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowResponseObject"},"example":{"id":"value","name":"value","enabled":false,"description":"value","scopeType":0,"triggerType":0,"createdBy":"value","createdDate":"value","updatedBy":"value","updatedDate":"value","lastExecuted":"value"}}}},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.CopyRule","errorType":"ArgumentException","statusCode":400,"request":"POST /api/workflows/IN-WF-000123/copy","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid rule id format: 'abc123'. Expected format: xx-wf-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Access token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.CopyRule","errorType":"NullReferenceException","statusCode":500,"request":"POST /api/workflows/IN-WF-000123/copy","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/{id}/manualtrigger":{"post":{"tags":["Workflow Management"],"summary":"Workflow Manual Trigger","description":"Create a manual trigger for a workflow.","operationId":"workflowManualTrigger","parameters":[{"name":"id","in":"path","description":"Rule Id","required":true,"schema":{"type":"string","example":"IN-WF-000123"}}],"responses":{"200":{"description":"The workflow was triggered."},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.ManualTriggerRule","errorType":"ArgumentException","statusCode":400,"request":"POST /api/workflows/IN-WF-000123/manualtrigger","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid rule id format: 'abc123'. Expected format: xx-wf-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Access token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.ManualTriggerRule","errorType":"NullReferenceException","statusCode":500,"request":"POST /api/workflows/IN-WF-000123/manualtrigger","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/schema":{"post":{"tags":["Workflow Helpers"],"summary":"Get Data Schema From workflow Scope","description":"Create a request to fetch data schema from scope of a workflow.","operationId":"getRuleScopeDataSchema","parameters":[{"name":"extended","in":"query","description":"When true, return the extended data schema.","schema":{"type":"boolean"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetDataSchemaFromRuleScope-RequestObject"},"example":{"scopeType":3,"objectRefs":["in-000001","in-000002"]}}}},"responses":{"200":{"description":"The request was applied.","content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"Title."},"description":{"type":"string","description":"Free-text description."},"dataType":{"type":"string","description":"Data Type."},"unitType":{"type":"string","description":"Unit Type."},"isAggregatable":{"type":"boolean","description":"Is Aggregatable."},"format":{"type":"object"},"flags":{"type":"object"},"position":{"type":"object"}},"additionalProperties":{"type":"string"}},"example":{"key":{"title":"value","description":"Alerts when an asset is idle.","dataType":"asset","unitType":"asset"}}}}},"400":{"description":"Invalid Request"},"401":{"description":"Invalid API Key provided or Invalid Access token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleMetadataApi.GetDataSchemaFromRuleScope","errorType":"NullReferenceException","statusCode":500,"request":"POST /api/schema","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/{id}/history":{"get":{"tags":["Workflow Helpers"],"summary":"Get Workflow Trigger History","description":"Fetch trigger history for a specific workflow.","operationId":"getWorkflowTriggerHistory","parameters":[{"name":"id","in":"path","description":"Rule Id","required":true,"schema":{"type":"string","example":"IN-WF-000123"}},{"name":"from","in":"query","description":"Start datetime for the history","required":true,"schema":{"type":"string","format":"date-time","example":"2024-06-19T02:00:00.0000000+00:00"}},{"name":"to","in":"query","description":"End datetime for the history","schema":{"type":"string","format":"date-time","example":"2024-06-20T01:59:59.0000000+00:00"}},{"name":"withActions","in":"query","description":"When true, include the actions taken for each trigger.","schema":{"type":"boolean"}},{"name":"ContinuationToken","in":"header","description":"Opaque token from a previous response's ContinuationToken header, to fetch the next page.","schema":{"type":"string"}}],"responses":{"200":{"description":"The request was applied.","headers":{"ContinuationToken":{"description":"Opaque token to fetch the next page; absent on the last page.","schema":{"type":"string"},"example":"eyJ0b2tlbiI6IjEyMyJ9"},"ResultCount":{"description":"Number of items returned in this page.","schema":{"type":"integer"},"example":50},"TotalCount":{"description":"Total number of items across all pages.","schema":{"type":"integer"},"example":1234}},"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"actionsTriggered":{"type":"string","description":"Actions Triggered."},"correlationId":{"type":"string","description":"Correlation Id."},"dateUtc":{"type":"string","description":"Date Utc.","format":"date-time","nullable":true},"durationMilliseconds":{"type":"integer","description":"Duration Milliseconds.","format":"int64","nullable":true},"ExtraProperties":{"type":"object"},"id":{"type":"string","description":"Unique identifier."},"isInSchedule":{"type":"boolean","description":"Is In Schedule."},"isOk":{"type":"boolean","description":"Is Ok."},"isSuppressed":{"type":"boolean","description":"Is Suppressed."},"Item":{"type":"object"},"objectId":{"type":"string","description":"Object Id."},"objectTime":{"type":"string","description":"Object Time."},"objectTimeZone":{"type":"string","description":"Object Time Zone."},"ruleId":{"type":"string","description":"Rule Id."},"ruleName":{"type":"string","description":"Rule Name."},"tenantId":{"type":"string","description":"Tenant Id."},"triggerObjectId":{"type":"string","description":"Trigger Object Id."},"triggerType":{"type":"string","description":"Type of trigger for the workflow."}}}},"example":[{"actionsTriggered":"AlertSent,NotificationLogged","correlationId":"corr-001","dateUtc":"2025-07-02T10:15:30.0000000+00:00","durationMilliseconds":3500,"ExtraProperties":{"severity":"high","source":"sensorA"},"id":"event-123","isInSchedule":true,"isOk":false,"isSuppressed":false,"Item":{"name":"TemperatureSensor","value":78.5},"objectId":"obj-789","objectTime":"2025-07-02T10:10:00.0000000+00:00","objectTimeZone":"UTC","ruleId":"rule-456","ruleName":"HighTempAlert","tenantId":"tenant-001","triggerObjectId":"trigger-321","triggerType":"ThresholdExceeded"},{"actionsTriggered":"LogOnly","correlationId":"corr-002","dateUtc":null,"durationMilliseconds":null,"ExtraProperties":{},"id":"event-124","isInSchedule":false,"isOk":true,"isSuppressed":true,"Item":{},"objectId":"obj-790","objectTime":"2025-07-01T22:30:00.0000000+00:00","objectTimeZone":"PST","ruleId":"rule-457","ruleName":"LowBatteryWarning","tenantId":"tenant-002","triggerObjectId":"trigger-322","triggerType":"BatteryLevelLow"}]}}},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.GetRuleTriggerHistory","errorType":"ArgumentException","statusCode":400,"request":"GET /api/workflows/IN-WF-000123/history","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid rule id format: 'abc123'. Expected format: xx-wf-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Access token"},"404":{"description":"Resource Not Found"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.GetRuleTriggerHistory","errorType":"NullReferenceException","statusCode":500,"request":"GET /api/workflows/IN-WF-000123/history","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/metrics/count":{"get":{"tags":["Workflow Helpers"],"summary":"Get Workflow History Metrics Count","description":"Get workflowhistory metrics count.","operationId":"getWorkflowhistoryMetricsCount","parameters":[{"name":"daterange","in":"query","description":"Date Range","schema":{"type":"string"}},{"name":"timezone","in":"query","description":"TimeZone","schema":{"type":"string"}},{"name":"objectIds","in":"query","description":"Comma separated list of Asset ids","schema":{"type":"string"}},{"name":"groupby","in":"query","description":"Comma separated list of keys to summarize data","schema":{"type":"string"}}],"responses":{"200":{"description":"The request was applied.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"sourceTimeStamp":{"type":"string","description":"Source Time Stamp."},"ruleId":{"type":"string","description":"Rule Id."},"count":{"type":"number","description":"Count value."}}}},"example":[{}]}}},"400":{"description":"Invalid Request"},"401":{"description":"Invalid API Key provided or Invalid Access token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.GetRuleTriggerHistoryMetricsCount","errorType":"NullReferenceException","statusCode":500,"request":"GET /api/workflows/metrics/count","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/{id}/checkpoints":{"get":{"tags":["Checkpoints"],"summary":"Get Workflow Checkpoints","description":"Fetch checkpoints of a workflow.","operationId":"getWorkflowCheckpoints","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"IN-WF-000123"}},{"name":"issuppressed","in":"query","description":"Filter checkpoints by suppression state.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"The request was applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowCheckpoints"},"example":[{"id":"value","ruleId":"value","triggetType":0,"objectId":"value","extendedId":"value","objectName":"value","isSuppressed":false,"data":null}]}}},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.GetRuleCheckpoints","errorType":"ArgumentException","statusCode":400,"request":"GET /api/workflows/IN-WF-000123/checkpoints","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid rule id format: 'abc123'. Expected format: xx-wf-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Access token"},"404":{"description":"Resource Not Found"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.GetRuleCheckpoints","errorType":"NullReferenceException","statusCode":500,"request":"GET /api/workflows/IN-WF-000123/checkpoints","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/{id}/checkpoints/{objectId}/unsuppress":{"post":{"tags":["Checkpoints"],"summary":"Unsuppress Workflow Object Checkpoint","description":"Create a request to unsuppress a workflow object checkpoint.","operationId":"unsuppressWorkflowObjectCheckpoint","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"IN-WF-000123"}},{"name":"objectId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The object checkpoints were unsuppressed."},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.UnsuppressCheckpointsByObjectId","errorType":"ArgumentException","statusCode":400,"request":"POST /api/workflows/IN-WF-000123/checkpoints/IN-WF-000123/unsuppress","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid rule id format: 'abc123'. Expected format: xx-wf-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Access token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.UnsuppressCheckpointsByObjectId","errorType":"NullReferenceException","statusCode":500,"request":"POST /api/workflows/IN-WF-000123/checkpoints/IN-WF-000123/unsuppress","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/{id}/checkpoints/unsuppress":{"post":{"tags":["Checkpoints"],"summary":"Unsuppress Workflow Checkpoint","description":"Create a request to unsuppress checkpoint of a workflow.","operationId":"unsuppressWorkflowCheckpoint","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"IN-WF-000123"}}],"responses":{"200":{"description":"The checkpoints were unsuppressed."},"400":{"description":"Invalid Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.UnsuppressAllCheckpoints","errorType":"ArgumentException","statusCode":400,"request":"POST /api/workflows/IN-WF-000123/checkpoints/unsuppress","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Invalid rule id format: 'abc123'. Expected format: xx-wf-nnnnnn"}}}},"401":{"description":"Invalid API Key provided or Invalid Access token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.UnsuppressAllCheckpoints","errorType":"NullReferenceException","statusCode":500,"request":"POST /api/workflows/IN-WF-000123/checkpoints/unsuppress","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}},"/metrics/count2":{"get":{"tags":["Workflow Helpers"],"summary":"Get Workflow History Metrics Count with Actions","description":"Fetch trigger count of workflow with Actions.","operationId":"getWorkflowhistoryMetricsCount2","parameters":[{"name":"daterange","in":"query","description":"Date Range","schema":{"type":"string"}},{"name":"timezone","in":"query","description":"TimeZone","schema":{"type":"string"}},{"name":"objectIds","in":"query","description":"Comma separated list of Asset ids","schema":{"type":"string"}},{"name":"groupby","in":"query","description":"Comma separated list of keys to summarize data","schema":{"type":"string"}},{"name":"fillGaps","in":"query","description":"Fill missing date gaps (default is 'true')","schema":{"type":"string"}},{"name":"withActions","in":"query","description":"Include count of succeeded of failed actions (default is 'true')","schema":{"type":"string"}},{"name":"summaryby","in":"query","description":"Timeframes to summirise by (default is 'day')","schema":{"type":"string"}}],"responses":{"200":{"description":"The request was applied.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"sourceTimeStamp":{"type":"string","description":"Source Time Stamp."},"ruleId":{"type":"string","description":"Rule Id."},"count":{"type":"number","description":"Count value."},"successCount":{"type":"number","description":"Success Count."},"failureCount":{"type":"number","description":"Failure Count."}}}},"example":[{}]}}},"400":{"description":"Invalid Request"},"401":{"description":"Invalid API Key provided or Invalid Access token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerspioError"},"example":{"functionName":"Perspio.API.RulesData.RuleDataApi.GetRuleTriggerHistoryMetricsCount2","errorType":"NullReferenceException","statusCode":500,"request":"GET /api/workflows/metrics/count2","tenantId":"in-93b1a4c6-1234-4c1c-9d2a-1f2e3d4c5b6a","message":"Internal Server Error: Object reference not set to an instance of an object."}}}}}}}},"components":{"schemas":{"PerspioError":{"type":"object","properties":{"functionName":{"type":"string","description":"Name of the backend function that raised the error."},"errorType":{"type":"string","description":"Exception/error type name."},"statusCode":{"type":"integer","description":"HTTP status code of the error.","format":"int32"},"request":{"type":"string","description":"Method and URL of the failing request."},"tenantId":{"type":"string","description":"Tenant the request was executed for."},"message":{"type":"string","description":"Human-readable error message."}},"description":"Standard Perspio backend error body (ErrorResultObject emitted by the error-handling middleware)."},"WorkflowResponseObject":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier."},"name":{"type":"string","description":"Display name."},"enabled":{"type":"boolean","description":"Whether the workflow is enabled."},"description":{"type":"string","description":"Free-text description."},"scopeType":{"type":"number","description":"Type of scope the workflow applies to."},"triggerType":{"type":"number","description":"Type of trigger for the workflow."},"createdBy":{"type":"string","description":"User or system that created the record."},"createdDate":{"type":"string","description":"UTC timestamp when the record was created."},"updatedBy":{"type":"string","description":"User or system that last modified the record."},"updatedDate":{"type":"string","description":"UTC timestamp when the record was last modified."},"lastExecuted":{"type":"string","description":"UTC timestamp of the last execution."}}},"GetDataSchemaFromRuleScope-RequestObject":{"type":"object","properties":{"scopeType":{"type":"integer","description":"Type of scope the workflow applies to."},"objectRefs":{"type":"array","items":{"type":"string"}}}},"UpdateCustomRuleActionTemplate-RequestObject":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier."},"type":{"type":"string","description":"Type."},"isCommon":{"type":"boolean","description":"Is Common."},"actionTypeId":{"type":"integer","description":"Action Type Id."},"actionTypeName":{"type":"string","description":"Action Type Name."},"title":{"type":"string","description":"Title."},"description":{"type":"string","description":"Free-text description."},"sections":{"description":"Sections."},"items":{"type":"array","items":{"required":["itemId","sectionId","title","description","type","editable","choices","value"],"type":"object","properties":{"itemId":{"type":"string","description":"Item Id."},"sectionId":{"description":"Section Id."},"title":{"type":"string","description":"Title."},"description":{"type":"string","description":"Free-text description."},"type":{"type":"string","description":"Type."},"editable":{"type":"boolean","description":"Editable."},"choices":{"description":"Choices."},"value":{"type":"string","description":"Value."}}}}}},"UpdateRule-RequestObject":{"type":"object","properties":{"name":{"type":"string","description":"Display name."},"description":{"type":"string","description":"Free-text description."},"enabled":{"type":"boolean","description":"Whether the workflow is enabled."},"isGlobal":{"type":"boolean","description":"Is Global."},"scope":{"type":"object","properties":{"scopeType":{"type":"integer","description":"Type of scope the workflow applies to."},"objectRefs":{"type":"array","items":{"type":"string"}}}},"trigger":{"type":"object","properties":{"startDate":{"description":"Start Date."},"endDate":{"description":"End Date."},"timeZone":{"description":"Time Zone."},"schedule":{"type":"array","items":{"required":["dayOfWeek","timeIntervals"],"type":"object","properties":{"dayOfWeek":{"type":"integer","description":"Day Of Week."},"timeIntervals":{"type":"string","description":"Time Intervals."}}}},"pollingBasedRepeatEvery":{"description":"Polling Based Repeat Every."},"suppressionTimeout":{"type":"string","description":"Suppression Timeout."},"triggerType":{"type":"integer","description":"Type of trigger for the workflow."},"isPollingBased":{"type":"boolean","description":"Is Polling Based."}}},"conditions":{"type":"object","properties":{"fact":{"type":"string","description":"Fact."},"operator":{"type":"string","description":"Operator."},"value":{"type":"string","description":"Value."}}},"actions":{"type":"array","items":{"required":["actionTemplateId","actionInput"],"type":"object","properties":{"actionTemplateId":{"type":"string","description":"Action Template Id."},"actionInput":{"type":"object","properties":{"to":{"type":"array","items":{"type":"string"}},"body":{"type":"string","description":"Body."}}}}}},"workflowType":{"type":"integer","description":"Workflow Type."}}},"Data":{"type":"object","properties":{"lastState":{"type":"boolean","description":"Last State.","example":true},"lastTriggerDateUtc":{"type":"string","description":"Last Trigger Date Utc.","format":"date-time","example":"2024-09-27T02:00:13.0000000+00:00"},"lastCheckDateUtc":{"type":"string","description":"Last Check Date Utc.","format":"date-time","example":"2025-01-16T09:00:08.0000000+00:00"},"nextCheckDateUtc":{"type":"string","description":"Next Check Date Utc.","format":"date-time","example":"2025-01-16T11:00:00.0000000+00:00"},"nextTriggerDateUtc":{"type":"string","description":"Next Trigger Date Utc.","format":"date-time","example":"0001-01-01T12:00:00.0000000+00:00"},"ruleOKDateUtc":{"type":"string","description":"Rule OKDate Utc.","format":"date-time","nullable":true,"example":null}}},"RuleTrigger":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier.","example":"rules/br-wf-000027/br-000016/G9TAK2SCCYXM"},"ruleId":{"type":"string","description":"Rule Id.","example":"br-wf-000027"},"triggetType":{"type":"integer","description":"Trigget Type.","example":1},"objectId":{"type":"string","description":"Object Id.","example":"br-000016"},"extendedId":{"type":"string","description":"Extended Id.","example":"G9TAK2SCCYXM"},"objectName":{"type":"string","description":"Object Name.","example":"INTERNATIONAL DURASTAR 4300"},"isSuppressed":{"type":"boolean","description":"Is Suppressed.","example":true},"data":{"$ref":"#/components/schemas/Data"}}},"WorkflowCheckpoints":{"type":"array","items":{"$ref":"#/components/schemas/RuleTrigger"}}},"securitySchemes":{"oauth2":{"type":"oauth2","description":"Client credentials from your Perspio API application. See Get Access Token.","flows":{"clientCredentials":{"tokenUrl":"/auth/v3/token","scopes":{}}}},"subscriptionKey":{"type":"apiKey","name":"Ocp-Apim-Subscription-Key","in":"header","description":"Your tenant's subscription key, from your API application."},"tenantId":{"type":"apiKey","name":"tid","in":"header","description":"Your tenant ID (tid), from your API application."}}},"security":[{"oauth2":[],"subscriptionKey":[],"tenantId":[]}],"tags":[{"name":"Workflow Helpers","description":"Workflow scope/metadata/metrics helpers."},{"name":"Checkpoints","description":"Workflow checkpoints and suppression."},{"name":"Workflow Management","description":"Workflow (rule) CRUD, copy and manual trigger."}],"x-readme":{"oauth-options":{"useInsecureClientAuthentication":true}}}