REST API
Rule Engine REST API documentation version v1
{schema}://{host}/api/{version}
- schema: required(one of http, https - default: http)
- host: required(string - default: localhost)
- version: required(v1)
Rules
Operations on rules.
post /rules
Creates a new rule.
- tenant:rule:create
RE supports OAuth 2.0 for authenticating all API requests.
Body
Media type: application/json
Type: object
Properties
- name: required(string)
Rule name.
- description: optional (string)
Rule description.
- expression: required(string)
Rule expression.
Examples:
endpoint metadata:
{
"name": "Low battery",
"description": "Checks if sensor has low battery",
"expression": "return ctx.endpoint.getMetadata().battery.status == 'low'"
}
metadata updated trigger:
{
"name": "Comfort temperature",
"description": "Checks if temperature is 20",
"expression": "return ctx.trigger.endpointMetadataUpdated.updated.temperature.newValue == '20';"
}
time series updated trigger:
{
"name": "Comfort temperature",
"description": "Checks if temperature more than 20",
"expression": "return ctx.trigger.endpointTimeSeriesUpdated['auto~co2'][0].values.value > 20;"
}
HTTP status code 201
Rule is successfully created.
Headers
- Location: required(string)
URI in format
{schema}://{host}/re/api/v1/rules/{ruleId}
Example:
https://cloud.kaaiot.com/re/api/v1/rules/47e17fc5-060c-4923-b315-d17f6a1bf8d6
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 403
Principal does not have sufficient permissions to perform this operation.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /rules
Retrieves rules.
- rule:read
RE supports OAuth 2.0 for authenticating all API requests.
Query Parameters
- page: optional (number - default: 0)
Page number.
Example:
0
- size: optional (number - default: 100)
Page size.
Example:
10
- name: optional (string)
Name. Supports partial match.
Example:
myName
- description: optional (string)
Description. Supports partial match.
Example:
myDescription
- sort: optional (one of createdAt, updatedAt - default: createdAt)
Field to sort by.
Example:
updatedAt
- sortOrder: optional (one of asc, desc - default: desc)
Sort direction.
Example:
asc
HTTP status code 200
Rules are successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- totalElements: required(integer)
Total number of elements available for retrieval.
- content: required(array of RuleResponse)
Items: RuleResponse
- id: required(string)
Rule ID.
- name: required(string)
Rule name.
- description: optional (string)
Rule description.
- expression: required(string)
Rule expression.
- createdAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the rule was created.
Example:
2023-06-30T12:30:54.540Z
- updatedAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the rule was last updated.
Example:
2023-06-30T12:30:54.540Z
- id: required(string)
Example:
{
"content": [
{
"id": "47e17fc5-060c-4923-b315-d17f6a1bf8d6",
"name": "Low battery",
"description": "Checks if sensor has low battery",
"expression": "return ctx.endpoint.getMetadata().battery.status == 'low'",
"createdAt": "2023-06-30T12:30:54.540Z",
"updatedAt": "2023-06-30T12:30:54.541Z"
}
],
"totalElements": 1
}
HTTP status code 401
Request is not authenticated.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /rules/{ruleId}
Retrieves a specific rule.
- rule:read
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- ruleId: required(string)
Rule ID
HTTP status code 200
Rule is successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- id: required(string)
Rule ID.
- name: required(string)
Rule name.
- description: optional (string)
Rule description.
- expression: required(string)
Rule expression.
- createdAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the rule was created.
Example:
2023-06-30T12:30:54.540Z
- updatedAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the rule was last updated.
Example:
2023-06-30T12:30:54.540Z
Example:
{
"id": "47e17fc5-060c-4923-b315-d17f6a1bf8d6",
"name": "Low battery",
"description": "Checks if sensor has low battery",
"expression": "return ctx.endpoint.getMetadata().battery.status == 'low'",
"createdAt": "2023-06-30T12:30:54.540Z",
"updatedAt": "2023-06-30T12:30:54.541Z"
}
HTTP status code 401
Request is not authenticated.
HTTP status code 403
Principal does not have sufficient permissions to perform this operation.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
put /rules/{ruleId}
Updates a rule.
- rule:update
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- ruleId: required(string)
Rule ID
Body
Media type: application/json
Type: object
Properties
- name: required(string)
Rule name.
- description: optional (string)
Rule description.
- expression: required(string)
Rule expression.
Example:
{
"name": "Low battery",
"description": "Checks if sensor has low battery",
"expression": "return ctx.endpoint.getMetadata().battery.status == 'low'"
}
HTTP status code 204
Rule is successfully updated.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
delete /rules/{ruleId}
Deletes rule.
- rule:delete
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- ruleId: required(string)
Rule ID
HTTP status code 204
Rule is successfully deleted.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
/rules/{ruleId}/actions get
get /rules/{ruleId}/actions
Retrieves actions attached to rule.
- rule:read
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- ruleId: required(string)
Rule ID
HTTP status code 200
Actions attached to the rule are successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- positiveActions: required(array of AttachedAction)
Items: AttachedAction
- id: required(string)
Action ID.
- name: required(string)
Action name.
- type: required(string)
Action type.
- id: required(string)
- negativeActions: required(array of AttachedAction)
Items: AttachedAction
- id: required(string)
Action ID.
- name: required(string)
Action name.
- type: required(string)
Action type.
- id: required(string)
Example:
{
"positiveActions": [
{
"id": "1",
"name": "Switch light",
"type": "command-invocation"
}
],
"negativeActions": [
{
"id": "2",
"name": "Turn on water pump",
"type": "command-invocation"
}
]
}
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
/rules/{ruleId}/triggers get
get /rules/{ruleId}/triggers
Retrieves triggers attached to rule.
- rule:read
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- ruleId: required(string)
Rule ID
HTTP status code 200
Triggers attached to the rule are successfully retrieved.
Body
Media type: application/json
Type: array of AttachedTrigger
Items: AttachedTrigger
- id: required(string)
Trigger ID.
- name: required(string)
Trigger name.
- type: required(string)
Trigger type.
Example:
[
{
"id": "1",
"name": "Simple trigger",
"type": "cron"
}
]
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
/rules/{ruleId}/action-types/command-invocation/actions put
put /rules/{ruleId}/action-types/command-invocation/actions
Updates attached command invocation actions.
- rule:update
- command-invocation-action:update
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- ruleId: required(string)
Rule ID
Body
Media type: application/json
Type: object
Properties
- positiveActions: required(array of AttachedAction)
Items: AttachedAction
- id: required(string)
Action ID.
- name: required(string)
Action name.
- type: required(string)
Action type.
- id: required(string)
- negativeActions: required(array of AttachedAction)
Items: AttachedAction
- id: required(string)
Action ID.
- name: required(string)
Action name.
- type: required(string)
Action type.
- id: required(string)
Example:
{
"positiveActions": ["1", "2"],
"negativeActions": ["3", "4"]
}
HTTP status code 204
Attached to rule command invocation actions are successfully updated.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
/rules/{ruleId}/action-types/metadata-update/actions put
put /rules/{ruleId}/action-types/metadata-update/actions
Updates attached metadata update actions.
- rule:update
- metadata-update-action:update
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- ruleId: required(string)
Rule ID
Body
Media type: application/json
Type: object
Properties
- positiveActions: required(array of AttachedAction)
Items: AttachedAction
- id: required(string)
Action ID.
- name: required(string)
Action name.
- type: required(string)
Action type.
- id: required(string)
- negativeActions: required(array of AttachedAction)
Items: AttachedAction
- id: required(string)
Action ID.
- name: required(string)
Action name.
- type: required(string)
Action type.
- id: required(string)
Example:
{
"positiveActions": ["1", "2"],
"negativeActions": ["3", "4"]
}
HTTP status code 204
Attached to rule metadata update actions are successfully updated.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
/rules/{ruleId}/action-types/webhook/actions put
put /rules/{ruleId}/action-types/webhook/actions
Updates attached webhook actions.
- rule:update
- webhook-action:update
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- ruleId: required(string)
Rule ID
Body
Media type: application/json
Type: object
Properties
- positiveActions: required(array of AttachedAction)
Items: AttachedAction
- id: required(string)
Action ID.
- name: required(string)
Action name.
- type: required(string)
Action type.
- id: required(string)
- negativeActions: required(array of AttachedAction)
Items: AttachedAction
- id: required(string)
Action ID.
- name: required(string)
Action name.
- type: required(string)
Action type.
- id: required(string)
Example:
{
"positiveActions": ["1", "2"],
"negativeActions": ["3", "4"]
}
HTTP status code 204
Attached to rule webhook actions are successfully updated.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
/rules/{ruleId}/action-types/rule-execution/actions put
put /rules/{ruleId}/action-types/rule-execution/actions
Updates attached rule execution actions.
- rule:update
- rule-execution-action:update
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- ruleId: required(string)
Rule ID
Body
Media type: application/json
Type: object
Properties
- positiveActions: required(array of AttachedAction)
Items: AttachedAction
- id: required(string)
Action ID.
- name: required(string)
Action name.
- type: required(string)
Action type.
- id: required(string)
- negativeActions: required(array of AttachedAction)
Items: AttachedAction
- id: required(string)
Action ID.
- name: required(string)
Action name.
- type: required(string)
Action type.
- id: required(string)
Example:
{
"positiveActions": ["1", "2"],
"negativeActions": ["3", "4"]
}
HTTP status code 204
Attached rule execution actions are successfully updated.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
/rules/{ruleId}/action-types/data-sample/actions put
put /rules/{ruleId}/action-types/data-sample/actions
Updates attached data sample actions.
- rule:update
- data-sample-action:update
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- ruleId: required(string)
Rule ID
Body
Media type: application/json
Type: object
Properties
- positiveActions: required(array of AttachedAction)
Items: AttachedAction
- id: required(string)
Action ID.
- name: required(string)
Action name.
- type: required(string)
Action type.
- id: required(string)
- negativeActions: required(array of AttachedAction)
Items: AttachedAction
- id: required(string)
Action ID.
- name: required(string)
Action name.
- type: required(string)
Action type.
- id: required(string)
Example:
{
"positiveActions": ["1", "2"],
"negativeActions": ["3", "4"]
}
HTTP status code 204
Attached data sample actions are successfully updated.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
/rules/{ruleId}/trigger-types/endpoint-metadata-updated/triggers put
put /rules/{ruleId}/trigger-types/endpoint-metadata-updated/triggers
Updates attached 'endpoint metadata updated' triggers.
- rule:update
- endpoint-metadata-updated-trigger:update
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- ruleId: required(string)
Rule ID
Body
Media type: application/json
Type: array of string
Example:
[
"1"
]
HTTP status code 204
Attached 'endpoint metadata updated' triggers are successfully updated.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
/rules/{ruleId}/trigger-types/cron/triggers put
put /rules/{ruleId}/trigger-types/cron/triggers
Updates attached 'cron' triggers.
- rule:update
- cron-trigger:update
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- ruleId: required(string)
Rule ID
Body
Media type: application/json
Type: array of string
Example:
[
"1"
]
HTTP status code 204
Attached 'cron' triggers are successfully updated.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
/rules/{ruleId}/trigger-types/endpoint-time-series-updated/triggers put
put /rules/{ruleId}/trigger-types/endpoint-time-series-updated/triggers
Updates attached 'endpoint time series updated' triggers.
- rule:update
- endpoint-time-series-updated-trigger:update
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- ruleId: required(string)
Rule ID
Body
Media type: application/json
Type: array of string
Example:
[
"1"
]
HTTP status code 204
Attached 'endpoint time series updated' triggers are successfully updated.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Actions
Operations on actions.
post /action-types/command-invocation/actions
Creates a new action.
- tenant:command-invocation-action:create
RE supports OAuth 2.0 for authenticating all API requests.
Body
Media type: application/json
Type: object
Properties
- name: required(string)
Action name.
- description: optional (string)
Action description.
- endpointIdExpression: required(string)
Endpoint ID expression.
- commandType: required(string)
Command type.
- commandPayloadExpression: optional (string)
Command payload expression.
Example:
{
"name": "Switch light",
"description": "Turns on/off light depending on the endpoint state",
"endpointIdExpression": "return '65efe88c-6875-4aa6-a064-8c65f9f40514'",
"commandType": "SWITCH_LIGHT",
"commandPayloadExpression": "return {switch: ctx.endpoint.getMetadata().state === 'opened' ? 'on' : 'off'};"
}
HTTP status code 201
Action is successfully created.
Headers
- Location: required(string)
URI in format
{schema}://{host}/re/api/v1/action-types/command-invocation/actions/{actionId}
Example:
https://cloud.kaaiot.com/re/api/v1/action-types/command-invocation/actions/10
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 403
Principal does not have sufficient permissions to perform this operation.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /action-types/command-invocation/actions
Retrieves actions.
- command-invocation-action:read
RE supports OAuth 2.0 for authenticating all API requests.
Query Parameters
- page: optional (number - default: 0)
Page number.
Example:
0
- size: optional (number - default: 100)
Page size.
Example:
10
- name: optional (string)
Name. Supports partial match.
Example:
myName
- description: optional (string)
Description. Supports partial match.
Example:
myDescription
- sort: optional (one of createdAt, updatedAt - default: createdAt)
Field to sort by.
Example:
updatedAt
- sortOrder: optional (one of asc, desc - default: desc)
Sort direction.
Example:
asc
HTTP status code 200
Actions are successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- totalElements: required(integer)
Total number of elements available for retrieval.
- content: required(array of CommandActionResponse)
Items: CommandActionResponse
- id: required(string)
Action ID.
- name: required(string)
Action name.
- description: optional (string)
Action description.
- endpointIdExpression: required(string)
Endpoint ID expression.
- commandType: required(string)
Command type.
- commandPayloadExpression: optional (string)
Command payload expression.
- createdAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the rule was created.
Example:
2023-06-30T12:30:54.540Z
- updatedAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the rule was last updated.
Example:
2023-06-30T12:30:54.540Z
- id: required(string)
Example:
{
"content": [
{
"id": "1",
"name": "Switch light",
"description": "Turns on/off light depending on the endpoint state",
"endpointIdExpression": "return '65efe88c-6875-4aa6-a064-8c65f9f40514'",
"commandType": "SWITCH_LIGHT",
"commandPayloadExpression": "return {switch: ctx.endpoint.getMetadata().state === 'opened' ? 'on' : 'off'}",
"createdAt": "2023-06-30T12:30:54.540Z",
"updatedAt": "2023-06-30T12:30:54.541Z"
},
{
"id": "2",
"name": "Switch heater",
"description": "Turns on/off parent endpoint heater depending on the child endpoint state",
"endpointIdExpression": "return ctx.endpoint.getParent().getId()",
"commandType": "SWITCH_HEATER",
"commandPayloadExpression": "return {switch: ctx.endpoint.getMetadata().state === 'opened' ? 'on' : 'off'}",
"createdAt": "2023-06-30T12:30:54.540Z",
"updatedAt": "2023-06-30T12:30:54.541Z"
}
],
"totalElements": 2
}
HTTP status code 401
Request is not authenticated.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /action-types/command-invocation/actions/{actionId}
Retrieves action.
- command-invocation-action:read
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- actionId: required(string)
Action ID
HTTP status code 200
Action is successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- id: required(string)
Action ID.
- name: required(string)
Action name.
- description: optional (string)
Action description.
- endpointIdExpression: required(string)
Endpoint ID expression.
- commandType: required(string)
Command type.
- commandPayloadExpression: optional (string)
Command payload expression.
- createdAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the rule was created.
Example:
2023-06-30T12:30:54.540Z
- updatedAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the rule was last updated.
Example:
2023-06-30T12:30:54.540Z
Example:
{
"id": "1",
"name": "Switch light",
"description": "Turns on/off light depending on the endpoint state",
"endpointIdExpression": "return '65efe88c-6875-4aa6-a064-8c65f9f40514'",
"commandType": "SWITCH_LIGHT",
"commandPayloadExpression": "return {switch: ctx.endpoint.getMetadata().state === 'opened' ? 'on' : 'off'}",
"createdAt": "2023-06-30T12:30:54.540Z",
"updatedAt": "2023-06-30T12:30:54.541Z"
}
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
put /action-types/command-invocation/actions/{actionId}
Updates action.
- command-invocation-action:update
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- actionId: required(string)
Action ID
Body
Media type: application/json
Type: object
Properties
- name: required(string)
Action name.
- description: optional (string)
Action description.
- endpointIdExpression: required(string)
Endpoint ID expression.
- commandType: required(string)
Command type.
- commandPayloadExpression: optional (string)
Command payload expression.
Example:
{
"name": "Switch light",
"description": "Turns on/off light depending on the endpoint state",
"endpointIdExpression": "return '65efe88c-6875-4aa6-a064-8c65f9f40514'",
"commandType": "SWITCH_LIGHT",
"commandPayloadExpression": "return {switch: ctx.endpoint.getMetadata().state === 'opened' ? 'on' : 'off'};"
}
HTTP status code 204
Action is successfully updated.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
delete /action-types/command-invocation/actions/{actionId}
Deletes action.
- command-invocation-action:delete
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- actionId: required(string)
Action ID
HTTP status code 204
Action is successfully deleted.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
post /action-types/metadata-update/actions
Creates a new metadata update action.
- tenant:metadata-update-action:create
RE supports OAuth 2.0 for authenticating all API requests.
Body
Media type: application/json
Type: object
Properties
- name: required(string)
Action name.
- description: optional (string)
Action description.
- endpointIdExpression: required(string)
Endpoint ID expression.
- metadataKeyExpression: required(string)
Metadata key expression to update key.
- metadataValueExpression: required(string)
Metadata value expression.
Example:
{
"name": "Lighting state",
"description": "Updates the parent endpoint lighting state depending on the child endpoint state",
"endpointIdExpression": "return ctx.endpoint.getParent().getId()",
"metadataKeyExpression": "return ctx.endpoint.getMetadata().device_type + '.status'",
"metadataValueExpression": "return ctx.endpoint.getMetadata().state == 'opened' ? 'on' : 'off'"
}
HTTP status code 201
Action is successfully created.
Headers
- Location: required(string)
URI in format
{schema}://{host}/re/api/v1/action-types/metadata-update/actions/{actionId}
Example:
https://cloud.kaaiot.com/re/api/v1/action-types/metadata-update/actions/18
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 403
Principal does not have sufficient permissions to perform this operation.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /action-types/metadata-update/actions
Retrieves actions.
- metadata-update-action:read
RE supports OAuth 2.0 for authenticating all API requests.
Query Parameters
- page: optional (number - default: 0)
Page number.
Example:
0
- size: optional (number - default: 100)
Page size.
Example:
10
- name: optional (string)
Name. Supports partial match.
Example:
myName
- description: optional (string)
Description. Supports partial match.
Example:
myDescription
- sort: optional (one of createdAt, updatedAt - default: createdAt)
Field to sort by.
Example:
updatedAt
- sortOrder: optional (one of asc, desc - default: desc)
Sort direction.
Example:
asc
HTTP status code 200
Actions are successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- totalElements: required(integer)
Total number of elements available for retrieval.
- content: required(array of MetadataUpdateActionResponse)
Items: MetadataUpdateActionResponse
- id: required(string)
Action ID.
- name: required(string)
Action name.
- description: optional (string)
Action description.
- endpointIdExpression: required(string)
Endpoint ID expression.
- metadataKeyExpression: required(string)
Metadata key expression to update key
- metadataValueExpression: required(string)
Metadata value expression.
- createdAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the action was created.
Example:
2023-06-30T12:30:54.540Z
- updatedAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the action was last updated.
Example:
2023-06-30T12:30:54.540Z
- id: required(string)
Example:
{
"content": [
{
"id": "2",
"name": "Lighting state",
"description": "Updates the parent endpoint lighting state depending on the child endpoint state",
"endpointIdExpression": "return ctx.endpoint.getParent().getId()",
"metadataKeyExpression": "return ctx.endpoint.getMetadata().device_type + '.status'",
"metadataValueExpression": "return ctx.endpoint.getMetadata().state == 'opened' ? 'on' : 'off'",
"createdAt": "2023-06-30T12:30:54.540Z",
"updatedAt": "2023-06-30T12:30:54.541Z"
}
],
"totalElements": 1
}
HTTP status code 401
Request is not authenticated.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /action-types/metadata-update/actions/{actionId}
Retrieves action.
- metadata-update-action:read
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- actionId: required(string)
Action ID
HTTP status code 200
Action is successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- id: required(string)
Action ID.
- name: required(string)
Action name.
- description: optional (string)
Action description.
- endpointIdExpression: required(string)
Endpoint ID expression.
- metadataKeyExpression: required(string)
Metadata key expression to update key
- metadataValueExpression: required(string)
Metadata value expression.
- createdAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the action was created.
Example:
2023-06-30T12:30:54.540Z
- updatedAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the action was last updated.
Example:
2023-06-30T12:30:54.540Z
Example:
{
"id": "2",
"name": "Lighting state",
"description": "Updates the parent endpoint lighting state depending on the child endpoint state",
"endpointIdExpression": "return ctx.endpoint.getParent().getId()",
"metadataKeyExpression": "return ctx.endpoint.getMetadata().device_type + '.status'",
"metadataValueExpression": "return ctx.endpoint.getMetadata().state == 'opened' ? 'on' : 'off'",
"createdAt": "2023-06-30T12:30:54.540Z",
"updatedAt": "2023-06-30T12:30:54.541Z"
}
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
put /action-types/metadata-update/actions/{actionId}
Updates action.
- metadata-update-action:update
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- actionId: required(string)
Action ID
Body
Media type: application/json
Type: object
Properties
- name: required(string)
Action name.
- description: optional (string)
Action description.
- endpointIdExpression: required(string)
Endpoint ID expression.
- metadataKeyExpression: required(string)
Metadata key expression to update key.
- metadataValueExpression: required(string)
Metadata value expression.
Example:
{
"name": "Lighting state",
"description": "Updates the parent endpoint lighting state depending on the child endpoint state",
"endpointIdExpression": "return ctx.endpoint.getParent().getId()",
"metadataKeyExpression": "return ctx.endpoint.getMetadata().device_type + '.status'",
"metadataValueExpression": "return ctx.endpoint.getMetadata().state == 'opened' ? 'on' : 'off'"
}
HTTP status code 204
Action is successfully updated.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
delete /action-types/metadata-update/actions/{actionId}
Deletes action.
- metadata-update-action:delete
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- actionId: required(string)
Action ID
HTTP status code 204
Action is successfully deleted.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
post /action-types/webhook/actions
Creates a new action.
- tenant:webhook-action:create
RE supports OAuth 2.0 for authenticating all API requests.
Body
Media type: application/json
Type: object
Properties
- name: required(string)
Action name.
- description: optional (string)
Action description.
- webhookUrl: required(string)
Webhook URL.
- headers: optional (object)
Wehbook HTTP headers.
- : optional ( - repeat: function () { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return obj[val].apply(obj, args); })
- webhookPayloadExpression: optional (string)
Webhook payload expression.
Example:
{
"name": "Water leakage email alert",
"description": "Sends email alert with the endpoint water leakage state",
"webhookUrl": "https://cloud.kaaiot.com/aa/api/v1/applications/cdhn26a09eau0udkrcj2/actions/email-notification/32/webhooks/cf8qn5ooq9sqgvjlajod",
"headers": {
"X-Token": "Qf3YvMiNRZPu0ZRb2OjlxRqevccCc5tB"
},
"webhookPayloadExpression": "return 'Water leakage state is ' + ctx.endpoint.getMetadata().state.waterLeakage"
}
HTTP status code 201
Action is successfully created.
Headers
- Location: required(string)
URI in format
{schema}://{host}/re/api/v1/action-types/webhook/actions/{actionId}
Example:
https://cloud.kaaiot.com/re/api/v1/action-types/webhook/actions/37
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 403
Principal does not have sufficient permissions to perform this operation.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /action-types/webhook/actions
Retrieves actions.
- webhook-action:read
RE supports OAuth 2.0 for authenticating all API requests.
Query Parameters
- page: optional (number - default: 0)
Page number.
Example:
0
- size: optional (number - default: 100)
Page size.
Example:
10
- name: optional (string)
Name. Supports partial match.
Example:
myName
- description: optional (string)
Description. Supports partial match.
Example:
myDescription
- sort: optional (one of createdAt, updatedAt - default: createdAt)
Field to sort by.
Example:
updatedAt
- sortOrder: optional (one of asc, desc - default: desc)
Sort direction.
Example:
asc
HTTP status code 200
Actions are successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- totalElements: required(integer)
Total number of elements available for retrieval.
- content: required(array of WebhookActionResponse)
Items: WebhookActionResponse
- id: required(string)
Action ID.
- name: required(string)
Action name.
- description: optional (string)
Action description.
- webhookUrl: required(string)
Webhook URL.
- headers: optional (object)
Wehbook HTTP headers.
- : optional ( - repeat: function () { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return obj[val].apply(obj, args); })
- webhookPayloadExpression: optional (string)
Webhook payload expression.
- createdAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the action was created.
Example:
2023-06-30T12:30:54.540Z
- updatedAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the action was last updated.
Example:
2023-06-30T12:30:54.540Z
- id: required(string)
Example:
{
"content": [
{
"id": "4",
"name": "Water leakage email alert",
"description": "Sends email alert with the endpoint water leakage state",
"webhookUrl": "https://cloud.kaaiot.com/aa/api/v1/applications/cdhn26a09eau0udkrcj2/actions/email-notification/32/webhooks/cf8qn5ooq9sqgvjlajod",
"headers": {
"X-Token": "Qf3YvMiNRZPu0ZRb2OjlxRqevccCc5tB"
},
"webhookPayloadExpression": "return 'Water leakage state is ' + ctx.endpoint.getMetadata().state.waterLeakage",
"createdAt": "2023-06-30T12:30:54.540Z",
"updatedAt": "2023-06-30T12:30:54.541Z"
}
],
"totalElements": 1
}
HTTP status code 401
Request is not authenticated.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /action-types/webhook/actions/{actionId}
Retrieves action.
- webhook-action:read
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- actionId: required(string)
Action ID
HTTP status code 200
Action is successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- id: required(string)
Action ID.
- name: required(string)
Action name.
- description: optional (string)
Action description.
- webhookUrl: required(string)
Webhook URL.
- headers: optional (object)
Wehbook HTTP headers.
- : optional ( - repeat: function () { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return obj[val].apply(obj, args); })
- webhookPayloadExpression: optional (string)
Webhook payload expression.
- createdAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the action was created.
Example:
2023-06-30T12:30:54.540Z
- updatedAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the action was last updated.
Example:
2023-06-30T12:30:54.540Z
Example:
{
"id": "4",
"name": "Water leakage email alert",
"description": "Sends email alert with the endpoint water leakage state",
"webhookUrl": "https://cloud.kaaiot.com/aa/api/v1/applications/cdhn26a09eau0udkrcj2/actions/email-notification/32/webhooks/cf8qn5ooq9sqgvjlajod",
"headers": {
"X-Token": "Qf3YvMiNRZPu0ZRb2OjlxRqevccCc5tB"
},
"webhookPayloadExpression": "return 'Water leakage state is ' + ctx.endpoint.getMetadata().state.waterLeakage",
"createdAt": "2023-06-30T12:30:54.540Z",
"updatedAt": "2023-06-30T12:30:54.541Z"
}
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
put /action-types/webhook/actions/{actionId}
Updates action.
- webhook-action:update
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- actionId: required(string)
Action ID
Body
Media type: application/json
Type: object
Properties
- name: required(string)
Action name.
- description: optional (string)
Action description.
- webhookUrl: required(string)
Webhook URL.
- headers: optional ()
- webhookPayloadExpression: optional (string)
Webhook payload expression.
Example:
{
"name": "Water leakage email alert",
"description": "Sends email alert with the endpoint water leakage state",
"webhookUrl": "https://cloud.kaaiot.com/aa/api/v1/applications/cdhn26a09eau0udkrcj2/actions/email-notification/32/webhooks/cf8qn5ooq9sqgvjlajod",
"headers": {
"X-Token": "Qf3YvMiNRZPu0ZRb2OjlxRqevccCc5tB"
},
"webhookPayloadExpression": "return 'Water leakage state is ' + ctx.endpoint.getMetadata().state.waterLeakage"
}
HTTP status code 204
Action is successfully updated.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
delete /action-types/webhook/actions/{actionId}
Deletes action.
- webhook-action:delete
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- actionId: required(string)
Action ID
HTTP status code 204
Action is successfully deleted.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
post /action-types/rule-execution/actions
Creates a new action.
- tenant:rule-execution-action:create
- rule:execute
RE supports OAuth 2.0 for authenticating all API requests.
Body
Media type: application/json
Type: object
Properties
- name: required(string)
Action name.
- description: optional (string)
Action description.
- ruleId: required(string)
The ID of the rule to execute.
Example:
{
"name": "Check lighting state",
"description": "Runs the rule that checks lighting state",
"ruleId": "f6fde168-bbff-4383-9912-b9e6c51b7a88"
}
HTTP status code 201
Action is successfully created.
Headers
- Location: required(string)
URI in format
{schema}://{host}/re/api/v1/action-types/rule-execution/actions/{actionId}
Example:
https://cloud.kaaiot.com/re/api/v1/action-types/rule-execution/actions/68
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 403
Principal does not have sufficient permissions to perform this operation.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /action-types/rule-execution/actions
Retrieves actions.
- rule-execution-action:read
RE supports OAuth 2.0 for authenticating all API requests.
Query Parameters
- ruleId: optional (string)
Rule ID.
Example:
47e17fc5-060c-4923-b315-d17f6a1bf8d6
- page: optional (number - default: 0)
Page number.
Example:
0
- size: optional (number - default: 100)
Page size.
Example:
10
- sort: optional (one of createdAt, updatedAt - default: createdAt)
Field to sort by.
Example:
updatedAt
- sortOrder: optional (one of asc, desc - default: desc)
Sort direction.
Example:
asc
- name: optional (string)
Name. Supports partial match.
Example:
myName
- description: optional (string)
Description. Supports partial match.
Example:
myDescription
HTTP status code 200
Actions are successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- totalElements: required(integer)
Total number of elements available for retrieval.
- content: required(array of RuleExecutionActionResponse)
Items: RuleExecutionActionResponse
- id: required(string)
Action ID.
- name: required(string)
Action name.
- description: optional (string)
Action description.
- ruleId: required(string)
The ID of the rule to execute.
- createdAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the action was created.
Example:
2023-06-30T12:30:54.540Z
- updatedAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the action was last updated.
Example:
2023-06-30T12:30:54.540Z
- id: required(string)
Example:
{
"content": [
{
"id": "3",
"name": "Check lighting state",
"description": "Runs the rule that checks lighting state",
"ruleId": "f6fde168-bbff-4383-9912-b9e6c51b7a88",
"createdAt": "2023-06-30T12:30:54.540Z",
"updatedAt": "2023-06-30T12:30:54.541Z"
}
],
"totalElements": 1
}
HTTP status code 401
Request is not authenticated.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /action-types/rule-execution/actions/{actionId}
Retrieves action.
- rule-execution-action:read
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- actionId: required(string)
Action ID
HTTP status code 200
Action is successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- id: required(string)
Action ID.
- name: required(string)
Action name.
- description: optional (string)
Action description.
- ruleId: required(string)
The ID of the rule to execute.
- createdAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the action was created.
Example:
2023-06-30T12:30:54.540Z
- updatedAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the action was last updated.
Example:
2023-06-30T12:30:54.540Z
Example:
{
"id": "3",
"name": "Check lighting state",
"description": "Runs the rule that checks lighting state",
"ruleId": "f6fde168-bbff-4383-9912-b9e6c51b7a88",
"createdAt": "2023-06-30T12:30:54.540Z",
"updatedAt": "2023-06-30T12:30:54.541Z"
}
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
put /action-types/rule-execution/actions/{actionId}
Updates action.
- rule-execution-action:update
- rule:execute
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- actionId: required(string)
Action ID
Body
Media type: application/json
Type: object
Properties
- name: required(string)
Action name.
- description: optional (string)
Action description.
- ruleId: required(string)
The ID of the rule to execute.
Example:
{
"name": "Check lighting state",
"description": "Runs the rule that checks lighting state",
"ruleId": "f6fde168-bbff-4383-9912-b9e6c51b7a88"
}
HTTP status code 204
Action is successfully updated.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
delete /action-types/rule-execution/actions/{actionId}
Deletes action.
- rule-execution-action:delete
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- actionId: required(string)
Action ID
HTTP status code 204
Action is successfully deleted.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
post /action-types/data-sample/actions
Creates a new action.
- tenant:data-sample-action:create
RE supports OAuth 2.0 for authenticating all API requests.
Body
Media type: application/json
Type: object
Properties
- name: required(string)
Action name.
- description: optional (string)
Action description.
- endpointIdExpression: required(string)
The expression that returns the endpoint ID to send data samples on behalf of.
- dataSamplesExpression: required(string)
Expression that returns data sample(s) to send.
Example:
{
"name": "Temperature sensor",
"description": "Publishes temperature data samples.",
"endpointIdExpression": "return '65efe88c-6875-4aa6-a064-8c65f9f40514'",
"dataSamplesExpression": "return [{temperature:23}];"
}
HTTP status code 201
Action is successfully created.
Headers
- Location: required(string)
URI in format
{schema}://{host}/re/api/v1/action-types/data-sample/actions/{actionId}
Example:
https://cloud.kaaiot.com/re/api/v1/action-types/data-sample/actions/70
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 403
Principal does not have sufficient permissions to perform this operation.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /action-types/data-sample/actions
Retrieves actions.
- data-sample-action:read
RE supports OAuth 2.0 for authenticating all API requests.
Query Parameters
- page: optional (number - default: 0)
Page number.
Example:
0
- size: optional (number - default: 100)
Page size.
Example:
10
- sort: optional (one of createdAt, updatedAt - default: createdAt)
Field to sort by.
Example:
updatedAt
- sortOrder: optional (one of asc, desc - default: desc)
Sort direction.
Example:
asc
- name: optional (string)
Name. Supports partial match.
Example:
myName
- description: optional (string)
Description. Supports partial match.
Example:
myDescription
HTTP status code 200
Actions are successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- totalElements: required(integer)
Total number of elements available for retrieval.
- content: required(array of DataSampleActionResponse)
Items: DataSampleActionResponse
- id: required(string)
Action ID.
- name: required(string)
Action name.
- description: optional (string)
Action description.
- endpointIdExpression: required(string)
The expression that returns the endpoint ID to send data samples on behalf of.
- dataSamplesExpression: required(string)
Expression that returns data sample(s) to send.
- createdAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the action was created.
Example:
2023-06-30T12:30:54.540Z
- updatedAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the action was last updated.
Example:
2023-06-30T12:30:54.540Z
- id: required(string)
Example:
{
"content": [
{
"id": "5",
"name": "Temperature sensor",
"description": "Publishes temperature data samples.",
"endpointIdExpression": "return '65efe88c-6875-4aa6-a064-8c65f9f40514'",
"dataSamplesExpression": "return [{temperature:23}];",
"createdAt": "2023-06-30T12:30:54.540Z",
"updatedAt": "2023-06-30T12:30:54.541Z"
}
],
"totalElements": 2
}
HTTP status code 401
Request is not authenticated.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /action-types/data-sample/actions/{actionId}
Retrieves action.
- data-sample-action:read
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- actionId: required(string)
Action ID
HTTP status code 200
Action is successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- id: required(string)
Action ID.
- name: required(string)
Action name.
- description: optional (string)
Action description.
- endpointIdExpression: required(string)
The expression that returns the endpoint ID to send data samples on behalf of.
- dataSamplesExpression: required(string)
Expression that returns data sample(s) to send.
- createdAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the action was created.
Example:
2023-06-30T12:30:54.540Z
- updatedAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the action was last updated.
Example:
2023-06-30T12:30:54.540Z
Example:
{
"id": "5",
"name": "Temperature sensor",
"description": "Publishes temperature data samples.",
"endpointIdExpression": "return '65efe88c-6875-4aa6-a064-8c65f9f40514'",
"dataSamplesExpression": "return [{temperature:23}]",
"createdAt": "2023-06-30T12:30:54.540Z",
"updatedAt": "2023-06-30T12:30:54.541Z"
}
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
put /action-types/data-sample/actions/{actionId}
Updates action.
- data-sample-action:update
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- actionId: required(string)
Action ID
Body
Media type: application/json
Type: object
Properties
- name: required(string)
Action name.
- description: optional (string)
Action description.
- endpointIdExpression: required(string)
The expression that returns the endpoint ID to send data samples on behalf of.
- dataSamplesExpression: required(string)
Expression that returns data sample(s) to send.
Example:
{
"name": "Temperature sensor",
"description": "Publishes temperature data samples.",
"endpointIdExpression": "return '65efe88c-6875-4aa6-a064-8c65f9f40514'",
"dataSamplesExpression": "return [{temperature:23}];"
}
HTTP status code 204
Action is successfully updated.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
delete /action-types/data-sample/actions/{actionId}
Deletes action.
- data-sample-action:delete
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- actionId: required(string)
Action ID
HTTP status code 204
Action is successfully deleted.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Expressions
Operations on expressions.
/expressions/evaluation post
post /expressions/evaluation
Evaluates expression against provided data.
Body
Media type: application/json
Type: object
Properties
- expression: required(string)
Expression to evaluate.
- endpointMetadata: optional (any)
Endpoint metadata to run evaluation against.
- childrenEndpoints: optional (array of )
Children endpoints to run evaluation against.
Example:
{
"expression": "ctx.endpointMetadata['fed5c358-1240-4ff0-adca-929bae563ad3'].currentStatus == 'alarm' && ctx.childrenEndpoints['d006175b-69bc-40a1-8bda-89686102933e'].size() == 2",
"endpointMetadata": {
"currentStatus": "alarm"
},
"childrenEndpoints": [
"d006175b-69bc-40a1-8bda-89686102933e",
"7981f9a6-00b0-11ee-be56-0242ac120002"
]
}
HTTP status code 200
Expression is successfully evaluated.
Body
Media type: application/json
Type: any
Example:
true
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
Triggers
Operations on triggers.
post /trigger-types/endpoint-metadata-updated/triggers
Creates a new 'endpoint metadata updated' trigger.
- tenant:endpoint-metadata-updated-trigger:create
RE supports OAuth 2.0 for authenticating all API requests.
Body
Media type: application/json
Type: object
Properties
- name: required(string)
Trigger name.
- description: optional (string)
Trigger description.
- appName: optional (string)
Application name of the endpoint(s) that trigger will react on.
- appVersionName: optional (string)
Application version of the endpoint(s) that trigger will react on.
- endpointIds: optional (array of )
Endpoint IDs that trigger will react on.
Example:
{
"name": "1",
"description": "Trigger description",
"endpointIds": [
"98ced78d-6875-8bd6-c064-8c65f9f40514",
"65efe88c-6875-4aa6-a064-7a38f9c40519"
]
}
HTTP status code 201
Trigger is successfully created.
Headers
- Location: required(string)
URI in format
{schema}://{host}/re/api/v1/trigger-types/endpoint-metadata-updated/triggers/{triggerId}
Example:
https://cloud.kaaiot.com/re/api/v1/trigger-types/endpoint-metadata-updated/triggers/25
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 403
Principal does not have sufficient permissions to perform this operation.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /trigger-types/endpoint-metadata-updated/triggers
Returns trigger list.
- endpoint-metadata-updated-trigger:read
RE supports OAuth 2.0 for authenticating all API requests.
Query Parameters
- page: optional (number - default: 0)
Page number.
Example:
0
- size: optional (number - default: 100)
Page size.
Example:
10
HTTP status code 200
Triggers are successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- totalElements: required(integer)
Total number of elements available for retrieval.
- content: required(array of TriggerResponse)
Items: TriggerResponse
- id: required(string)
Trigger ID.
- name: required(string)
Trigger name.
- description: optional (string)
Trigger description.
- appName: optional (string)
Application name of the endpoint(s) that trigger will react on.
- appVersionName: optional (string)
Application version of the endpoint(s) that trigger will react on.
- endpointIds: optional (array of )
Endpoint IDs that trigger will react on.
- id: required(string)
Example:
{
"content": [
{
"id": "2",
"name": "'endpoint metadata updated' trigger",
"description": "'endpoint metadata updated' trigger that reacts to events on endpoints",
"endpointIds": [
"98ced78d-6875-8bd6-c064-8c65f9f40514",
"65efe88c-6875-4aa6-a064-7a38f9c40519"
],
"createdAt": "2023-06-30T12:30:54.540Z",
"updatedAt": "2023-06-30T12:30:54.541Z"
}
],
"totalElements": 1
}
HTTP status code 401
Request is not authenticated.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /trigger-types/endpoint-metadata-updated/triggers/{triggerId}
Returns trigger by ID.
- endpoint-metadata-updated-trigger:read
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- triggerId: required(string)
Trigger ID
HTTP status code 200
Trigger is successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- id: required(string)
Trigger ID.
- name: required(string)
Trigger name.
- description: optional (string)
Trigger description.
- appName: optional (string)
Application name of the endpoint(s) that trigger will react on.
- appVersionName: optional (string)
Application version of the endpoint(s) that trigger will react on.
- endpointIds: optional (array of )
Endpoint IDs that trigger will react on.
Example:
{
"id": "2",
"name": "'endpoint metadata updated' trigger",
"description": "'endpoint metadata updated' trigger that reacts to events on endpoints",
"endpointIds": [
"98ced78d-6875-8bd6-c064-8c65f9f40514",
"65efe88c-6875-4aa6-a064-7a38f9c40519"
],
"createdAt": "2023-06-30T12:30:54.540Z",
"updatedAt": "2023-06-30T12:30:54.541Z"
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
put /trigger-types/endpoint-metadata-updated/triggers/{triggerId}
Updates a trigger.
- endpoint-metadata-updated-trigger:update
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- triggerId: required(string)
Trigger ID
Body
Media type: application/json
Type: object
Properties
- name: required(string)
Trigger name.
- description: optional (string)
Trigger description.
- appName: optional (string)
Application name of the endpoint(s) that trigger will react on.
- appVersionName: optional (string)
Application version of the endpoint(s) that trigger will react on.
- endpointIds: optional (array of )
Endpoint IDs that trigger will react on.
Example:
{
"name": "1",
"description": "Trigger description",
"endpointIds": [
"98ced78d-6875-8bd6-c064-8c65f9f40514",
"65efe88c-6875-4aa6-a064-7a38f9c40519"
]
}
HTTP status code 204
Trigger is successfully updated.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
delete /trigger-types/endpoint-metadata-updated/triggers/{triggerId}
Deletes trigger.
- endpoint-metadata-updated-trigger:delete
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- triggerId: required(string)
Trigger ID
HTTP status code 204
Trigger is successfully deleted.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
post /trigger-types/endpoint-time-series-updated/trigger
Creates a new 'endpoint time series updated' trigger.
- tenant:endpoint-time-series-updated-trigger:create
RE supports OAuth 2.0 for authenticating all API requests.
Body
Media type: application/json
Type: object
Properties
- name: required(string)
Trigger name.
- description: optional (string)
Trigger description.
- appName: optional (string)
Application name of the endpoint(s) that trigger will react on.
- appVersionName: optional (string)
Application version of the endpoint(s) that trigger will react on.
- endpointIds: optional (array of )
Endpoint IDs that trigger will react on.
Example:
{
"name": "1",
"description": "Trigger description",
"endpointIds": [
"98ced78d-6875-8bd6-c064-8c65f9f40514",
"65efe88c-6875-4aa6-a064-7a38f9c40519"
]
}
HTTP status code 201
Trigger is successfully created.
Headers
- Location: required(string)
URI in format
{schema}://{host}/re/api/v1/trigger-types/endpoint-time-series-updated/triggers/{triggerId}
Example:
https://cloud.kaaiot.com/re/api/v1/trigger-types/endpoint-time-series-updated/triggers/25
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 403
Principal does not have sufficient permissions to perform this operation.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /trigger-types/endpoint-time-series-updated/trigger
Returns trigger list.
- endpoint-endpoint-time-series-updated-trigger:read
RE supports OAuth 2.0 for authenticating all API requests.
Query Parameters
- page: optional (number - default: 0)
Page number.
Example:
0
- size: optional (number - default: 100)
Page size.
Example:
10
HTTP status code 200
Triggers are successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- totalElements: required(integer)
Total number of elements available for retrieval.
- content: required(array of TriggerResponse)
Items: TriggerResponse
- id: required(string)
Trigger ID.
- name: required(string)
Trigger name.
- description: optional (string)
Trigger description.
- appName: optional (string)
Application name of the endpoint(s) that trigger will react on.
- appVersionName: optional (string)
Application version of the endpoint(s) that trigger will react on.
- endpointIds: optional (array of )
Endpoint IDs that trigger will react on.
- id: required(string)
Example:
{
"content": [
{
"id": "1",
"name": "'endpoint time series updated' trigger",
"description": "'endpoint time series updated' trigger that reacts to events on endpoints",
"endpointIds": [
"98ced78d-6875-8bd6-c064-8c65f9f40514",
"65efe88c-6875-4aa6-a064-7a38f9c40519"
]
}
],
"totalElements": 1
}
HTTP status code 401
Request is not authenticated.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /trigger-types/endpoint-time-series-updated/trigger/{triggerId}
Returns trigger by ID.
- endpoint-endpoint-time-series-updated-trigger:read
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- triggerId: required(string)
Trigger ID
HTTP status code 200
Trigger is successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- id: required(string)
Trigger ID.
- name: required(string)
Trigger name.
- description: optional (string)
Trigger description.
- appName: optional (string)
Application name of the endpoint(s) that trigger will react on.
- appVersionName: optional (string)
Application version of the endpoint(s) that trigger will react on.
- endpointIds: optional (array of )
Endpoint IDs that trigger will react on.
Example:
{
"id": "1",
"name": "'endpoint time series updated' trigger",
"description": "'endpoint time series updated' trigger that reacts to events on endpoints",
"endpointIds": [
"98ced78d-6875-8bd6-c064-8c65f9f40514",
"65efe88c-6875-4aa6-a064-7a38f9c40519"
]
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
put /trigger-types/endpoint-time-series-updated/trigger/{triggerId}
Updates a trigger.
- endpoint-endpoint-time-series-updated-trigger:update
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- triggerId: required(string)
Trigger ID
Body
Media type: application/json
Type: object
Properties
- name: required(string)
Trigger name.
- description: optional (string)
Trigger description.
- appName: optional (string)
Application name of the endpoint(s) that trigger will react on.
- appVersionName: optional (string)
Application version of the endpoint(s) that trigger will react on.
- endpointIds: optional (array of )
Endpoint IDs that trigger will react on.
Example:
{
"name": "1",
"description": "Trigger description",
"endpointIds": [
"98ced78d-6875-8bd6-c064-8c65f9f40514",
"65efe88c-6875-4aa6-a064-7a38f9c40519"
]
}
HTTP status code 204
Trigger is successfully updated.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
delete /trigger-types/endpoint-time-series-updated/trigger/{triggerId}
Deletes trigger.
- endpoint-endpoint-time-series-updated-trigger:delete
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- triggerId: required(string)
Trigger ID
HTTP status code 204
Trigger is successfully deleted.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
post /trigger-types/cron/triggers
Creates a new cron trigger.
- tenant:cron-trigger:create
RE supports OAuth 2.0 for authenticating all API requests.
Body
Media type: application/json
Type: object
Properties
- name: required(string)
Trigger name.
- description: optional (string)
Trigger description.
- cron: required(string)
Cron expression.
- appName: optional (string)
Application name of the endpoint(s) that trigger will react on.
- appVersionName: optional (string)
Application version of the endpoint(s) that trigger will react on.
- endpointIds: optional (array of )
Endpoint IDs that trigger will react on.
Example:
{
"name": "Trigger name",
"description": "Trigger description",
"cron": "0 */10 * * * ?",
"endpointIds": [
"98ced78d-6875-8bd6-c064-8c65f9f40514",
"65efe88c-6875-4aa6-a064-7a38f9c40519"
]
}
HTTP status code 201
Trigger is successfully created.
Headers
- Location: required(string)
URI in format
{schema}://{host}/re/api/v1/trigger-types/cron/triggers/{triggerId}
Example:
https://cloud.kaaiot.com/re/api/v1/trigger-types/cron/triggers/25
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 403
Principal does not have sufficient permissions to perform this operation.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /trigger-types/cron/triggers
Returns trigger list.
- cron-trigger:read
RE supports OAuth 2.0 for authenticating all API requests.
Query Parameters
- page: optional (number - default: 0)
Page number.
Example:
0
- size: optional (number - default: 100)
Page size.
Example:
10
- name: optional (string)
Name. Supports partial match.
Example:
myName
- description: optional (string)
Description. Supports partial match.
Example:
myDescription
- sort: optional (one of createdAt, updatedAt - default: createdAt)
Field to sort by.
Example:
updatedAt
- sortOrder: optional (one of asc, desc - default: desc)
Sort direction.
Example:
asc
HTTP status code 200
Triggers are successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- totalElements: required(integer)
Total number of elements available for retrieval.
- content: required(array of TriggerResponse)
Items: TriggerResponse
- id: required(string)
Trigger ID.
- name: required(string)
Trigger name.
- description: optional (string)
Trigger description.
- cron: required(string)
Cron expression.
- appName: optional (string)
Application name of the endpoint(s) that trigger will react on.
- appVersionName: optional (string)
Application version of the endpoint(s) that trigger will react on.
- endpointIds: optional (array of )
Endpoint IDs that trigger will react on.
- id: required(string)
Example:
{
"content": [
{
"id": "1",
"name": "Trigger name",
"description": "Trigger description",
"cron": "0 */10 * * * ?",
"endpointIds": [
"98ced78d-6875-8bd6-c064-8c65f9f40514",
"65efe88c-6875-4aa6-a064-7a38f9c40519"
],
"createdAt": "2023-06-30T12:30:54.540Z",
"updatedAt": "2023-06-30T12:30:54.541Z"
}
],
"totalElements": 1
}
HTTP status code 401
Request is not authenticated.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /trigger-types/cron/triggers/{triggerId}
Returns trigger by ID.
- cron-trigger:read
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- triggerId: required(string)
Trigger ID
HTTP status code 200
Trigger is successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- id: required(string)
Trigger ID.
- name: required(string)
Trigger name.
- description: optional (string)
Trigger description.
- cron: required(string)
Cron expression.
- appName: optional (string)
Application name of the endpoint(s) that trigger will react on.
- appVersionName: optional (string)
Application version of the endpoint(s) that trigger will react on.
- endpointIds: optional (array of )
Endpoint IDs that trigger will react on.
Example:
{
"id": "1",
"name": "Trigger name",
"description": "Trigger description",
"cron": "0 */10 * * * ?",
"endpointIds": [
"98ced78d-6875-8bd6-c064-8c65f9f40514",
"65efe88c-6875-4aa6-a064-7a38f9c40519"
],
"createdAt": "2023-06-30T12:30:54.540Z",
"updatedAt": "2023-06-30T12:30:54.541Z"
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
put /trigger-types/cron/triggers/{triggerId}
Updates a trigger.
- cron-trigger:update
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- triggerId: required(string)
Trigger ID
Body
Media type: application/json
Type: object
Properties
- name: required(string)
Trigger name.
- description: optional (string)
Trigger description.
- cron: required(string)
Cron expression.
- appName: optional (string)
Application name of the endpoint(s) that trigger will react on.
- appVersionName: optional (string)
Application version of the endpoint(s) that trigger will react on.
- endpointIds: optional (array of )
Endpoint IDs that trigger will react on.
Example:
{
"name": "Trigger name",
"description": "Trigger description",
"cron": "0 */10 * * * ?",
"endpointIds": [
"98ced78d-6875-8bd6-c064-8c65f9f40514",
"65efe88c-6875-4aa6-a064-7a38f9c40519"
]
}
HTTP status code 204
Trigger is successfully updated.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties
- message: required(string)
Detailed error description.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
delete /trigger-types/cron/triggers/{triggerId}
Deletes trigger.
- cron-trigger:delete
RE supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- triggerId: required(string)
Trigger ID
HTTP status code 204
Trigger is successfully deleted.
HTTP status code 401
Request is not authenticated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Traces
Operations on traces.
/traces get
get /traces
Returns traces.
- tenant:rule-execution:trace:read
RE supports OAuth 2.0 for authenticating all API requests.
Query Parameters
- traceId: optional (string)
Trace ID.
- entityType: optional (one of RULE, COMMAND_INVOCATION_ACTION, DATA_SAMPLE_ACTION, METADATA_UPDATE_ACTION, RULE_EXECUTION_ACTION, WEBHOOK_ACTION)
Entity type.
- entityId: optional (string)
Entity ID.
- outcome: optional (one of FAILURE, SUCCESS)
Execution outcome.
- page: optional (number - default: 0)
Page number.
Example:
0
- size: optional (number - default: 100)
Page size.
Example:
10
HTTP status code 200
Traces are successfully retrieved.
Body
Media type: application/json
Type: object
Properties
- totalElements: required(integer)
Total number of elements available for retrieval.
- content: required(array of TraceResponse)
Items: TraceResponse
- id: required(string)
Trace record ID. Unique for each trace record.
- traceId: required(string)
Trace ID. Common for the whole rule execution chain including attached to this rule actions and rule itself.
- entityType: required(one of RULE, COMMAND_INVOCATION_ACTION, DATA_SAMPLE_ACTION, METADATA_UPDATE_ACTION, RULE_EXECUTION_ACTION, WEBHOOK_ACTION)
Entity type that produced the trace.
- entityId: required(string)
Entity ID that produced the trace.
- outcome: required(one of FAILURE, SUCCESS)
Execution outcome.
- stage: optional (string)
Stage on which trace was taken in case outcome equal to FAILURE.
- reason: optional (string)
Outcome reason.
- metadata: optional (string)
Additional metadata.
- id: required(string)
Example:
{
"content": [
{
"id": "aa54a074-6c87-46cf-a4a1-fbec44dd4ac8",
"traceId": "da7c72c6-d914-4ab8-ac45-e7f6fb6a2c15",
"entityType": "COMMAND_INVOCATION_ACTION",
"entityId": "74",
"outcome": "FAILURE",
"stage": "ENDPOINT_ID_EXPRESSION_EVALUATION",
"reason": "TypeError: Cannot read property 'getChildren' of undefined",
"metadata": {
"endpointIdExpression": "return ctx.endpoin.getChildren().length"
}
},
{
"id": "ea279e04-3f0d-49f5-a3c5-fc46acfbd675",
"traceId": "da7c72c6-d914-4ab8-ac45-e7f6fb6a2c15",
"entityType": "DATA_SAMPLE_ACTION",
"entityId": "91",
"outcome": "SUCCESS"
}
],
"totalElements": 2
}
HTTP status code 401
Request is not authenticated.
Secured by oauth_2_0
Headers
- Authorization: optional (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.