There are many things you can do with the GeoServer REST API that are not specifically documented and that there are not code examples for. Here's the strategy for tackling those.
First, start with the examples in the documentation. Make sure you are familiar with how you can create a simple new layer or workspace using an HTTP POST with either XML or JSON.
Then, through the GeoServer UI, manually create the object you need for which there is no documentation (in this case, a feature type).
Finally, manually browse to the GeoServer REST index (
http://your-server/geoserver/rest). Browse through the index until you find the feature type you just created. Append ".xml" or ".json" to the URL of this resource, and you will see its XML or JSON representation.
This representation is what you would have needed to POST to create the feature type through the API. The URL of the representation is the URL that you would have needed to POST to (for example,
You can use this strategy to figure out how to programmatically create or configure any resource in GeoServer.