---
title: "Upserts the FCM token of a phone"
method: PUT
path: "/phones/fcm-token"
tags: ["Phones"]
---

# Upserts the FCM token of a phone

`PUT /phones/fcm-token`

Updates the FCM token of a phone. If the phone with this number does not exist, a new one will be created. Think of this method like an 'upsert'

## Request body

- RequestsPhoneFCMToken
  - `fcm_token` string, required
  - `phone_number` string, required
  - `sim` string, required — SIM is the SIM slot of the phone in case the phone has more than 1 SIM slot

## Response `200`

OK

- ResponsesPhoneResponse
  - `data` EntitiesPhone, required
    - `created_at` string, required
    - `fcm_token` string
    - `id` string, required
    - `max_send_attempts` integer, required — MaxSendAttempts determines how many times to retry sending an SMS message
    - `message_expiration_seconds` integer, required — MessageExpirationSeconds is the duration in seconds after sending a message when it is considered to be expired.
    - `message_send_schedule_id` string
    - `messages_per_minute` integer, required
    - `missed_call_auto_reply` string
    - `phone_number` string, required
    - `sim` 'SIM1' | 'SIM2', required
    - `unarchive_thread` boolean, required — UnarchiveThread moves an archived message thread back to the inbox when a new message is received on this phone.
    - `updated_at` string, required
    - `user_id` string, required
  - `message` string, required
  - `status` string, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `422` — Unprocessable Entity
- `500` — Internal Server Error

## Changes

> 25 revisions in range; 1 could not be searched.

- **2025-04-22** `a36b74e5ddeb` — 1 info
  - endpoint added
- **2023-12-22** `7e5887f7aceb` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/ndolestudio/apis/httpsms-api-reference/changes/phones/fcm-token/put.md)

---

[API](https://skmtc.dev/ndolestudio/apis/httpsms-api-reference.md) · [All operations](https://skmtc.dev/ndolestudio/apis/httpsms-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ndolestudio/httpsms-api-reference/revisions/7e5d7ce790b3/schema)
