v24

latestSwagger 2.0AGPL-3.0raw.githubusercontent.com2026-08-015163191.7 KB
Phones

Upsert Phone

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'

put/phones

Request body

fcm_tokenstring required
max_send_attemptsinteger required

MaxSendAttempts is the number of attempts when sending an SMS message to handle the case where the phone is offline.

message_expiration_secondsinteger required

MessageExpirationSeconds is the duration in seconds after sending a message when it is considered to be expired.

message_send_schedule_idstring
messages_per_minuteinteger required
missed_call_auto_replystring required
phone_numberstring required
simstring required

SIM is the SIM slot of the phone in case the phone has more than 1 SIM slot

unarchive_threadboolean required

UnarchiveThread moves an archived thread back to the inbox when a new message is received on this phone.

Example request

{
  "fcm_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzd.....",
  "max_send_attempts": 2,
  "message_expiration_seconds": 12345,
  "message_send_schedule_id": "32343a19-da5e-4b1b-a767-3298a73703cb",
  "messages_per_minute": 1,
  "missed_call_auto_reply": "e.g. This phone cannot receive calls. Please send an SMS instead.",
  "phone_number": "+18005550199",
  "sim": "SIM1"
}

Response

OK

messagestring required
statusstring required

Example response

{
  "data": {
    "created_at": "2022-06-05T14:26:02.302718+03:00",
    "fcm_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzd.....",
    "id": "32343a19-da5e-4b1b-a767-3298a73703cb",
    "max_send_attempts": 2,
    "message_send_schedule_id": "32343a19-da5e-4b1b-a767-3298a73703cb",
    "messages_per_minute": 1,
    "missed_call_auto_reply": "This phone cannot receive calls. Please send an SMS instead.",
    "phone_number": "+18005550199",
    "updated_at": "2022-06-05T14:26:10.303278+03:00",
    "user_id": "WB7DRDWrJZRGbYrv2CKGkqbzvqdC"
  },
  "message": "Request handled successfully",
  "status": "success"
}