# Add device key

Registers a device key in the platform for a specific user and app. Device keys are generated by the client using the relevant cryptography APIs exposed by the browser or mobile platform (Android or iOS). Once registered, the device key cryptographically binds the device to the given user for secure device identification. <br><br>**Note:** The key should be generated using the RSA-PSS algorithm and SHA-256 hash. <br><br>**Required permissions**: `apps:create`, `[appId]:create`, `devices:create`.

Endpoint: POST /v1/users/{user_id}/device-keys
Security: ClientAccessToken

## Path parameters:

  - `user_id` (string, required)
    ID of the user

## Request fields (application/json):

  - `key_id` (string, required)
    An identifier for the user's device

  - `display_name` (string)
    Friendly device name, used when displaying a list of the user's devices

  - `custom_data` (object)
    Custom data stored for this device, such as tags or device data obtained using other tools

  - `push_config` (object)
    Device push notification configuration

  - `push_config.device_token` (string, required)
    Device token for push notifications (FCM registration token or APN device token)

  - `push_config.type` (string, required)
    Type of push notification
    Enum: "FCM", "APN"

  - `push_config.bundle_id` (string)
    Bundle identifier, used for push notifications

  - `public_key` (string, required)
    Device public key as a base-64 string. This corresponds to the cryptographic key-pair generated by the client

  - `device_id` (string)
    ID of the device to associate with this key

