# Devices

## Get List of Devices

> Returns a list of devices according to the filter options that you specify and information about each device.

```json
{"openapi":"3.0.0","info":{"title":"Devices API","version":"1.0.0"},"servers":[{"url":"https://api.connect.jfrog.io"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"You will need to get an access token from the Connect web UI to use the Connect API v2. The v1 token will not work for v2.\n\n    Important: For security reasons, the new token generated by Connect will not be stored. Ensure that you copy the token and save it in a safe place.\n"}},"schemas":{"DeviceListItemForEnrichedResponse":{"allOf":[{"$ref":"#/components/schemas/Device"}],"properties":{"tags":{"type":"object","nullable":true,"description":"Object containing a 'message' and an inner 'tags' list. This structure is used for items in 'GET /devices' response when 'enrich_info=true'. If 'enrich_info=false' for 'GET /devices', this field is absent (inherited 'tags' array would also be absent or null).","properties":{"message":{"type":"string","description":"A message related to the tags. This field is optional and will only be present if the device has more than 100 tags associated with it."},"names":{"type":"array","items":{"type":"string"},"description":"List of tag names."}},"required":["names"]}}},"Device":{"type":"object","properties":{"device_name":{"type":"string","description":"The name of the device"},"last_keepalive":{"type":"string","format":"date-time","description":"The last keepalive timestamp of the device"},"agent_version":{"type":"string","description":"The version of the agent running on the device"},"device_ip":{"type":"string","description":"The IP address of the device"},"cpu_usage":{"type":"number","format":"float","description":"The CPU usage of the device"},"ram_usage":{"type":"number","format":"float","description":"The RAM usage of the device"},"current_disk_usage":{"type":"number","format":"float","description":"The current disk usage of the device"},"disk_size":{"type":"number","format":"float","description":"The total disk size of the device"},"address":{"type":"string","description":"The address of the device"},"lat":{"type":"number","format":"float","description":"The latitude of the device's location"},"lng":{"type":"number","format":"float","description":"The longitude of the device's location"},"is_update_trigger_set":{"type":"boolean","description":"Indicates if the update trigger is set for the device"},"description":{"type":"string","description":"The description of the device"},"registered_date":{"type":"string","format":"date-time","description":"The registration date of the device"},"device_uuid":{"type":"string","description":"The UUID of the device"},"device_status":{"type":"string","description":"The status of the device"},"project":{"type":"string","description":"The name of the project the device belongs to"}}}}},"paths":{"/api/v2/{project_key}/devices":{"get":{"summary":"Get List of Devices","description":"Returns a list of devices according to the filter options that you specify and information about each device.","parameters":[{"name":"project_key","in":"path","schema":{"type":"string"},"required":true,"description":"The fleet key of the relevant fleet in the account. An account can have multiple fleets (formerly called projects). If you don't know the fleet key, you can find it in the Fleet Settings of the web UI."},{"name":"group_name","in":"query","required":false,"schema":{"type":"string"},"description":"The name of the group the device belongs to. If you do not specify a group name, then all the devices in the project will be specified."},{"name":"tags","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}},"description":"Returns devices having this tag. To search for multiple tags, for example, records having tag-a, or tag-b, or tag-c, enter a separate key and value for each tag to include. (For example, a new row in the Query Params table for each tag.)"},{"name":"after","in":"query","required":false,"schema":{"type":"string"},"description":"Returns the next set (i.e., next cursor) of records. This is applicable whenever the number of devices to be returned is greater than the limit. For example, if the first cursor returned the limit of 100 records, this parameter is required to receive the next 100 records. The value of the input string can be found at the end of the output of the current cursor."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"description":"The number of devices to show in each cursor of data returned. Default is 100, and maximum is 1000. Must be positive integer."},{"name":"enrich_info","in":"query","schema":{"type":"boolean"},"required":false,"description":"Returns the device tags for each device. If there are more that 100 tags it will return the first 100 and a message. Default is False."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeviceListItemForEnrichedResponse"}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object"}}}}}}}}}
```

## Get Device

> Returns the details about a single device.

