This can be done via cloud code by sending a LogEventRequest to the Request Api. Within said request you can do the following:

Spark.getMultiplayer().cancelMatchmaking(Spark.getPlayer(), "RT_MATCH", "myGroup");

You will need to ensure that you are referencing the correct match ShortCode and group for the pendingMatch you want to cancel.