> This page is for Developers.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.emnify.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.emnify.com/_mcp/server.

# Get device status (JavaScript)

> JavaScript code example to retrieve the status of all connected devices in your account using the API.

The following code example gets the status of all devices in your emnify account:

```javascript
function getDeviceStatus(){
    fetch(`https://cdn.emnify.net/api/v1/endpoint`, {
        method: 'GET',
        headers: {
            "accept": "application/json",
            "Authorization": `Bearer AUTH_TOKEN`
        }
        })
        .then(result => result.json())
        .then(result => {
        console.log(result)
        })
}
```

The result looks something like this:

```javascript maxLines=0
[
    {
        id: 11180765,
        name: 'Test_device231', // Device Name
        tags: 'dashboard',
        created: '2021-06-24T19:02:43.000+0000',
        last_updated: '2021-06-24T19:02:49.000+0000',
        status: { 
            id: 0, 
            description: 'Enabled' 
        },
        service_profile: { 
            id: 421239, 
            name: 'Generic Service Profile' 
        },
        tariff_profile: { 
            id: 409292, 
            name: 'Generic Tariff Profile'
        },
        sim: {
            id: 3991447,
            iccid: '898830300000***9680',
            imsi: '2950509****1169',
            msisdn: '423**39212***74'
        },
        imei: **********,
        ip_address: '100.**.*.***',
        ip_address_space: { 
            id: 6808 
        },
        imei_lock: false
    }
]
```