Skip to main content

Move device to another project

MethodPath
PUT/v1/slim/device/assign/project

Authentication · Access policies

Moves a device into another project in your project tree, and optionally places it in a location there.

Auth: bearer token. The caller must be a practitioner, an admin or a System Owner, and needs Device:update. Scope: the device must be in the caller's project or one of its sub-projects. The target projectId must be your project, its parent or one of its sub-projects.

Behaviour​

  • The device's resident, location and zone are removed before the move, because those references belong to the old project.
  • If a resident was assigned, their active out-of-bed episode is closed and their open device use record is ended, in the same write.
  • When you send locationId, the device is placed in that location. The location must be in the target project.
  • The move is written in one transaction. If it fails, nothing is written.
  • Moving a device to the project it is already in writes nothing and still succeeds.
  • The response is { success, deviceId, projectId, locationId }. locationId is null when you sent none.

Example​

curl -X PUT 'https://api.sandbox.ovok.com/v1/slim/device/assign/project' \
-H "Authorization: Bearer ${OVOK_TOKEN}" \
-H 'Content-Type: application/json' \
-d '{"deviceId": "3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21", "projectId": "3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21"}'

Successful response​

200 — Device moved to the target project.

Errors​

StatusMeaning
401Bearer token is missing, invalid or expired.
403You are not a practitioner, admin or System Owner, you lack Device:update, your session has no project, the device is outside your project or sub-projects, the target project is outside your project tree, or the location is not in the target project.
404No device with this deviceId exists.
409The device's current project or the target project is moving to another Signals tenant. Retry when the move is done.
422The body fails validation.