# Cognitive Systems App Core API The WiFi Motion Core APIs facilitate the creation, configuration, and management of WiFi Motion networks via RESTful APIs. Additionally, it offers interfaces for accessing topologies, events, and motion data. The only difference is that the Core APIs do not specifically reference a user, and instead provide you with the ability to query the data from any network that is available in the environment. ## Security ### ApiKey Type: apiKey In: header Name: Authorization ## Download OpenAPI description [Cognitive Systems App Core API](https://docs.cognitivesystems.com/_spec/assets/specs/api/core.yaml) ## Network Settings ### Retrieve Global Settings - [GET /network/{network_id}/sounding/settings](https://docs.cognitivesystems.com/assets/specs/api/core/network-settings/getnetworksoundingsettings.md): Retrieve global network configurations. ### Update Global Settings - [PATCH /network/{network_id}/sounding/settings](https://docs.cognitivesystems.com/assets/specs/api/core/network-settings/updatenetworksoundingsettings.md): Update global network configurations. ### Retrieve Client Configuration - [GET /network/{network_id}/sounding/clients](https://docs.cognitivesystems.com/assets/specs/api/core/network-settings/getdevicesoundingsettings.md): Retrieve sounding clients and configurations. ### Update Client Configuration - [PATCH /network/{network_id}/sounding/clients](https://docs.cognitivesystems.com/assets/specs/api/core/network-settings/updatedevicesoundingsettings.md): Update sounding client[s] configuration. ## Motion History ### Network motion-state history - [GET /network/{network_id}/motion/history/state](https://docs.cognitivesystems.com/assets/specs/api/core/motion-history/getmotionhistorystate.md): Retrieve time series array of motion-state values across the whole network. ### Network motion-intensity history - [GET /network/{network_id}/motion/history/intensity](https://docs.cognitivesystems.com/assets/specs/api/core/motion-history/getmotionintensityhistory.md): Retrieve time series array of motion-intensity values across the whole network ### Network motion-density history - [GET /network/{network_id}/motion/history/density](https://docs.cognitivesystems.com/assets/specs/api/core/motion-history/getmotiondensityhistory.md): Retrieve time series array of motion-density values across the whole network. ### [BETA] Motion Blocks - [GET /network/{network_id}/motion/history/state_blocks](https://docs.cognitivesystems.com/assets/specs/api/core/motion-history/getmotionhistorystateblocks.md) ## Live Motion ### Detailed live motion - [GET /network/{network_id}/motion/live](https://docs.cognitivesystems.com/assets/specs/api/core/live-motion/getlivestreammotion.md): Opens connection to stream live motion data from the network. The websocket will stream motion data updates live from the network until closed. ### PubNub start - [POST /network/{network_id}/motion/pubnub](https://docs.cognitivesystems.com/assets/specs/api/core/live-motion/startpubnub.md) ### Motion stream start - [POST /network/{network_id}/motion/refresh](https://docs.cognitivesystems.com/assets/specs/api/core/live-motion/startlivemotionstream.md) ## Events ### Network event history - [GET /network/{network_id}/events/history](https://docs.cognitivesystems.com/assets/specs/api/core/events/geteventshistory.md): Retrieve a list of events. ### Live event stream - [GET /network/{network_id}/events/live](https://docs.cognitivesystems.com/assets/specs/api/core/events/getlivestreamevents.md): Opens a connection to stream live events from the network. The websocket will stream any new events from the network until closed. Will contain LinkEvent, NetworkEvent and MotionEvents unless filtered. ### Event tagging - [POST /network/{network_id}/events/tag](https://docs.cognitivesystems.com/assets/specs/api/core/events/tagevent.md): Adds a string based tag to an event. Tags greater than 10 characters are truncated. ### Event creation - [POST /network/{network_id}/events/create](https://docs.cognitivesystems.com/assets/specs/api/core/events/createevent.md): Creates a new event, which must have all fields in the event schema populated. Note that the attribute will be ignored if provided. Tags can be applied after the event has been created. ### Motion event pairs - [GET /network/{network_id}/events/pairs](https://docs.cognitivesystems.com/assets/specs/api/core/events/getmotioneventpairs.md): Fetch motion event pairs, which will be a pair of MotionDetectedEvent and MotionStoppedEvent events. ## Insights v2 ### Version - [GET /insights/version](https://docs.cognitivesystems.com/assets/specs/api/core/insights-v2/getinsightsversion.md): Returns version information of the home-insights microservice. If 404, the service has not been enabled. ### [BETA] Retrieve Activity Insights - [GET /insights/v2/{network_id}/activity](https://docs.cognitivesystems.com/assets/specs/api/core/insights-v2/getactivityinsights.md): [BETA] Activity Insights provides you activity related data. ### [BETA] Sleep Insights - [GET /insights/v2/{network_id}/sleep](https://docs.cognitivesystems.com/assets/specs/api/core/insights-v2/getsleepinsights.md): [BETA] Sleep Insights provides you sleep related data, including the number of interruptions that have occurred and the sleep and wake times. ### [BETA] Daily Activity Insights - [GET /insights/v2/{network_id}/activity/daily](https://docs.cognitivesystems.com/assets/specs/api/core/insights-v2/getdailyactivityinsights.md): [BETA] Provides a percentage of daily activity for the queried days. Please allow for a warmup period of between 2 and 4 hours after first being activated. ## Universal Alerting ### Retrieve Universal Alert rules - [GET /api/v1/universal-alert](https://docs.cognitivesystems.com/assets/specs/api/core/universal-alerting/getuniversalalertrules.md): Returns an array of all Universal Alert rules that are associated with the network. ### Create a single custom rule - [POST /api/v1/universal-alert](https://docs.cognitivesystems.com/assets/specs/api/core/universal-alerting/createuniversalalertrule.md): Creates a single custom Universal Alert rule. ### Get Universal Alert Status - [GET /api/v1/universal-alert/status](https://docs.cognitivesystems.com/assets/specs/api/core/universal-alerting/getuniversalalertsstatus.md): Returns an array of all alerts associated with the network, but from the view of the job queue, including all the internal state of the job. The data field of this response contains the client facing alert alert model. This endpoint is to assist with seeing the internals of the job queue. ### Get universal alert - [GET /api/v1/universal-alert/{uuid}](https://docs.cognitivesystems.com/assets/specs/api/core/universal-alerting/getuniversalalertbyuuid.md): Get a single alert by its uuid. ### Delete Universal Alert - [DELETE /api/v1/universal-alert/{uuid}](https://docs.cognitivesystems.com/assets/specs/api/core/universal-alerting/deleteuniversalalertbyuuid.md): Deletes an alert by its uuid. A successful delete will return the entire alert model. Only the alerts owned by the network can be deleted. And these alerts can be deleted by both member or owner. ### Update of Single Alert - [PATCH /api/v1/universal-alert/{uuid}](https://docs.cognitivesystems.com/assets/specs/api/core/universal-alerting/updateuniversalalertrulebyuuid.md): Update a single alert If an alert has been switched into an state because the alert has completed every possible recurrence, the mutation must include a new RRULE that has at least one occurrence in the future. Under the hood, PATCH is a get job, delete job, and create a job. Note that the following parameters cannot be mutated via the PATCH: - external_id - uuid - options path parameter can only be the uuid ### Universal Alert Bulk Enable - [PATCH /api/v1/universal-alert-bulk](https://docs.cognitivesystems.com/assets/specs/api/core/universal-alerting/bulkupdateuniversalalertrules.md): Enable or disable multiple alerts. ## Network Status ### Network topology - [GET /network/{network_id}/topology](https://docs.cognitivesystems.com/assets/specs/api/core/network-status/getnetworktopology.md) ### Network status - [GET /network/{network_id}/status](https://docs.cognitivesystems.com/assets/specs/api/core/network-status/getnetworkstatus.md): Returns the most recent GuardianStatusReport from the network. ## Network Meta ### Obtain Network Metadata - [GET /network/{network_id}/meta](https://docs.cognitivesystems.com/assets/specs/api/core/network-meta/getnetworkmetadata.md) ### Set Network metadata - [POST /network/{network_id}/meta](https://docs.cognitivesystems.com/assets/specs/api/core/network-meta/setnetworkmetadata.md) ### Update Network Metadata - [PATCH /network/{network_id}/meta](https://docs.cognitivesystems.com/assets/specs/api/core/network-meta/updatenetworkmetadata.md) ## Location Data ### Network motion-density histogram - [GET /network/{network_id}/location/histogram](https://docs.cognitivesystems.com/assets/specs/api/core/location-data/getmotiondensityhistogram.md): Retrieve time series array of motion-density values by location for network. ### [BETA] Device Motion Location History - [GET /network/{network_id}/location/history](https://docs.cognitivesystems.com/assets/specs/api/core/location-data/getmotionlocationhistory.md): History of device motion density over a requested time window. Provides the and / or fields when they are set. Indicates whether the device is a or . The results always include the mac address of the device. ## Find ### Find by Node ID of Master - [GET /network/find/masterid/{master_id}](https://docs.cognitivesystems.com/assets/specs/api/core/find/getmasternodeid.md) ### Find by Network ID - [GET /network/find/id/{network_id}](https://docs.cognitivesystems.com/assets/specs/api/core/find/getnetworkbynetworkid.md) ### Find by BSSID - [GET /network/find/mac/{bssid}](https://docs.cognitivesystems.com/assets/specs/api/core/find/getnetworkbybssid.md) ### Find by Meta field - [GET /network/find/meta/{query}](https://docs.cognitivesystems.com/assets/specs/api/core/find/getnetworkbymeta.md): : You will have to urlencode the query string here, use the library provided by your runtime. Example queries where 'val' is a partial string match (use % as wildcard char): (this will match the guardian_env key of the network meta blob) (this will match the systemName key of the dwm object in the network meta blob) Example query checking for existence of a field (omit val to directly execute): ### Find by Guardian deviceId - [GET /network/find/device/{guardian_deviceid}](https://docs.cognitivesystems.com/assets/specs/api/core/find/getnetworkbyguardianid.md) ## Application Settings ### Get application configuration by network ID - [GET /network/{network_id}/application/settings](https://docs.cognitivesystems.com/assets/specs/api/core/application-settings/getappsettings.md): Retrieves the application configuration settings for a specified network. ### Create a new application configuration - [POST /network/{network_id}/application/settings](https://docs.cognitivesystems.com/assets/specs/api/core/application-settings/createappsettings.md): Creates a new application configuration entry for a specific network with schedule settings and timezone. ### Update an application configuration - [PATCH /network/{network_id}/application/settings](https://docs.cognitivesystems.com/assets/specs/api/core/application-settings/updateappsettings.md): Updates an existing application configuration with provided fields. Only supplied fields will be updated. ### Delete application configuration by network ID - [DELETE /network/{network_id}/application/settings](https://docs.cognitivesystems.com/assets/specs/api/core/application-settings/deleteappsettingsbynetworkid.md): Deletes the application configuration settings for a specified network. ## Config ### Update Device Info - [POST /network/{network_id}/deviceinfo](https://docs.cognitivesystems.com/assets/specs/api/core/config/setdeviceinfo.md): For cloud2cloud integration. Payload will be logged and sent to device via MQTT under "device-info" schema. ### Propagate Network Configuration - [POST /network/{network_id}/config/update](https://docs.cognitivesystems.com/assets/specs/api/core/config/propagatenetworkconfig.md) ### Reset Network - [POST /network/{network_id}/config/reset](https://docs.cognitivesystems.com/assets/specs/api/core/config/resetnetwork.md): Resets configuration for the given network back to defaults. Clears any saved guardian status (which resets topology). ### Get Guardian configuration - [GET /network/{network_id}/config/guardian](https://docs.cognitivesystems.com/assets/specs/api/core/config/getguardianconfig.md) ### Set Guardian configuration - [POST /network/{network_id}/config/guardian](https://docs.cognitivesystems.com/assets/specs/api/core/config/setguardianconfig.md) ### Update Guardian configuration - [PATCH /network/{network_id}/config/guardian](https://docs.cognitivesystems.com/assets/specs/api/core/config/updateguardianconfig.md) ### Get Motion-Radar configuration - [GET /network/{network_id}/config/radar](https://docs.cognitivesystems.com/assets/specs/api/core/config/getradarconfig.md) ### Set Motion-Radar configuration - [POST /network/{network_id}/config/radar](https://docs.cognitivesystems.com/assets/specs/api/core/config/setradarconfig.md) ### Update Motion-Radar configuration - [PATCH /network/{network_id}/config/radar](https://docs.cognitivesystems.com/assets/specs/api/core/config/updateradarconfig.md) ## Node ### Find network by id - [GET /node/find/id/{nodeid}](https://docs.cognitivesystems.com/assets/specs/api/core/node/getnetworkbyid.md) ### Delete Node - [DELETE /node/{nodeid}/edit](https://docs.cognitivesystems.com/assets/specs/api/core/node/deletenodebynodeid.md) ### Find by Node deviceId - [GET /node/find/device/{deviceid}](https://docs.cognitivesystems.com/assets/specs/api/core/node/getnodebydeviceid.md) ### Find by BSSID - [GET /node/find/mac/{bssid}](https://docs.cognitivesystems.com/assets/specs/api/core/node/getnodebybssid.md): Checks all of: 2.4ghz AP BSSID, 5ghz AP BSSID, mesh BSSID, p2p BSSID ### Find (all) by Network ID - [GET /node/find/networkid/{network_id}](https://docs.cognitivesystems.com/assets/specs/api/core/node/getnodebynetworkid.md): Unlike the other Find by endpoints, this one returns an array. ### Retrieve node meta-data - [GET /node/{nodeid}/meta](https://docs.cognitivesystems.com/assets/specs/api/core/node/getdevicemetadata.md) ### Set (replace) node meta-data - [POST /node/{nodeid}/meta](https://docs.cognitivesystems.com/assets/specs/api/core/node/setdevicemetadata.md) ### Update node meta-data - [PATCH /node/{nodeid}/meta](https://docs.cognitivesystems.com/assets/specs/api/core/node/updatedevicemetadata.md) ## Management ### Execute management command - [POST /manage/execute](https://docs.cognitivesystems.com/assets/specs/api/core/management/executemanagementcommand.md) ### List management commands - [GET /manage/list](https://docs.cognitivesystems.com/assets/specs/api/core/management/getmanagementcommands.md) ### Create a batch - [POST /manage/batch](https://docs.cognitivesystems.com/assets/specs/api/core/management/createmanagementbatch.md): A batch is a group of related management commands that can be monitored using a single WebSocket. ### Queue management command - [POST /manage/create](https://docs.cognitivesystems.com/assets/specs/api/core/management/queuemanagementcommand.md): If executeNow is true, default state will be either 002 (waiting for online) or 011 (sent command one time). If trigger_id is null, default state will be 000 (pending) If trigger_id is not null, default state will be 001 (waiting for trigger) ### Monitor a batch of actions (WebSocket) - [GET /manage/monitor](https://docs.cognitivesystems.com/assets/specs/api/core/management/getwebsocketbatchactions.md): This websocket will produce a stream of updates as actions with the provided batch_id execute.