{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/phone-com/json-schema/phone-com-device-schema.json",
  "title": "Device",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/phone-com-devices-api-openapi.yml#/components/schemas/Device",
  "type": "object",
  "properties": {
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Device Name"
    },
    "lines": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "properties": {
          "line": {
            "type": "integer",
            "minimum": 1,
            "maximum": 8,
            "description": "Line number"
          },
          "extension": {
            "type": "object",
            "properties": {
              "id": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 1,
                "description": "ID of the extension. This is the internal Phone.com ID, not the extension number callers may dial."
              },
              "extension": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 1,
                "description": "Extension number that callers may dial. On POST, leaving this empty will result in an auto-generated value. On PUT, this field is required."
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "User-supplied name for the extension. On POST, leaving this empty will result in an auto-generated value. On PUT, this field is required."
              }
            },
            "description": "Extensions object that this line number is mapped to"
          }
        },
        "required": [
          "line",
          "extension"
        ]
      },
      "description": "Array of Line Objects showing which extensions are attached to this device, and their assigned line numbers"
    },
    "code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Device Code (available for special integrations only)"
    },
    "address": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "line_1": {
          "type": "string",
          "maxLength": 55,
          "description": "Address line 1"
        },
        "line_2": {
          "type": "string",
          "maxLength": 55,
          "description": "Address line 2"
        },
        "city": {
          "type": "string",
          "maxLength": 40,
          "description": "City"
        },
        "province": {
          "type": "string",
          "maxLength": 40,
          "description": "Contact province"
        },
        "postal_code": {
          "type": "string",
          "maxLength": 40,
          "description": "Contact postal code"
        },
        "country": {
          "type": "string",
          "maxLength": 2,
          "description": "Country name"
        }
      },
      "required": [
        "line_1",
        "line_2",
        "city",
        "province",
        "postal_code",
        "country"
      ],
      "description": "Address associated with this device for 911 calls"
    }
  }
}