Skip to content

Fast device search for autocomplete. Supports searching by MAC address, hostname, vendor class, or IP address. Returns matching devices with their current action status

GET
/api/devices/search

Auto-generated from server.go. Handler: s.SearchDevices.

Successful response

Fast device search for autocomplete. Supports searching by MAC address, hostname, vendor class, or IP address. Returns matching devices with their current action status.

Schema hand-corrected in Session 9 from the 70-03a auto-lift artifact: the original lift sampled an empty results array, which inferred map[string]interface{} instead of []DeviceSearchResult. Now correctly typed as an array of typed device records.

object
status
required
string
data
required
object
results
required
Array<object>
object
client_mac
required
string
hostname
required
string
vendor_class
required
string
last_ip
required
string
event_count
required

Uint64 in Go; JSON number.

integer format: int64
last_seen
required

Time.Time, marshaled as RFC3339 by encoding/json.

string format: date-time
statuses
required

All active action types for this device (allow, block, deny, monitor, throttle). Empty array when device has no active actions.

Array<string>
query_type
required
string
total_matches
required
integer
metadata
required
object
execution_time_ms
required
integer format: int64

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