```json
{"openapi":"3.0.0","info":{"title":"Devices API","version":"1.0.0"},"servers":[{"url":"https://api.connect.jfrog.io"}],"paths":{"/api/v2/{project_key}/devices/{device_uuid}":{"get":{"summary":"Get Device","description":"Returns the details about a single device.","parameters":[{"name":"project_key","in":"path","schema":{"type":"string"},"required":true,"description":"The fleet key of the relevant fleet in the account. An account can have multiple fleets (formerly called projects). If you don't know the fleet key, you can find it in the Fleet Settings of the web UI."},{"name":"device_uuid","in":"path","schema":{"type":"string"},"required":true,"description":"The  UUID of the device you are acting on. This is the unique identifier of the device in Connect, for example, d-4cfe-4e51. You can find the UUID in the ID column of the Devices table in the Devices page of the web UI."},{"name":"enrich_info","in":"query","schema":{"type":"boolean"},"required":false,"description":"Returns additional information about the device, including app_name, version, mac_addresses, tags, and updates. Updates includes the last five updates to the device. Default is False."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Device"}}}},"404":{"description":"Not Found","content":{"application/json":{}}}}}}},"components":{"schemas":{"Device":{"type":"object","properties":{"device_name":{"type":"string","description":"The name of the device"},"last_keepalive":{"type":"string","format":"date-time","description":"The last keepalive timestamp of the device"},"agent_version":{"type":"string","description":"The version of the agent running on the device"},"device_ip":{"type":"string","description":"The IP address of the device"},"cpu_usage":{"type":"number","format":"float","description":"The CPU usage of the device"},"ram_usage":{"type":"number","format":"float","description":"The RAM usage of the device"},"current_disk_usage":{"type":"number","format":"float","description":"The current disk usage of the device"},"disk_size":{"type":"number","format":"float","description":"The total disk size of the device"},"address":{"type":"string","description":"The address of the device"},"lat":{"type":"number","format":"float","description":"The latitude of the device's location"},"lng":{"type":"number","format":"float","description":"The longitude of the device's location"},"is_update_trigger_set":{"type":"boolean","description":"Indicates if the update trigger is set for the device"},"description":{"type":"string","description":"The description of the device"},"registered_date":{"type":"string","format":"date-time","description":"The registration date of the device"},"device_uuid":{"type":"string","description":"The UUID of the device"},"device_status":{"type":"string","description":"The status of the device"},"project":{"type":"string","description":"The name of the project the device belongs to"}}}}}}
```

## Update Device

