{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/telnyx/json-schema/telnyx-update-porting-order-schema.json",
  "title": "UpdatePortingOrder",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/telnyx-porting-orders-api-openapi.yml#/components/schemas/UpdatePortingOrder",
  "properties": {
    "activation_settings": {
      "properties": {
        "foc_datetime_requested": {
          "description": "ISO 8601 formatted Date/Time requested for the FOC date",
          "format": "date-time",
          "type": "string"
        }
      },
      "type": "object"
    },
    "customer_group_reference": {
      "type": "string"
    },
    "customer_reference": {
      "type": "string"
    },
    "documents": {
      "$ref": "#/$defs/PortingOrderDocuments"
    },
    "end_user": {
      "$ref": "#/$defs/PortingOrderEndUser"
    },
    "messaging": {
      "properties": {
        "enable_messaging": {
          "description": "Indicates whether Telnyx will port messaging capabilities from the losing carrier. If false, any messaging capabilities will stay with their current provider.",
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "misc": {
      "anyOf": [
        {
          "$ref": "#/$defs/PortingOrderMisc"
        },
        {
          "type": "null"
        }
      ]
    },
    "phone_number_configuration": {
      "$ref": "#/$defs/PortingOrderPhoneNumberConfiguration"
    },
    "requirement_group_id": {
      "description": "If present, we will read the current values from the specified Requirement Group into the Documents and Requirements for this Porting Order. Note that any future changes in the Requirement Group would have no impact on this Porting Order. We will return an error if a specified Requirement Group conflicts with documents or requirements in the same request.",
      "format": "uuid",
      "type": "string"
    },
    "requirements": {
      "description": "List of requirements for porting numbers. ",
      "items": {
        "$ref": "#/$defs/UpdatePortingOrderRequirement"
      },
      "type": "array"
    },
    "user_feedback": {
      "$ref": "#/$defs/PortingOrderUserFeedback"
    },
    "webhook_url": {
      "format": "uri",
      "type": "string"
    }
  },
  "type": "object",
  "$defs": {
    "PortingOrderDocuments": {
      "description": "Can be specified directly or via the `requirement_group_id` parameter.",
      "properties": {
        "invoice": {
          "description": "Returned ID of the submitted Invoice via the Documents endpoint",
          "format": "uuid",
          "type": [
            "string",
            "null"
          ]
        },
        "loa": {
          "description": "Returned ID of the submitted LOA via the Documents endpoint",
          "format": "uuid",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "PortingOrderEndUser": {
      "properties": {
        "admin": {
          "$ref": "#/$defs/PortingOrderEndUserAdmin"
        },
        "location": {
          "$ref": "#/$defs/PortingOrderEndUserLocation"
        }
      },
      "type": "object"
    },
    "PortingOrderEndUserAdmin": {
      "properties": {
        "account_number": {
          "description": "The authorized person's account number with the current service provider",
          "type": [
            "string",
            "null"
          ]
        },
        "auth_person_name": {
          "description": "Name of person authorizing the porting order",
          "type": [
            "string",
            "null"
          ]
        },
        "billing_phone_number": {
          "description": "Billing phone number associated with these phone numbers",
          "type": [
            "string",
            "null"
          ]
        },
        "business_identifier": {
          "description": "European business identification number. Applicable only in the European Union",
          "type": [
            "string",
            "null"
          ]
        },
        "entity_name": {
          "description": "Person Name or Company name requesting the port",
          "type": [
            "string",
            "null"
          ]
        },
        "pin_passcode": {
          "description": "PIN/passcode possibly required by the old service provider for extra verification",
          "type": [
            "string",
            "null"
          ]
        },
        "tax_identifier": {
          "description": "European tax identification number. Applicable only in the European Union",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "PortingOrderEndUserLocation": {
      "properties": {
        "administrative_area": {
          "description": "State, province, or similar of billing address",
          "type": [
            "string",
            "null"
          ]
        },
        "country_code": {
          "description": "ISO3166-1 alpha-2 country code of billing address",
          "type": [
            "string",
            "null"
          ]
        },
        "extended_address": {
          "description": "Second line of billing address",
          "type": [
            "string",
            "null"
          ]
        },
        "locality": {
          "description": "City or municipality of billing address",
          "type": [
            "string",
            "null"
          ]
        },
        "postal_code": {
          "description": "Postal Code of billing address",
          "type": [
            "string",
            "null"
          ]
        },
        "street_address": {
          "description": "First line of billing address",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "PortingOrderMisc": {
      "properties": {
        "new_billing_phone_number": {
          "description": "New billing phone number for the remaining numbers. Used in case the current billing phone number is being ported to Telnyx. This will be set on your account with your current service provider and should be one of the numbers remaining on that account.",
          "type": [
            "string",
            "null"
          ]
        },
        "remaining_numbers_action": {
          "description": "Remaining numbers can be either kept with their current service provider or disconnected. 'new_billing_telephone_number' is required when 'remaining_numbers_action' is 'keep'.",
          "enum": [
            "keep",
            "disconnect",
            null
          ],
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "$ref": "#/$defs/PortingOrderType"
        }
      },
      "type": "object"
    },
    "PortingOrderPhoneNumberConfiguration": {
      "properties": {
        "billing_group_id": {
          "description": "identifies the billing group to set on the numbers when ported",
          "type": [
            "string",
            "null"
          ]
        },
        "connection_id": {
          "description": "identifies the connection to set on the numbers when ported",
          "type": [
            "string",
            "null"
          ]
        },
        "emergency_address_id": {
          "description": "identifies the emergency address to set on the numbers when ported",
          "type": [
            "string",
            "null"
          ]
        },
        "messaging_profile_id": {
          "description": "identifies the messaging profile to set on the numbers when ported",
          "type": [
            "string",
            "null"
          ]
        },
        "tags": {
          "items": {
            "description": "Tag to set on the numbers when ported",
            "type": "string"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "PortingOrderType": {
      "description": "A port can be either 'full' or 'partial'. When type is 'full' the other attributes should be omitted.",
      "enum": [
        "full",
        "partial"
      ],
      "type": "string"
    },
    "PortingOrderUserFeedback": {
      "properties": {
        "user_comment": {
          "description": "A comment related to the customer rating.",
          "type": [
            "string",
            "null"
          ]
        },
        "user_rating": {
          "description": "Once an order is ported, cancellation is requested or the request is cancelled, the user may rate their experience",
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "UpdatePortingOrderRequirement": {
      "description": "Specifies a value for a requirement on the Porting Order.",
      "properties": {
        "field_value": {
          "description": "identifies the document or provides the text value that satisfies this requirement",
          "type": "string"
        },
        "requirement_type_id": {
          "description": "Identifies the requirement type that the `field_value` fulfills",
          "type": "string"
        }
      },
      "required": [
        "field_value",
        "requirement_type_id"
      ],
      "type": "object"
    }
  }
}