How do I make a hosted feature layer editable with the ArcGIS API for Python

08-01-2017 10:10 AM
New Contributor III

I'm writing a script to upload a FGDB to ArcGIS Online, view it in a web map, and edit it. Using the API for Python. I've figured everything out except how to turn on editing (create, update, delete, etc). Anyone have any idea how to do that?

Any help would be appreciated.


Greg McNamee
0 Kudos
4 Replies
by Anonymous User
Not applicable

To turn on editing, you need to access the published layer as a    FeatureLayerColleciton object in Python and perform an `update_definition()` operation as shown below:

from arcgis.features import FeatureLayerCollection
fortune_fl_item ='title:your_feature_layer', item_type = 'Feature Layer')[0]
flc = FeatureLayerCollection(fortune_fl_item.url, gis)

We gave a talk at the UC about this, you can find the notebook here: If you scroll down to the part that talks about 'Editing features' you can find the workflow

New Contributor III

Thanks. I had just read it here: Updating feature layer properties | ArcGIS for Developers 

I appreciate the help.

Greg McNamee
0 Kudos
New Contributor


When I run the update_definition on my hosted feature layer published using file geodatabase. I get the following error:


code - 




Any ideas on what could be the issue?


0 Kudos
New Contributor

Same error here, using ArcGIS API for Python 

If you use the code below in a FeatureClass enabled for editing directly in ArcGIS Online (via the user interface), it responds "capabilities": "Create,Delete,Query,Update,Editing", but if you turn off and try fl.manager.update_definition(, same error of @SarthakTewari24  (in <module> fl.manager.update_definition({'capabilities': 'Create,Delete,Query,Update,Editing'}) Exception: Unable to update feature service definition.
Invalid definition for 'Capabilities'.
Invalid definition for System.String
(Error Code: 400). 

props =
0 Kudos