Claims an available (unassigned) device and links it to the authenticated user’s account. Once claimed, the device appears inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/GaelCeballos/Smart_Enviro_Backend/llms.txt
Use this file to discover all available pages before exploring further.
GET /api/my-devices and only the owner can control it. A DEVICE_ADDED log entry is created containing the user’s ID and email as the payload.
Endpoint
| Field | Value |
|---|---|
| Method | POST |
| Path | /api/devices/{id}/add |
| Auth | Bearer token required (Authorization: Bearer YOUR_TOKEN) |
Path Parameters
The unique ID of the device to claim. Obtain this value from
GET /api/devices/available. The device must be active and have no current owner.Request
No request body is required.Responses
201 Created
The device was successfully claimed and linked to the authenticated user’s account.Always
"success" on a 201 response.Human-readable confirmation that the device was added to the account.
Summary of the newly claimed device.
404 Not Found
The device with the givenid is already claimed by another user, is inactive, has been soft-deleted, or does not exist.