For the complete documentation index, see [llms.txt](https://docs.sofarocean.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sofarocean.com/~/revisions/i4w2YzZYZxcM4UMsnSvX/spotter-and-smart-mooring/fetch-devices.md).

# (GET) Devices

<mark style="color:blue;">`GET`</mark> `https://api.sofarocean.com/api/devices`

Returns a list containing the device display name and Spotter ID of any Spotters you have API access to. If you have not changed the device display name in the [Spotter Dashboard](https://spotter.sofarocean.com/), the display name and Spotter ID will be the same.&#x20;

### Query Parameters

| Name                   | Type    | Description                                                                                                                                                                                      |
| ---------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `excludeSharedDevices` | boolean | <p>Default: <code>false</code> </p><p><br>Set <code>true</code> to limit the response to Spotters registered directly to your account. Any Spotters shared to your account will be excluded.</p> |

### Response Description

| Name        | Type   | Description                                                                                        |
| ----------- | ------ | -------------------------------------------------------------------------------------------------- |
| `spotterId` | string | The device's identifier.                                                                           |
| `name`      | string | The device's display name, configured in the [Spotter Dashboard](https://spotter.sofarocean.com/). |

#### Error Codes

### Examples

#### Example Request

```bash
curl "https://api.sofarocean.com/api/devices" -H 'token: YOUR_API_TOKEN'
```

#### Example Responses

{% tabs %}
{% tab title="200 (2 devices)" %}

```json
{
  "message": "2 devices",
  "data": {
    "devices": [
      {
        "spotterId": "SPOT-0017",
        "name": "Mavericks 1"
      },
      {
        "spotterId": "SPOT-0018",
        "name": "Golden Gate"
      }
    ]
  }
}
```

{% endtab %}

{% tab title="200 (no devices)" %}

```json
{
    "message": "0 devices",
    "data": {
        "devices": []
    }
}
```

{% endtab %}

{% tab title="401 (incorrect token)" %}

```json
{
    "message": "Authentication Failed"
}
```

{% endtab %}

{% tab title="401 (missing token)" %}

```json
{
    "message": "No token provided"
}
```

{% endtab %}
{% endtabs %}
