How To: Edit a z-aware hosted feature layer in ArcGIS Online
Editing a z-enabled ArcGIS Online hosted feature layer fails with the following error, observed in a web browser's developer tools or Fiddler:
'add' parameter is invalid.
The specified geometry is not in the correct format. Geometry does not have z-values
Cannot not perform operation. Invalid operation parameters.
By default, ArcGIS Online disables z-values on publishing a z-enabled layer as a hosted feature service.
ArcGIS Online Web Maps and applications are two-dimensional; they cannot interpolate a z-value unless the new features are snapped to an existing 3D feature or the layer has a non-null default z-value. Otherwise, the default z-value is NULL. Since geometric properties cannot be NULL, no new feature is created.
Even sharing a Web feature layer from ArcGIS Pro with the 'Elevation' property set for the z-enabled feature layer behaves identically.
This behavior can be rectified by following either of the two approaches:
Modify "enableZDefaults" to 'true' from the 'Update Definition' operation available at the Admin REST end directory.
From the item details of the hosted feature service, select Service URL.
From the Supported Operations, select Update Definition.
Modify enableZDefaults property to true.
If the lastEditDate parameter is populated, replace the string of numbers which indicates the last edit date, and replace it with: "" (double quote marks with no content quoted in them).
Click Update Layer Definition.
If possible, publish the contents by uploading a zipped file geodatabase as an item to ArcGIS Online. This keeps the enableZDefaults property as true on the hosted feature layer. (This can be verified from the Update Definition operation available at Admin REST end directory.)