Get smart notification rule
/v2/insights/smart_notification_rules/{rule_id}Returns the smart notification rule with the given ID.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
rule_idrequired | path | integer (int32) | smart notification rule ID |
Responses
200A smart notification rule
- smart_notification_ruleobjectobject
SmartNotificationRule model
- idinteger required
Smart notification rule ID
- namestring required
Smart notification rule name
- enabledboolean required
Indicates whether the smart notification rule is enabled
- frequencystring required
Determines how often the conditions for notifications are checked
- metric_typestring required
Metric type to be monitored
- conditionstring required
Comparison condition for triggering the notification
- condition_valuenumber required
Rule threshold value (in seconds if metric type is work_time or time_spent_in_tool)
- time_unitstring
Duration of time over which the rule is evaluated. It specifies the length of the observation period
- targetobject required
Who will be monitored by the rule
objectWho will be monitored by the rule
- recipientsobject required
Who will receive the notifications when the rule conditions are met
objectWho will receive the notifications when the rule conditions are met
- deliver_byarray required
List of delivery methods for sending notifications. By default, `insights` is always included
array<string>List of delivery methods for sending notifications. By default, `insights` is always included
itemsstring - created_atstring required
When the record was created
- updated_atstring required
When the record was last updated
{
"smart_notification_rule": {
"id": 0,
"name": "string",
"enabled": false,
"frequency": "hourly",
"metric_type": "work_time",
"condition": "above",
"condition_value": 0,
"time_unit": "per_hour",
"target": {},
"recipients": {},
"deliver_by": [
"email"
],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}400Invalid parameters
Hubstaff_Public_V2_Entities_Error model
- codestring required
Legacy string error code for backward compatibility
- error_codeinteger
Numeric error code for i18n/programmatic handling. Ranges: 10000-10999 (Auth), 11000-11999 (Validation), 12000-12999 (Resource), 13000-13999 (Rate Limit), 14000-14999 (Time Entry/Activity), 15000-15999 (System). See GET /v2/error_codes for full reference.
- errorstring required
Human-readable error message
- detailsarray
Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
array<string>Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
itemsstring
{
"code": "string",
"error_code": 0,
"error": "string",
"details": [
"string"
]
}401Unauthorized
Hubstaff_Public_V2_Entities_Error model
- codestring required
Legacy string error code for backward compatibility
- error_codeinteger
Numeric error code for i18n/programmatic handling. Ranges: 10000-10999 (Auth), 11000-11999 (Validation), 12000-12999 (Resource), 13000-13999 (Rate Limit), 14000-14999 (Time Entry/Activity), 15000-15999 (System). See GET /v2/error_codes for full reference.
- errorstring required
Human-readable error message
- detailsarray
Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
array<string>Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
itemsstring
{
"code": "string",
"error_code": 0,
"error": "string",
"details": [
"string"
]
}403API access is only for organizations on an active plan
Hubstaff_Public_V2_Entities_Error model
- codestring required
Legacy string error code for backward compatibility
- error_codeinteger
Numeric error code for i18n/programmatic handling. Ranges: 10000-10999 (Auth), 11000-11999 (Validation), 12000-12999 (Resource), 13000-13999 (Rate Limit), 14000-14999 (Time Entry/Activity), 15000-15999 (System). See GET /v2/error_codes for full reference.
- errorstring required
Human-readable error message
- detailsarray
Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
array<string>Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
itemsstring
{
"code": "string",
"error_code": 0,
"error": "string",
"details": [
"string"
]
}404Could not find record
Hubstaff_Public_V2_Entities_Error model
- codestring required
Legacy string error code for backward compatibility
- error_codeinteger
Numeric error code for i18n/programmatic handling. Ranges: 10000-10999 (Auth), 11000-11999 (Validation), 12000-12999 (Resource), 13000-13999 (Rate Limit), 14000-14999 (Time Entry/Activity), 15000-15999 (System). See GET /v2/error_codes for full reference.
- errorstring required
Human-readable error message
- detailsarray
Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
array<string>Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
itemsstring
{
"code": "string",
"error_code": 0,
"error": "string",
"details": [
"string"
]
}429Rate limit exceeded
Hubstaff_Public_V2_Entities_Error model
- codestring required
Legacy string error code for backward compatibility
- error_codeinteger
Numeric error code for i18n/programmatic handling. Ranges: 10000-10999 (Auth), 11000-11999 (Validation), 12000-12999 (Resource), 13000-13999 (Rate Limit), 14000-14999 (Time Entry/Activity), 15000-15999 (System). See GET /v2/error_codes for full reference.
- errorstring required
Human-readable error message
- detailsarray
Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
array<string>Per-attribute validation errors: [{attribute, error}]. Present on validation failures.
itemsstring
{
"code": "string",
"error_code": 0,
"error": "string",
"details": [
"string"
]
}