Skip to content

Tests a specific device against all enabled automation rules (dry-run). Returns detailed evaluation results showing which rules would match and why

POST
/api/automation/test-device

Auto-generated from server.go. Handler: s.automationHandlers.TestDevice.

object
key
additional properties
any

Successful response

Tests a specific device against all enabled automation rules (dry-run). Returns detailed evaluation results showing which rules would match and why.

Lifted by tools/schema-lift on 2026-05-16 from a live sample of POST /api/automation/test-device against the demo. Required fields are conservative — server returned all of them in the seed; relax to optional if some states legitimately omit.

object
data
required
object
rules_evaluated
required
Array<object>
object
rule_id
required
string format: uuid
rule_name
required
string
priority
required
integer
action_type
required
string
source_table
required
string
Allowed values: llm_dhcp_activity_5min dhcp_events llm_dhcp_activity_1h
lookback_interval
required
integer
filter_match
required
boolean
filter_details
required
string
threshold_requirements
required
object
min_request_count
required
integer
min_unique_ips
required
integer
logic
required
string
Allowed values: OR AND
threshold_match
required
boolean
threshold_details
required
string
Allowed values: Skipped (filters did not match) Requests: 4 <= 50 (FAIL) AND UniqueIPs: 4 <= 100 (FAIL) Requests: 4 <= 500 (FAIL)
would_trigger
required
boolean
is_winning_rule
required
boolean
winning_rule
required
object
key
additional properties
any
existing_actions
required
object
key
additional properties
any
device_info
required
object
client_mac
required
string
hostname
required
string
last_seen
required
string format: date-time
total_events
required
integer
execution_time_ms
required
integer
status
required
string

The request body or parameters failed validation.

Standardised error envelope per RFC 7807. Many existing endpoints still return an older shape (e.g. {"error": "..."}). This schema documents the target shape; legacy endpoints will be migrated in Phase 70. Per D-21 the spec describes current behaviour without enforcing the migration here.

object
type

A URI reference that identifies the problem type.

string format: uri-reference
default: about:blank
title

A short human-readable summary of the problem.

string
status

The HTTP status code generated by the origin server.

integer format: int32
>= 100 <= 599
detail

A human-readable explanation specific to this occurrence.

string
instance

A URI reference that identifies the specific occurrence.

string format: uri-reference
error

Legacy error message field. Will be removed once handlers are migrated.

string
details

Legacy per-field error details. Will be removed once handlers are migrated.

object
key
additional properties
string
requestId

The request id middleware-assigned identifier for tracing.

string

Authentication is required or the supplied token is invalid.

Standardised error envelope per RFC 7807. Many existing endpoints still return an older shape (e.g. {"error": "..."}). This schema documents the target shape; legacy endpoints will be migrated in Phase 70. Per D-21 the spec describes current behaviour without enforcing the migration here.

object
type

A URI reference that identifies the problem type.

string format: uri-reference
default: about:blank
title

A short human-readable summary of the problem.

string
status

The HTTP status code generated by the origin server.

integer format: int32
>= 100 <= 599
detail

A human-readable explanation specific to this occurrence.

string
instance

A URI reference that identifies the specific occurrence.

string format: uri-reference
error

Legacy error message field. Will be removed once handlers are migrated.

string
details

Legacy per-field error details. Will be removed once handlers are migrated.

object
key
additional properties
string
requestId

The request id middleware-assigned identifier for tracing.

string

Internal server error

Standardised error envelope per RFC 7807. Many existing endpoints still return an older shape (e.g. {"error": "..."}). This schema documents the target shape; legacy endpoints will be migrated in Phase 70. Per D-21 the spec describes current behaviour without enforcing the migration here.

object
type

A URI reference that identifies the problem type.

string format: uri-reference
default: about:blank
title

A short human-readable summary of the problem.

string
status

The HTTP status code generated by the origin server.

integer format: int32
>= 100 <= 599
detail

A human-readable explanation specific to this occurrence.

string
instance

A URI reference that identifies the specific occurrence.

string format: uri-reference
error

Legacy error message field. Will be removed once handlers are migrated.

string
details

Legacy per-field error details. Will be removed once handlers are migrated.

object
key
additional properties
string
requestId

The request id middleware-assigned identifier for tracing.

string