{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/phone-com/json-schema/phone-com-phone-number-schema.json",
  "title": "PhoneNumber",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/phone-com-phone-numbers-api-openapi.yml#/components/schemas/PhoneNumber",
  "type": "object",
  "properties": {
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Name"
    },
    "route": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1,
          "description": "Route ID. Read-only."
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Route name"
        }
      },
      "description": "The Route assigned to handle incoming calls for this number, if any."
    },
    "block_incoming": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Whether to block incoming calls."
    },
    "block_anonymous": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Whether to block anonymous calls."
    },
    "caller_id": {
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 15,
          "pattern": "^[0-9a-zA-Z\\s,]+$",
          "description": "Name that this number will be associated with. Must be no longer than 15 characters, and can only contain English letters, numbers, spaces, and commas."
        },
        "type": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "business",
            "personal"
          ],
          "description": "Can be 'business' or 'personal'"
        }
      },
      "description": "Caller ID Object"
    },
    "sms_forwarding": {
      "properties": {
        "type": {
          "enum": [
            "application",
            "extension"
          ],
          "description": "Can be 'extension' or 'application'"
        },
        "application": {
          "description": "Required if type = 'application'. Application that messages should be directed to"
        },
        "extension": {
          "description": "Required if type = 'extension'. Extension that messages should be directed to"
        }
      },
      "description": "SMS Forwarding Object"
    },
    "call_notifications": {
      "properties": {
        "emails": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": "Array of email addresses"
        },
        "sms": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^\\+?([0-9\\-\\(\\)\\s]*)$",
          "description": "A phone number capable of receiving SMS messages"
        }
      },
      "description": "Call Notifications Object"
    },
    "reservation_id": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "description": "Reserve phone number ID"
    },
    "phone_number": {
      "description": "Phone number"
    },
    "record_calls": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Record calls (feature needs to be enabled on account level)"
    }
  }
}