> For the complete documentation index, see [llms.txt](https://docs.hotwax.co/documents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hotwax.co/documents/integrate-with-hotwax/components/admin/device.md).

# Device

Device and Agent Control Management

## get DeviceId

> Get or create a device ID for an execution agent.\
> &#x20;           If deviceId is provided and exists, returns it after updating lastSeenDate.\
> &#x20;           If deviceId is not provided or doesn't exist, creates a new ExecutionAgent record.

```json
{"openapi":"3.1.1","info":{"title":"Commerce Admin REST API","version":"4.0.0"},"tags":[{"name":"device","description":"Device and Agent Control Management"}],"servers":[{"url":"https://dev-maarg.hotwax.io/rest/s1/admin"}],"security":[{"basicAuth":[]},{"api_key":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"},"api_key":{"type":"apiKey","name":"api_key","in":"header","description":"HTTP Header api_key"}},"schemas":{"co.hotwax.oms.AgentControlServices.getDeviceId.Out":{"type":"object","properties":{"deviceId":{"type":"string"},"isNewDevice":{"type":"boolean"}},"required":["deviceId"]},"co.hotwax.oms.AgentControlServices.getDeviceId.In":{"type":"object","properties":{"deviceId":{"type":"string"},"facilityId":{"type":"string"},"agentTypeEnumId":{"type":"string","default":"AGT_PWA"}},"required":["facilityId"]}}},"paths":{"/device/id":{"post":{"tags":["device"],"summary":"get DeviceId","description":"Get or create a device ID for an execution agent.\n            If deviceId is provided and exists, returns it after updating lastSeenDate.\n            If deviceId is not provided or doesn't exist, creates a new ExecutionAgent record.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/co.hotwax.oms.AgentControlServices.getDeviceId.Out"}}}},"401":{"description":"Authentication required"},"403":{"description":"Access Forbidden (no authz)"},"429":{"description":"Too Many Requests (tarpit)"},"500":{"description":"General Error"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/co.hotwax.oms.AgentControlServices.getDeviceId.In"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/co.hotwax.oms.AgentControlServices.getDeviceId.In"}}},"required":true}}}}}
```

## get DeviceInstructions

> Fetch active instructions for a device based on scope (ALL, FACILITY, DEVICE).\
> &#x20;           Returns only unacknowledged instructions within the active date range.\
> &#x20;           Creates assignment records for newly assigned instructions.

```json
{"openapi":"3.1.1","info":{"title":"Commerce Admin REST API","version":"4.0.0"},"tags":[{"name":"device","description":"Device and Agent Control Management"}],"servers":[{"url":"https://dev-maarg.hotwax.io/rest/s1/admin"}],"security":[{"basicAuth":[]},{"api_key":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"},"api_key":{"type":"apiKey","name":"api_key","in":"header","description":"HTTP Header api_key"}},"schemas":{"co.hotwax.oms.AgentControlServices.getDeviceInstructions.Out":{"type":"object","properties":{"instructions":{"type":"array","items":{"type":"object"}}}}}},"paths":{"/device/instructions":{"get":{"tags":["device"],"summary":"get DeviceInstructions","description":"Fetch active instructions for a device based on scope (ALL, FACILITY, DEVICE).\n            Returns only unacknowledged instructions within the active date range.\n            Creates assignment records for newly assigned instructions.","parameters":[{"schema":{"type":"string","format":""},"name":"deviceId","in":"query","required":false,"description":null},{"schema":{"type":"string","format":""},"name":"facilityId","in":"query","required":false,"description":null},{"schema":{"type":"string","format":""},"name":"agentTypeEnumId","in":"query","required":false,"description":null},{"schema":{"type":"string","format":""},"name":"applicationId","in":"query","required":false,"description":null}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/co.hotwax.oms.AgentControlServices.getDeviceInstructions.Out"}}}},"401":{"description":"Authentication required"},"403":{"description":"Access Forbidden (no authz)"},"429":{"description":"Too Many Requests (tarpit)"},"500":{"description":"General Error"}}}}}}
```

## acknowledge Instruction

> Acknowledge that a device has executed an instruction.\
> &#x20;           Updates the ackDate in AgentCtrlInstrAsgn for the given instruction and device.

```json
{"openapi":"3.1.1","info":{"title":"Commerce Admin REST API","version":"4.0.0"},"tags":[{"name":"device","description":"Device and Agent Control Management"}],"servers":[{"url":"https://dev-maarg.hotwax.io/rest/s1/admin"}],"security":[{"basicAuth":[]},{"api_key":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"},"api_key":{"type":"apiKey","name":"api_key","in":"header","description":"HTTP Header api_key"}},"schemas":{"co.hotwax.oms.AgentControlServices.acknowledgeInstruction.Out":{"type":"object","properties":{"success":{"type":"boolean"}}},"co.hotwax.oms.AgentControlServices.acknowledgeInstruction.In":{"type":"object","properties":{"agentCtrlInstructionId":{"type":"string"},"deviceId":{"type":"string"}},"required":["agentCtrlInstructionId","deviceId"]}}},"paths":{"/device/acknowledge":{"post":{"tags":["device"],"summary":"acknowledge Instruction","description":"Acknowledge that a device has executed an instruction.\n            Updates the ackDate in AgentCtrlInstrAsgn for the given instruction and device.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/co.hotwax.oms.AgentControlServices.acknowledgeInstruction.Out"}}}},"401":{"description":"Authentication required"},"403":{"description":"Access Forbidden (no authz)"},"429":{"description":"Too Many Requests (tarpit)"},"500":{"description":"General Error"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/co.hotwax.oms.AgentControlServices.acknowledgeInstruction.In"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/co.hotwax.oms.AgentControlServices.acknowledgeInstruction.In"}}},"required":true}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hotwax.co/documents/integrate-with-hotwax/components/admin/device.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
