Delete From Definition (Feature Layer)

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

Description

The deleteFromDefinition operation supports deleting a definition property in a feature service layer. The result of this operation is a response indicating success or failure with error code and description.

New at 11.4

  • This operation now supports performing asynchronous requests for ArcGIS Enterprise hosted feature services.
  • This operation can delete full text search indexes for hosted feature services. Deleting a full text search index is performed in the same way as deleting regular field indexes.
  • This operation can delete the subtypes of a hosted feature service layer.

Request parameters

ParameterDetails

deleteFromDefinition

The deleteFromDefinition parameter supports deleting a definition property in a feature service layer.

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

Example one: Delete fields from feature service layer

Example two: Delete indexes from feature service layer

Example three: Delete subtype code from a feature layer

Example one: Delete fields from a feature service layer

Below is a sample URL used to access the deleteFromDefinition operation:

Use dark colors for code blocksCopy
1
https://services.myserver.com/OrgID/ArcGIS/rest/admin/services/example1/FeatureServer/0/deleteFromDefinition

Example input for the deleteFromDefinition parameter:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
{
  "fields": [
    {
      "name": "GlobalID"
    },
    {
      "name": "date1"
    },
    {
      "name": "str2"
    }
  ]
}

Example two: Delete indexes from a feature service layer

Below is a sample URL used to access the deleteFromDefinition operation:

Use dark colors for code blocksCopy
1
https://services.myserver.com/OrgID/ArcGIS/rest/admin/services/example2/FeatureServer/0/deleteFromDefinition

Example input for the deleteFromDefinition parameter:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
{
  "indexes": [
    {
      "name": "index1"
    },
    {
      "name": "index2"
    }
  ]
}

Example three: Delete subtype code from a feature layer

Below is a sample URL used to access the deleteFromDefinition operation:

Use dark colors for code blocksCopy
1
https://services.myserver.com/OrgID/ArcGIS/rest/admin/services/example1/FeatureServer/0/deleteFromDefinition

Example input for the deleteFromDefinition parameter. Only the subtype code is required:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
{
  "subtypes": [
    {
      "code": 4
    }
  ]
}

JSON Response syntax

The example below reflects the syntax of a synchronous response:

Use dark colors for code blocksCopy
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:

Use dark colors for code blocksCopy
1
{"statusURL": “<response status URL>”}

JSON Response examples

Synchronous responses

When deleteFromDefinition succeeds as a synchronous response:

Use dark colors for code blocksCopy
1
2
3
{
  "success": true
}

When deleteFromDefinition fails as a synchronous response:

Use dark colors for code blocksCopy
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 deleteFromDefinition 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:

Use dark colors for code blocksCopy
1
2
3
{
  "statusURL": "https://machine.domain.com/ArcGIS/rest/admin/services/myhostedservice/FeatureServer/0/deleteFromDefinition/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.

Use dark colors for code blocksCopy
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.