---
title: "Upsert Phone"
method: PUT
path: "/phones"
tags: ["Phones"]
---

# Upsert Phone

`PUT /phones`

Updates properties of a user's 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

- RequestsPhoneUpsert
  - `fcm_token` string, required
  - `max_send_attempts` integer, required — MaxSendAttempts is the number of attempts when sending an SMS message to handle the case where the phone is offline.
  - `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, 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
  - `unarchive_thread` boolean, required — UnarchiveThread moves an archived thread back to the inbox when a new message is received on this phone.

## 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

---

[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)