> Updates information on a device. You can make updates using the Add, Replace, and Remove operations, and you can replace values of multiple parameters in a single API request.  This request is based on the \[RFC 6902]\(<https://www.rfc-editor.org/rfc/rfc6902>) specification. \
> \
> For the "tags" value, spaces are allowed in the tag name. You can add multiple tag values, with each value separated by a comma.

```json
{"openapi":"3.0.0","info":{"title":"Devices API","version":"1.0.0"},"servers":[{"url":"https://api.connect.jfrog.io"}],"paths":{"/api/v2/{project_key}/devices/{device_uuid}":{"patch":{"summary":"Update Device","description":"Updates information on a device. You can make updates using the Add, Replace, and Remove operations, and you can replace values of multiple parameters in a single API request.  This request is based on the [RFC 6902](https://www.rfc-editor.org/rfc/rfc6902) specification. \n\nFor the \"tags\" value, spaces are allowed in the tag name. You can add multiple tag values, with each value separated by a comma.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchDevices"}}}},"parameters":[{"name":"Content-Type","in":"header","schema":{"type":"string"},"required":true},{"name":"project_key","in":"path","schema":{"type":"string"},"required":true,"description":"The fleet key of the relevant fleet in the account. An account can have multiple fleets (formerly called projects). If you don't know the fleet key, you can find it in the Fleet Settings of the web UI."},{"name":"device_uuid","in":"path","schema":{"type":"string"},"required":true,"description":"The  UUID of the device you are acting on. This is the unique identifier of the device in Connect, for example, d-4cfe-4e51. You can find the UUID in the ID column of the Devices table in the Devices page of the web UI."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Device"}}}},"400":{"description":"Bad Request","content":{"application/json":{}}},"401":{"description":"Unauthorized","content":{"application/json":{}}},"404":{"description":"Not Found","content":{"application/json":{}}}}}}},"components":{"schemas":{"PatchDevices":{"type":"object","properties":{"operations":{"type":"array","items":{"type":"object","properties":{"op":{"type":"string","enum":["add","remove","replace"],"description":"The operation to be performed"},"path":{"type":"string","enum":["tags","apps","group_name","update_trigger"],"description":"The path of the attribute to be modified. Only certain paths are supported for each 'op' value:\nFor 'add', 'tags' and 'apps' are supported.\nFor 'remove', 'tags' and 'apps' are supported.\nFor 'replace', 'group_name' and 'update_trigger' are supported.\n"},"value":{"oneOf":[{"type":"array","items":{"type":"string"},"description":"The value for tags or apps"},{"type":"string","description":"The value for group_name, device_name, or description"},{"type":"boolean","description":"The value for update_trigger"}]}},"required":["op","path","value"]},"description":"List of operations to be performed on the device"}},"required":["operations"]},"Device":{"type":"object","properties":{"device_name":{"type":"string","description":"The name of the device"},"last_keepalive":{"type":"string","format":"date-time","description":"The last keepalive timestamp of the device"},"agent_version":{"type":"string","description":"The version of the agent running on the device"},"device_ip":{"type":"string","description":"The IP address of the device"},"cpu_usage":{"type":"number","format":"float","description":"The CPU usage of the device"},"ram_usage":{"type":"number","format":"float","description":"The RAM usage of the device"},"current_disk_usage":{"type":"number","format":"float","description":"The current disk usage of the device"},"disk_size":{"type":"number","format":"float","description":"The total disk size of the device"},"address":{"type":"string","description":"The address of the device"},"lat":{"type":"number","format":"float","description":"The latitude of the device's location"},"lng":{"type":"number","format":"float","description":"The longitude of the device's location"},"is_update_trigger_set":{"type":"boolean","description":"Indicates if the update trigger is set for the device"},"description":{"type":"string","description":"The description of the device"},"registered_date":{"type":"string","format":"date-time","description":"The registration date of the device"},"device_uuid":{"type":"string","description":"The UUID of the device"},"device_status":{"type":"string","description":"The status of the device"},"project":{"type":"string","description":"The name of the project the device belongs to"}}}}}}
```

## Move Device

> Moves a device from one fleet (project) to another. You need to specify both the destination fleet and a destination group in that fleet.

```json
{"openapi":"3.0.0","info":{"title":"Devices API","version":"1.0.0"},"servers":[{"url":"https://api.connect.jfrog.io"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"You will need to get an access token from the Connect web UI to use the Connect API v2. The v1 token will not work for v2.\n\n    Important: For security reasons, the new token generated by Connect will not be stored. Ensure that you copy the token and save it in a safe place.\n"}},"schemas":{"MoveDevice":{"type":"object","properties":{"destination_project_key":{"type":"string","description":"The fleet key to which the device is transferred."},"destination_group_name":{"type":"string","description":"The group name in the destination fleet to which the device is transferred."}}}}},"paths":{"/api/v2/{project_key}/devices/{device_uuid}/move":{"post":{"tags":["Devices"],"summary":"Move Device","description":"Moves a device from one fleet (project) to another. You need to specify both the destination fleet and a destination group in that fleet.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveDevice"}}}},"parameters":[{"name":"project_key","in":"path","schema":{"type":"string"},"required":true,"description":"The fleet key of the relevant fleet in the account. An account can have multiple fleets (formerly called projects). If you don't know the fleet key, you can find it in the Fleet Settings of the web UI."},{"name":"device_uuid","in":"path","schema":{"type":"string"},"required":true,"description":"The  UUID of the device you are acting on. This is the unique identifier of the device in Connect, for example, d-4cfe-4e51. You can find the UUID in the ID column of the Devices table in the Devices page of the web UI."}],"responses":{"200":{"description":"OK","headers":{"Content-Type":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Bad Request","headers":{"content-length":{"schema":{"type":"integer"}},"content-type":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Not Found","headers":{"Content-Type":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object"}}}}}}}}}
```
