- URL:
 - https://<adminservicecatalog-url>/services/<serviceName>/FeatureServer/<layerId>/truncate
 - Methods:
 POST
Description
The truncate  operation supports deleting all features or attachments in a hosted feature service layer. The result of this operation is a response indicating success or failure with error code and description.
Support for the truncate operation only applies if supports  is true  on the layer metadata. The operation is supported on the layer admin API and can be invoked by a user who can administer the service. The truncate operation does not return deleted ID's and will reset the auto-increment column Objectid  to 1. As well, the operation does not change the schema of the data (does not add, remove, or alter existing database columns, constraints, or indexes).
Request parameters
| Parameter | Details | 
|---|---|
attachment | Deletes all the attachments for this layer. None of the layer features will be deleted when  Value:   | 
async | Supports options for asynchronous processing. The default format is  Value:   | 
f | The response format. The default response format is  Values:   | 
Example usage
Below is a sample URL used to access the truncate  operation:
https://services.myserver.com/OrgID/ArcGIS/admin/services/countries-truncate.FeatureServer/0/truncateJSON Response syntax
When attachment
{
  "success": <true|false>,
  "error": {
    "code": <code>,
    "message": "<description>",
    "details": [
      "<message>"
    ]
  }
}JSON response example
When truncate  succeeds
{
  "success": true
}When truncate  fails
{
  "error": {
    "code": 400,
    "message": "",
    "details": [
      "Unable to truncate layer data."
    ]
  }
}