> For the complete documentation index, see [llms.txt](https://docs.connect.jfrog.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.connect.jfrog.io/developers/api-reference/connect-api-reference/overview/bulk-devices-state.md).

# Bulk device states

## Bulk Device States

<mark style="color:blue;">`GET`</mark> `https://api.connect.jfrog.io/v1/get_devices_state`

Using this call you will get the current state - `Online` or `Offline` on a bulk of devices.

#### Request Body

| Name          | Type    | Description                                                                                                                                        |
| ------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| user\_token   | string  | This is your account token. You can find it under the Settings category on the dashboard.                                                          |
| group\_name   | string  | This is the group name of the group you would like to get all its devices state.                                                                   |
| project\_name | string  | This is the project name of the project you would like to get all its devices state.                                                               |
| limit         | integer | <p>The number of results per page.<br><em>The maximum <code>limit</code> is 50.</em><br><strong>Default is 20.</strong></p>                        |
| offset        | integer | <p>Offset to start pagination search results.<br><strong>This should be the last <code>device\_uuid</code> from the previous request.</strong></p> |

{% tabs %}
{% tab title="200  The value of the "message" parameter is a JSON object with the keys:

1. device\_status - String - can be either online or offline values.
2. device\_id - Integer - This is the ID of the device which you have sent at the request.
3. device\_name - String - This is the name of the device." %}

```
{"message": {"device_status": "online",
             "device_uuid": "d-1234-abcd",
             "device_name": "My-Device-1"}}
```

{% endtab %}

{% tab title="400 Error occurred." %}

```
{"error_message": "<ERROR_MESSAGE>"}
```

{% endtab %}

{% tab title="429 Rate limit reached." %}

```
{}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
If no parameters are set, the first 20 devices of that user will be returned.
{% endhint %}

#### Example

{% tabs %}
{% tab title="Python" %}

```python
import json
import requests
json_content = {'project_name': 'MYPROJECT',
                'group_name': 'Production',
                'user_token': 'YYYYYYYYYYYYYYY'}

call_request = requests.get("https://api.connect.jfrog.io/v1/get_devices_state", json=json_content)
call_response = json.loads(call_request.text)

if call_request.status_code != 200:
    if call_request.status_code == 429:
        error = "API limit reached"
    else:
        error = call_response["error_message"]
    print(error)
else:
    for device in call_response["message"]:
        device_status = device["device_status"]
        device_uuid = device["device_uuid"]
        device_name = device["device_name"]

```

{% endtab %}

{% tab title="Curl" %}

```shell
curl --location --request GET 'https://api.connect.jfrog.io/v1/get_devices_state' \
--header 'Content-Type: application/json' \
--data-raw '{
    "user_token": "YYYYYYYYYYYYYYY"
    }'
```

{% endtab %}
{% endtabs %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.connect.jfrog.io/developers/api-reference/connect-api-reference/overview/bulk-devices-state.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
