I want to have an API as such:
public class RelayController : ApiController
{
// POST api/values
public void Post([FromBody]IDataRelayPackage package
Json.NET (the default Json serializer for ASP.NET Web API) can handle this situation. All you need to do is change the serializer settings, and set TypeNameHandling to All (or Objects). This will add a "$type"-json property to your json, containing the type name of your instance. On the other side it'll try to deserialize to this type again.
We used this for ourselves, taking an abstract base class as type.