{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/telerivet-com/json-schema/telerivet-com-phone-schema.json",
  "title": "Phone",
  "description": "Represents a basic route (i.e. a phone or gateway) that you use to send/receive messages via Telerivet.\n\n Basic Routes were formerly referred to as \"Phones\" within Telerivet. API methods, parameters, and properties related to Basic Routes continue to use the term \"Phone\" to maintain backwards compatibility.",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/telerivet-com-openapi.json#/components/schemas/Phone",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "ID of the phone"
    },
    "name": {
      "type": "string",
      "description": "Name of the phone"
    },
    "phone_number": {
      "type": "string",
      "description": "Phone number or sender ID"
    },
    "phone_type": {
      "type": "string",
      "description": "Type of this phone/route (e.g. android, twilio, nexmo, etc). For a shared copy of a route from another project (see parent_phone_id), the type of the original route."
    },
    "country": {
      "type": "string",
      "description": "2-letter country code (ISO 3166-1 alpha-2) where phone is from"
    },
    "send_paused": {
      "type": "boolean",
      "description": "True if sending messages is currently paused, false if the phone can currently send messages"
    },
    "time_created": {
      "type": "integer",
      "format": "unix-timestamp",
      "description": "Time the phone was created in Telerivet"
    },
    "last_active_time": {
      "type": [
        "integer",
        "null"
      ],
      "format": "unix-timestamp",
      "description": "Approximate time this phone last connected to Telerivet"
    },
    "vars": {
      "type": "object",
      "additionalProperties": true,
      "description": "Custom variables stored for this phone. Variable names may be up to 32 characters in length and can contain the characters a-z, A-Z, 0-9, and _.\n Values may be strings, numbers, or boolean (true/false).\n String values may be up to 4096 bytes in length when encoded as UTF-8.\n Up to 100 variables are supported per object.\n Setting a variable to null will delete the variable."
    },
    "project_id": {
      "type": "string",
      "description": "ID of the project this phone belongs to"
    },
    "validate_recipient_numbers": {
      "type": "boolean",
      "description": "Set to true to check that recipient phone numbers appear to be valid before sending messages. Messages to invalid phone numbers will fail without being sent. Only applies to phones capable of sending messages."
    },
    "allowed_recipient_countries": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "Array of 2-letter country codes (ISO 3166-1 alpha-2) to which this phone is allowed to send messages. Messages to recipients in other countries fail without being sent. When null, there is no restriction on recipient countries; set to null or an empty array to remove the restriction."
    },
    "sent_message_limit": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Maximum number of messages that can be sent from this phone in a given period. When the sent_message_count reaches this limit, sending is automatically paused. Set to null to disable the limit."
    },
    "sent_message_count": {
      "type": "integer",
      "description": "Number of messages sent from this phone since the counter was last reset (see sent_message_epoch). This property is not updated if sent_message_limit is null."
    },
    "sent_message_epoch": {
      "type": [
        "integer",
        "null"
      ],
      "format": "unix-timestamp",
      "description": "The UNIX timestamp when the sent_message_count was last reset to 0."
    },
    "send_delay": {
      "type": [
        "number",
        "null"
      ],
      "description": "Number of seconds to wait after sending each message from this phone, to avoid exceeding carrier rate limits."
    },
    "timezone_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "A string specifying the time zone that will be used when implementing quiet hours or estimating send times; see [List of tz database time zones Wikipedia article](http://en.wikipedia.org/wiki/List_of_tz_database_time_zones). When null, the project's default time zone is used."
    },
    "quiet_mode": {
      "type": "string",
      "description": "Controls behavior during quiet hours (see quiet_start/quiet_end). Possible values are 'off' (quiet hours disabled), 'delay' (messages are delayed until quiet hours end), or 'confirm' (requires manual confirmation to send during quiet hours).",
      "enum": [
        "off",
        "delay",
        "confirm"
      ]
    },
    "quiet_start": {
      "type": [
        "string",
        "null"
      ],
      "description": "Time of day when quiet hours begin, in HH:MM format (24-hour time) in the phone's time zone. Messages sent during quiet hours are delayed or require confirmation depending on quiet_mode. Only applicable when quiet_mode is not 'off'."
    },
    "quiet_end": {
      "type": [
        "string",
        "null"
      ],
      "description": "Time of day when quiet hours end, in HH:MM format (24-hour time) in the phone's time zone. Messages sent during quiet hours are delayed or require confirmation depending on quiet_mode. Only applicable when quiet_mode is not 'off'."
    },
    "battery": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Current battery level, on a scale from 0 to 100, as of the last time the phone connected to Telerivet (only present for Android phones)"
    },
    "charging": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "True if the phone is currently charging, false if it is running on battery, as of the last time it connected to Telerivet (only present for Android phones)"
    },
    "internet_type": {
      "type": [
        "string",
        "null"
      ],
      "description": "String describing the current type of internet connectivity for an Android phone, for example WIFI or MOBILE (only present for Android phones)"
    },
    "app_version": {
      "type": "string",
      "description": "Currently installed version of Telerivet Android app (only present for Android phones)"
    },
    "android_sdk": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Android SDK level, indicating the approximate version of the Android OS installed on this phone; see [list of Android SDK levels](http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) (only present for Android phones)"
    },
    "mccmnc": {
      "type": "string",
      "description": "Code indicating the Android phone's current country (MCC) and mobile network operator (MNC); see [Mobile country code Wikipedia article](https://en.wikipedia.org/wiki/Mobile_country_code) (only present for Android phones). Note this is a string containing numeric digits, not an integer."
    },
    "manufacturer": {
      "type": "string",
      "description": "Android phone manufacturer (only present for Android phones)"
    },
    "model": {
      "type": "string",
      "description": "Android phone model (only present for Android phones)"
    },
    "send_limit": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Maximum number of SMS messages per hour that can be sent by this Android phone. To increase this limit, install additional SMS expansion packs in the Telerivet Gateway app. (only present for Android phones)"
    },
    "active_expansion_packs": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Number of SMS Expansion Packs installed and active in the Telerivet Gateway app, which increase send_limit; null if the phone has not reported its rate limit. (only present for Android phones)"
    },
    "shared_project_ids": {
      "type": "string",
      "description": "IDs of other projects in the same organization that this route is shared with (read-only; route sharing can be configured on the route's settings page in the web app). Each project has its own shared copy of the route (with its own phone ID, and parent_phone_id set to this route's ID) that sends messages via this route; incoming messages are not shared unless copied by an automated service. Only includes projects the current user can access. Only present for routes that can send messages, other than shared copies."
    },
    "parent_phone_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "For a shared copy of a route from another project, the ID of the original route that sends the messages (read-only). Only present for shared routes; their phone_type is the type of the original route, but type-specific properties and methods (such as config, app logs, and status history) are only available on the original route."
    },
    "parent_project_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "For a shared copy of a route from another project, the ID of the project containing the original route (read-only). Only present for shared routes."
    },
    "welcome_message": {
      "type": "object",
      "additionalProperties": true,
      "description": "Welcome message settings for this route, in the same format as the `welcome_message` property of Project. When enabled with non-empty content, the route's welcome message is sent to each contact the first time a text message is sent to that contact via this route, instead of the project's welcome message. Only present for routes that can send messages. When updating, only the provided properties are changed."
    },
    "inactive_timeout": {
      "type": "integer",
      "description": "Number of seconds after the phone last connected to Telerivet before it is considered inactive (and `connectivity` alert emails are sent). Only present for phone types that support it. Allowed values for each phone type:\n\n- Android Phone (`android`): 900, 1800, 3600, 7200, 21600, 43200, 86400"
    },
    "alert_emails": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Email addresses that receive alerts about this phone. Each item has the properties `email` (string) and `types` (array of strings: the types of alerts that are sent to this email address). Only present for phone types that support email alerts. When updating, the provided list replaces all existing alert emails for this phone (an empty array removes all of them). Alert types for each phone type:\n\n- Android Phone (`android`): `connectivity`, `battery`, `power`, `send_errors`, `rate_limit`"
    },
    "config": {
      "type": "object",
      "additionalProperties": true,
      "description": "Settings specific to a particular phone_type. Currently only used for the Telerivet Gateway app on Android phones. When updating, only the provided properties are changed, and properties with null values are ignored.\n\n**Android Phone** (`phone_type`: android):\n\n- delivery_reports (bool): Request a delivery report for each SMS sent by the phone\n- call_notifications (bool): Forward notifications of incoming calls to Telerivet (and outgoing call records, if forward_sent is enabled)\n- hangup_incoming_calls (bool): Hang up incoming calls immediately.\n- send_retries (int, 0-10): Number of times to automatically retry sending failed messages.\n- send_mms (bool): Send outgoing MMS messages from this phone (requires Android 5.0+ and a mobile network that supports MMS).\n- ignored_phone_numbers (array of strings, max 500): Phone numbers whose incoming messages are ignored (not forwarded to Telerivet)\n- ignore_shortcodes (bool): Ignore incoming messages from short codes\n- ignore_non_numeric (bool): Ignore incoming messages from non-numeric (alphanumeric) senders\n- app_locked (bool): Prevent changing settings and accessing online tools from the Telerivet Gateway app on the phone\n\nThe following properties are read-only settings that can only be changed in the Telerivet Gateway app on the phone, as last reported by the app:\n\n- app_enabled (bool): Whether the app is enabled to forward messages between the phone and Telerivet\n- forward_incoming (bool): Whether the app forwards incoming SMS, MMS, and RCS messages to Telerivet\n- forward_sent (bool): Whether the app forwards messages sent from the phone's messaging app (and outgoing call records, if call_notifications is enabled) to Telerivet\n- incoming_paused (bool): Whether forwarding incoming messages to Telerivet is paused (a debug setting in the app)\n- test_mode (bool): Whether the app is in test mode, where it only forwards messages to/from the phone numbers in test_phone_numbers\n- test_phone_numbers (array of strings): Phone numbers that the app forwards messages to/from when test_mode is enabled\n- app_source (string): Where app updates are installed from: `google_play`, `telerivet_website`, or null if unknown\n\nChanges to app settings are sent to the phone the next time it connects to Telerivet."
    },
    "external_account_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Account ID for the external API (e.g. Twilio Account SID, Vonage API Key). Only present for routes that support external API configuration. See createPhone for the meaning of this field for each phone type."
    },
    "external_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "External phone/resource ID within the external API account (if applicable). Only present for routes that support external API configuration."
    },
    "external_config": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true,
      "description": "Additional configuration settings specific to the phone_type. Only present for routes that support external API configuration. See createPhone for available settings for each phone type."
    },
    "external_setup": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true,
      "description": "Configuration info for routes that require manual webhook setup. Only present for routes that require manual configuration of callback URLs with the external provider. Contains URL properties for each webhook type that needs to be configured (e.g., `incoming_message_url`, `message_status_url`, `incoming_call_url`)."
    },
    "external_secret": {
      "type": [
        "string",
        "null"
      ],
      "description": "Secret/API key for the external API (e.g. Twilio Auth Token, Vonage API Secret). Only applicable for routes that support external API configuration. Write-only; not returned by the API when retrieving a phone."
    },
    "vcard": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Whether the Contact Card can be attached to messages sent from this route."
        },
        "name": {
          "type": "string",
          "description": "Name shown on the Contact Card (defaults to the organization name)."
        },
        "version": {
          "type": "string",
          "description": "vCard version. `3.0` is recommended for compatibility."
        },
        "logo_url": {
          "type": "string",
          "description": "URL of the Contact Card's logo image, or null if there is no logo. Read-only."
        },
        "phone_number": {
          "type": "string",
          "description": "Phone number stored on the Contact Card (always the route's own phone number). Read-only."
        },
        "logo_file_id": {
          "type": "string",
          "description": "To set the logo, upload a JPEG or PNG image (max 1MB) via [project.uploadFile](#Project.uploadFile) and provide the resulting file ID; set to null to remove the logo. Write-only; not returned by the API."
        }
      },
      "description": "The route's Contact Card (a vCard that recipients can save to their address book). Only present for routes associated with a phone number that can send messages. When updating this field, only the provided properties are changed.\n\nTo attach the sending route's Contact Card to a message, include the media item `{\"type\": \"route_vcard\"}` in the `media` parameter of project.sendMessage and related methods."
    },
    "url": {
      "type": "string",
      "description": "URL to this phone in the Telerivet web app"
    }
  }
}