I had was to expose the primary key which is annotated with @Id in entity.the ID field is only visible on the resource path, but not on the JSON body.
The best solution would be not to using the IDs of your entities, and use the link references the hypermedia provides. You just need to parse your JSON accordingly to the HAL specification used by Spring Data Rest.