> ## Documentation Index
> Fetch the complete documentation index at: https://discord-platform-username.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Certified Devices

> Learn about Discord's Certified Device program for hardware integration.

export const ManualAnchor = ({id}) => {
  return <div className="MDXManualAnchor" id={id}></div>;
};

Baked into Discord is the ability for hardware manufacturers to tell us a little more about the certified devices that are plugged into a user's computer. Unfortunately, no, you can't show that a user's PUBG Chicken Dinner was all thanks to the amazing TotallyRealHardware RGB Mouse and Keyboard Set Extraordinaire™, but you *can* give them an amazing experience using your hardware with Discord!

<ManualAnchor id="hows-it-work" />

## How's it work?

I'm glad you asked!

1. [Create an application](https://discord.com/developers/applications) for your hardware vendor—save the Client ID!
2. Talk to Discord via one simple HTTP or WebSocket call
3. Send us a [`SET_CERTIFIED_DEVICES`](/developers/topics/rpc#setcertifieddevices) WebSocket payload or equivalent HTTP POST whenever the state of the device changes

Yup, that's it. You give us the real-time info about any connected devices, and we'll handle the rest to make sure that anyone using your device will have an awesome experience. Your device will also have a `CERTIFIED` badge in Discord's audio settings, and really, who doesn't love badges?

<img src="https://mintcdn.com/discord-platform-username/eorRGn159WYAM0xI/images/certified-device.png?fit=max&auto=format&n=eorRGn159WYAM0xI&q=85&s=a5c137e9f15a490e9fd556ad9ea03910" alt="An example of how a certified device may be shown for an example audio input and output device" width="723" height="154" data-path="images/certified-device.png" />

## Connecting

<ManualAnchor id="connecting-query-string-params" />

###### Query String Params

| Name       | Value                | Required  |
| ---------- | -------------------- | --------- |
| v          | `1`                  | All       |
| client\_id | your app's client id | All       |
| encoding   | `json`               | WebSocket |

You can send event updates to the following URIs:

<ManualAnchor id="connecting-http" />

###### HTTP

```
http://127.0.0.1:PORT/rpc?v=1&client_id=YOUR_CLIENT_ID
```

<ManualAnchor id="connecting-websocket" />

###### WebSocket

```
ws://127.0.0.1:PORT?v=1&client_id=YOUR_CLIENT_ID&encoding=json
```

`PORT` is a range of ports from `6463` to `6473`. You should iterate over these ports with your request until one returns a success response code or succeeds with a socket connection. Keep track of that port number for the rest of the session.

To keep your hardware in sync with Discord, send updates any time the hardware mute is toggled, or one of the voice features like echo cancellation is enabled or disabled by the user. This lets Discord get out of the way of your optimization when you're in control, or help out when you're not, ensuring an awesome experience for anyone using your hardware.

Each time you update, send a full array of `devices`, sorted by your preferred priority. That means if you want a specific headset to be the default that Discord will attempt to use, put it first in the array.

## Getting Device UUID

For each device in the `SET_CERTIFIED_DEVICES` payload, there is an `id` field. This `id` should be the Windows device's UUID, retrieved through the native Windows API. You'll get back something that looks like `{0.0.1.00000000}.{6cff2b76-44a8-46b9-b528-262ad8609d9f}`.

<Info>
  On macOS, the `id` will be the name of the device.
</Info>

<ManualAnchor id="getting-device-uuid-microphone-id-example" />

###### Microphone Id Example

```cpp theme={null}
id = waveInMessage((HWAVEIN)IntToPtr(index),
                      DRV_QUERYFUNCTIONINSTANCEID,
                      (DWORD_PTR)pstrEndpointId,
                      cbEndpointId);
```

<ManualAnchor id="getting-device-uuid-speaker-id-example" />

###### Speaker Id Example

```cpp theme={null}
id = waveOutMessage((HWAVEIN)IntToPtr(index),
                      DRV_QUERYFUNCTIONINSTANCEID,
                      (DWORD_PTR)pstrEndpointId,
                      cbEndpointId);
```

## HTTP Example

<ManualAnchor id="http-example-http-request-example" />

###### HTTP Request Example

```bash theme={null}
curl -X POST -H 'Content-Type: application/json' -d '
{
  "nonce": "9b4e9711-97f3-4f35-b047-32c82a51978e",
  "cmd": "SET_CERTIFIED_DEVICES",
  "args": {
    "devices": [
      {
        "type": "audioinput",
        "id": "{0.0.1.00000000}.{6cff2b76-44a8-46b9-b528-262ad8609d9f}",
        "vendor": {
          "name": "SteelSeries",
          "url": "https://steelseries.com"
        },
        "model": {
          "name": "Arctis 7",
          "url": "https://steelseries.com/gaming-headsets/arctis-7"
        },
        "related": ["{0.0.1.00000000}.{6cff2b76-44a8-46b9-b528-262ad8609d9f}"],
        "echo_cancellation": true,
        "noise_suppression": true,
        "automatic_gain_control": true,
        "hardware_mute": false
      }
    ]
  }
}
' http://127.0.0.1:PORT/rpc?v=1&client_id=YOUR_CLIENT_ID
```

The socket will respond with a `200 OK` status code and the following JSON.

<ManualAnchor id="http-example-http-response-example" />

###### HTTP Response Example

```json theme={null}
{
  "cmd": "SET_CERTIFIED_DEVICES",
  "data": null,
  "evt": null,
  "nonce": "9b4e9711-97f3-4f35-b047-32c82a51978e"
}
```

## WebSocket Example

<ManualAnchor id="websocket-example-rpc-command-example" />

###### RPC Command Example

```json theme={null}
{
  "nonce": "9b4e9711-97f3-4f35-b047-32c82a51978e",
  "cmd": "SET_CERTIFIED_DEVICES",
  "args": {
    "devices": [
      {
        "type": "audioinput",
        "id": "{0.0.1.00000000}.{6cff2b76-44a8-46b9-b528-262ad8609d9f}",
        "vendor": {
          "name": "SteelSeries",
          "url": "https://steelseries.com"
        },
        "model": {
          "name": "Arctis 7",
          "url": "https://steelseries.com/gaming-headsets/arctis-7"
        },
        "related": ["{0.0.1.00000000}.{6cff2b76-44a8-46b9-b528-262ad8609d9f}"],
        "echo_cancellation": true,
        "noise_suppression": true,
        "automatic_gain_control": true,
        "hardware_mute": false
      }
    ]
  }
}
```

<ManualAnchor id="websocket-example-rpc-response-example" />

###### RPC Response Example

```json theme={null}
{
  "nonce": "9b4e9711-97f3-4f35-b047-32c82a51978e",
  "cmd": "SET_CERTIFIED_DEVICES",
  "data": null,
  "evt": null
}
```

## Models

<ManualAnchor id="models-device-object" />

###### Device Object

| Field                       | Type                                                                       | Description                                              |
| --------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------- |
| type                        | [device type](/developers/topics/certified-devices#models-device-type)     | the type of device                                       |
| id                          | string                                                                     | the device's Windows UUID                                |
| vendor                      | [vendor](/developers/topics/certified-devices#models-vendor-object) object | the hardware vendor                                      |
| model                       | [model](/developers/topics/certified-devices#models-model-object) object   | the model of the product                                 |
| related                     | array of strings                                                           | UUIDs of related devices                                 |
| echo\_cancellation?\*       | boolean                                                                    | if the device's native echo cancellation is enabled      |
| noise\_suppression?\*       | boolean                                                                    | if the device's native noise suppression is enabled      |
| automatic\_gain\_control?\* | boolean                                                                    | if the device's native automatic gain control is enabled |
| hardware\_mute?\*           | boolean                                                                    | if the device is hardware muted                          |

\*These fields are only applicable for `AUDIO_INPUT` device types

<ManualAnchor id="models-vendor-object" />

###### Vendor Object

| Field | Type   | Description        |
| ----- | ------ | ------------------ |
| name  | string | name of the vendor |
| url   | string | url for the vendor |

<ManualAnchor id="models-model-object" />

###### Model Object

| Field | Type   | Description       |
| ----- | ------ | ----------------- |
| name  | string | name of the model |
| url   | string | url for the model |

<ManualAnchor id="models-device-type" />

###### Device Type

| Type          | Value         |
| ------------- | ------------- |
| AUDIO\_INPUT  | "audioinput"  |
| AUDIO\_OUTPUT | "audiooutput" |
| VIDEO\_INPUT  | "videoinput"  |
