diff --git a/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs b/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs
index afe154ca48..944f1946bf 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs
@@ -41,6 +41,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
/// Some objects such as macros are not based on CMSNode
///
[PluginController(Constants.Web.Mvc.BackOfficeApiArea)]
+ [ParameterSwapControllerActionSelector(nameof(GetAncestors), "id", typeof(int), typeof(Guid))]
[ParameterSwapControllerActionSelector(nameof(GetPagedChildren), "id", typeof(int), typeof(string))]
[ParameterSwapControllerActionSelector(nameof(GetPath), "id", typeof(int), typeof(Guid), typeof(Udi))]
[ParameterSwapControllerActionSelector(nameof(GetUrlAndAnchors), "id", typeof(int), typeof(Guid), typeof(Udi))]
@@ -804,6 +805,17 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
return GetResultForAncestors(id, type, queryStrings);
}
+ public ActionResult> GetAncestors(Guid id, UmbracoEntityTypes type, [ModelBinder(typeof(HttpQueryStringModelBinder))]FormCollection queryStrings)
+ {
+ var entity = _entityService.Get(id);
+ if (entity is null)
+ {
+ return NotFound();
+ }
+
+ return Ok(GetResultForAncestors(entity.Id, type, queryStrings));
+ }
+
///
/// Searches for results based on the entity type
///