Update Definition (Feature Service)

URL:
https://<adminRoot>/services/<serviceName>/FeatureServer/updateDefinition
Methods:
GET

Description

The updateDefinition operation supports updating a definition property in a hosted feature service. The result of this operation is a response indicating success or failure with an error code and a description.

New at 11.4

This operation now supports performing asynchronous requests for ArcGIS Enterprise hosted feature services.

Request parameters

ParameterDescription

updateDefinition

The service update to the service definition property in a feature service.

async

Support options for asynchronous processing. The default format is false .

Values: true | false

f

The response format. The default response format is html .

Values: html | json | pjson

Example usage

1
https://services.myserver.com/OrgID/ArcGIS/rest/admin/services/example/FeatureServer/updateDefinition

Example one: Enable editor tracking and ownership access control in a feature service

The example below is a sample JSON object for the updateDefinition parameter that demonstrates how to enable editor tracking and ownership access control in a feature service. The following request is formatted for readability:

1
2
3
4
5
6
7
8
{
  "editorTrackingInfo": {
    "enableEditorTracking": true,
    "enableOwnershipAccessControl": true,
    "allowOthersToUpdate": true,
    "allowOthersToDelete": false
  }
}

Example two: Update feature service capability

The following example is a sample JSON object for the updateDefinition parameter that demonstrates how to update the feature service's capabilities:

1
{"capabilities":"Create,Query"}

Example three: Enable feature service sync

The following example is a sample JSON object for the updateDefinition parameter that demonstrates how to enable sync on a feature service:

1
{"syncEnabled": true}

Example four: Update feature service properties

The example below is a sample JSON object for the updateDefinition parameter that demonstrates how to update a feature service's properties. The following request is formatted for readability:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
  "name": "SanFrancisco2",
  "hasStaticData": false,
  "allowGeometryUpdates": "true",
  "maxRecordCount": 2000,
  "serviceDescription": "SanFrancisco2",
  "description": "",
  "copyrightText": "",
  "units": "",
  "xssPreventionInfo": {
    "xssPreventionEnabled": true,
    "xssPreventionRule": "InputOnly",
    "xssInputRule": "rejectInvalid"
  },
  "initialExtent": {
    "xmin": -122.514435102,
    "ymin": 5.6843418860808E-14,
    "xmax": 138.625776397,
    "ymax": 67.1577965990001
  }
}

Example five: Add the preferred time zone property

The example below is a sample JSON object for the updateDefinition parameter that demonstrates how to set the preferred time for a hosted feature service. The preferred time is the time zone the service author recommends clients to work in. Preferred time is used by newer clients, such as ArcGIS Pro 2.7 (and above), which defaults to working with date values in the preferred time reference.

Once the update completes, the feature service resource and all layer resources will have the preferredTimeReference set. To unset preferredTimeReference , run updateDefinition with "timeZone": null .

The following request is formatted for readability:

1
2
3
4
5
6
{
  "preferredTimeReference": {
    "timeZone": "Pacific Standard Time",
    "respectsDaylightSaving": true
  }
}

Example six: Update layerOverridesEnabled

In 8.4 feature service will support layer overrides of feature service behavior related to Capabilities, AllowsGeometryUpdate, OBAC . Initial support will be in online feature service. Server and hosted enterprise will follow in later releases.

ParameterDescription

layerOverridesEnabled

Online feature service defaults this property to true . It is a service property to indicate if a layer can override service properties related to Capabilities, AllowsGeometryUpdate, and OBAC. The layer can override the service capabilities only if it is supported by the server and layerOverridesEnabled is true .

Values: true(default) | false

Sync,ChangeTracking,Append,Extract Capabilities

The above capabilities cannot be overridden in any layer and always follow service capabilities and settings. The feature service guarantees layer capabilities will always follow the feature service as far as the above Capabilities/AllowsGeometryUpdate/OBAC.

Propagate Properties Changes:

The feature service properties (Capabilities, AllowsGeometryUpdate, OBAC) are propagated by default to all layers. If any of the Capabilities, AllowsGeometryUpdate, OBAC are overridden in any layer, then the overridden layer will preserve the overridden properties even if the feature service capabilities changes. New layers added to the feature service will inherit its properties from the feature service. Any changes on the feature service will be propagated to the new layers and the new layers capabilities can be overridden at any time after creation.

supportsLayerOverrides property:

  • TRUE if it is supported by the server.
  • If this property is not returned by the server, it is FALSE .
  • Supports property is available on the layer and service metadata.

LayerOverridesEnabled property:

Example

https://services.myserver.com/OrgID/ArcGIS/rest/services/serviceName/FeatureServer?f=pjson

1
2
3
{
  "LayerOverridesEnabled": false
}

Capabilities

Example

https://services.myserver.com/OrgID/ArcGIS/rest/admin/services/serviceName/FeatureServer/0/updateDefinition

1
2
3
{
  "capabilities": "Create,Update,Delete"
}

AllowsGeometryUpdates:

Example

https://services.myserver.com/OrgID/ArcGIS/rest/admin/services/serviceName/FeatureServer/0/updateDefinition

1
2
3
{
  "allowGeometryUpdates": true
}

OBAC:

Example

https://services.myserver.com/OrgID/ArcGIS/rest/admin/services/serviceName/FeatureServer/0/updateDefinition

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{"ownershipBasedAccessControlForFeatures" : {

"allowOthersToQuery" : true,

"allowOthersToDelete" : true,

"allowOthersToUpdate" : true,

"allowAnonymousToQuery" : true,

"allowAnonymousToUpdate" : true,

"allowAnonymousToDelete" : true
}

}

Layer Overrides Metadata:

Layer metadata returns the list of properties that have been overridden on each layer.

Example

https://services.myserver.com/OrgID/ArcGIS/rest/services/serviceName/FeatureServer/0?f=pjson

1
2
3
4
5
6
7
8
"layerOverrides" : [

"allowGeometryUpdates",

"capabilities",

"ownershipBasedAccessControl"
]

JSON Response syntax

The example below reflects the syntax of a synchronous response:

1
2
3
4
5
6
7
8
9
10
{
  "success": <true|false>,
  "error": {
    "code": <code>,
    "message": "<description>",
    "details": [
      "<message>"
    ]
  }
}

The example below reflects the syntax of an asynchronous response:

1
{"statusURL": “<response status URL>”}

JSON Response examples

Synchronous responses

When updateDefinition succeeds as a synchronous response:

1
2
3
{
  "success": true
}

When updateDefinition fails as a synchronous response:

1
2
3
4
5
6
7
8
9
{
  "error": {
    "code": 400,
    "message": "",
    "details": [
      "Unable to update feature service layer definition."
    ]
  }
}

Asynchronous responses

When an updateDefinition request is submitted asynchronously, the response will include a statusURL, the value of which is a URL that can be accessed to check the status of the request:

1
2
3
{
  "statusURL": "https://machine.domain.com/ArcGIS/rest/admin/services/myhostedservice/FeatureServer/updateDefinition/5f4f34c6-2bcf-41c7-8bd1-ea777570ad23"
}

The URL can be used to periodically check the progress of the request, which is returned as the status property. When the job completes, the response retrieved from the status URL will indicate whether the request completed successfully.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//success

{
  "submissionTime":1726444564500,
  "lastUpdatedTime":1726444568893,
  "status":"Completed"
}

//failure

{
  "submissionTime": 1726520769240,
  "lastUpdatedTime": 1726520769773,
  "status": "Failed",
  "error": {
    "code": 500,
    "description": "Editing definition error - RCPerfTestOneWayAllRowsParent.DBO.Volcano_Roop "
  }
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close