- URL:
- https://<root>/<serviceName>/FeatureServer/<layerId>/deleteFeatures
- Methods:
POST
- Required Capability:
- Delete
- Version Introduced:
- 10.0
Description
This operation deletes features in a feature layer or table. The delete
operation is performed on a feature service layer resource.
The operation returns the results of the edits in an array of edit result objects. Each edit result identifies a single edit and indicates whether the delete was successful. If not, it includes an error code and an error description.
You can provide arguments to the delete
operation as query parameters defined in the parameters table below.
Request parameters
Parameter | Details |
---|---|
|
The response format. The default response format is Values: |
| The object IDs of the layer or table to be deleted. Syntax: Example: |
| A where clause for the query filter. Any legal SQL where clause operating on the fields in the layer is allowed. Features conforming to the specified where clause will be deleted. Example: |
| The geometry to apply as the spatial filter. Features conforming to the spatial relationship (specified using the Syntax:
Examples:
|
|
The type of geometry specified by the Values: |
|
The spatial reference of the input The spatial reference can be specified as either a well-known ID or a spatial reference JSON object. If |
|
The spatial relationship to be applied to the input Values: |
|
The geodatabase version to apply the edits. This parameter applies only if the If the Syntax: Example: |
(Optional) | This option was added at 10.5 and works with ArcGIS Server services only. Specifies whether the response will report the time that features were deleted. If Values: Example: |
(Optional) |
Specifies whether the edits should be applied only if all submitted edits succeed. If Not all data supports setting this parameter. Query the Values: Example: |
(Optional) | This option was added at 10.7. Indicates whether a result is returned per deleted row when the When Values: Example: |
(Optional) | This option was added at 10.7. Indicates whether to process the When run with Values: Example: |
Example usage
Delete features using the delete
operation on a feature service layer resource.
https:
The input to the delete
operation can be a list of ObjectIDs, where clause, and geometry to apply as a spatial filter.
JSON Response syntax (when objectIds are specified)
{
"deleteResults" : [
{
"objectId" : <objectId1>,
"globalId" : <globalId1>,
"success" : <true | false>,
"error" : { //only if success is false
"code" : <code1>,
"description" : "<description1>",
}
},
{
"objectId" : <objectId2>,
"globalId" : <globalId2>,
"success" : <true | false>,
"error" : { //only if success is false
"code" : <code2>,
"description" : "<description2>",
}
}
]
}
JSON Response syntax (when objectIds are not specified)
{ "success" : true }
JSON Response example
{
"deleteResults": [
{
"objectId": 19,
"success": true
},
{
"objectId": 23,
"success": true
}
]
}
JSON Response example (when data has globalIds)
{
"deleteResults": [
{
"objectId": 6,
"globalId": "{12AE3B4A-D8DC-4923-8F19-A78A7C896129}",
"success": true
}
]
}
JSON Response example (when returnDeleteResults=false)
{"success": true}