Adding feature layer to ArcGIS Online from REST API?

I've checked requests which were sent in ArcGIS Online to add Feature Service with Chrome dev tools and found that it uses 4 requests:

  1. Create Service - create feature service with REST API without layers, see http://resources.arcgis.com/en/help/arcgis-rest-api/#/Create_Service/02r30000027r000000/
  2. update Service item - fix service name, see http://resources.arcgis.com/en/help/arcgis-rest-api/#/Update_Item/02r30000009s000000/
  3. addToDefinition request for admin part, see http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Add_To_Definition_Feature_Service/02r300000230000000/ - this is the request to add layer definition into empty service
  4. Last request to updateDefinition of the service (http://resources.arcgis.com/en/help/arcgis-rest-api/#/Update_Definition_Feature_Service/02r30000021z000000/).

There is definitely a REST API for working with ArcGIS Online and Portal.

This is the specific operation for publishing a hosted feature service from .csv

http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Publish_Item/02r300000080000000/