> For the complete documentation index, see [llms.txt](https://partner.doc.bunq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://partner.doc.bunq.com/documentation/bunq-as-a-service/chapter-0-setting-up-api-context/device-registration.md).

# Device Registration

Registering a device links the API key to a specific phone, computer, or in the case of the API a server.

By using `POST /device-server`, bunq ensures that only pre-approved machines can make API calls. This approach is crucial in banking, where unauthorized access could lead to financial fraud. Unlike simple API keys, this extra layer significantly **reduces attack surfaces** by restricting access to known, registered devices.

Ensure you have a **bunq API Key**. You can generate one from the bunq app if you haven't already.

**IP addresses**

When you use a standard API Key, the `DeviceServer` and `Installation` are linked to the IP address where they were created. You won’t be able to add new IP addresses later.

Payload example:

```json
{
	"description": "My awesome APP",
	"secret": "{api_key}",
	"permitted_ips": ["1.2.3.4", "*"]
}
```

bunq currently only accepts IPV4 addresses. IPV6 is not supported right now.

**Code samples for the device-server endpoint:**

Pass the `installation_token` received in the last step as value for the header `X-Bunq-Client-Authentication` to authenticate yourself in this endpoint.

```json
POST /device-server

Body: 
{
	"description": "My awesome APP",
	"secret": "{api_key}",
	"permitted_ips": ["1.2.3.4", "*"]
}
```

```json
Response:

 {
  "id": 1
} 
```
