---
title: "Upsert phone device."
method: PUT
path: "/api/v5/phone-devices/"
tags: ["Phone Devices"]
---

# Upsert phone device.

`PUT /api/v5/phone-devices/`

Update phone device if exist else insert new phone device.A device is identified by (user_id, hardware_identifier)

## Request body

- BodyPhoneDevicesUpsertApiV5PhoneDevicesPut
  - `phone_device` PhoneDeviceInCreate, required — User Phone Device In Upsert
    - `hardwareIdentifier` string, required
    - `fcmToken` string, required
    - `deviceName` string
    - `osName` string
    - `osVersion` string
    - `appVersion` string

## Response `200`

Successful Response

- PhoneDeviceInResponse — User Phone Device in response
  - `phoneDevice` PhoneDevice, required — User Phone Device
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `deletedAt` string, date-time
    - `id` integer
    - `userId` integer, required
    - `hardwareIdentifier` string, required
    - `fcmToken` string, required
    - `deviceName` string
    - `osName` string
    - `osVersion` string
    - `appVersion` string

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/pavlok/apis/pavlok-api-v5.md) · [All operations](https://skmtc.net/pavlok/apis/pavlok-api-v5/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pavlok/pavlok-api-v5/revisions/3d192098b1ac/schema)
