List Hub Sites

How to list all Hub Sites in a SharePoint Online environment using a Power Automate flow.

URI

_api/HubSites

Headers

{
"Accept": "application/json;odata=nometadata",
"Content-Type": "application/json;odata=nometadata"
}

Body

Not applicable

Screenshot with example

Sample data
Site Address – https://contoso.sharepoint.com/sites/PowerUsers

listhubsites

Expected response

Details of of each of the hub sites nested within the Value property.

{
"value": [
{
"Description": null,
"EnablePermissionsSync": false,
"EnforcedECTs": null,
"EnforcedECTsVersion": 0,
"HideNameInNavigation": false,
"ID": "5ae20b83-510c-40cc-bd80-40df1586a89e",
"LogoUrl": null,
"ParentHubSiteId": "00000000-0000-0000-0000-000000000000",
"PermissionsSyncTag": 0,
"RequiresJoinApproval": false,
"SiteDesignId": "00000000-0000-0000-0000-000000000000",
"SiteId": "5ae20b83-510c-40cc-bd80-40df1586a89e",
"SiteUrl": "https://contoso.sharepoint.com/sites/Connect",
"Targets": null,
"TenantInstanceId": "4fb1efa0-6ebb-49c0-90e3-aeb923e74f04",
"Title": "Connect"
},
{
"Description": null,
"EnablePermissionsSync": false,
"EnforcedECTs": null,
"EnforcedECTsVersion": 0,
"HideNameInNavigation": false,
"ID": "9a356380-ce9a-4be5-aa85-ba239d9fec6a",
"LogoUrl": null,
"ParentHubSiteId": "00000000-0000-0000-0000-000000000000",
"PermissionsSyncTag": 0,
"RequiresJoinApproval": false,
"SiteDesignId": "00000000-0000-0000-0000-000000000000",
"SiteId": "9a356380-ce9a-4be5-aa85-ba239d9fec6a",
"SiteUrl": "https://contoso.sharepoint.com/sites/HubNavTest",
"Targets": null,
"TenantInstanceId": "4fb1efa0-6ebb-49c0-90e3-aeb923e74f04",
"Title": "HubNavTest"
},
{
"Description": null,
"EnablePermissionsSync": false,
"EnforcedECTs": null,
"EnforcedECTsVersion": 0,
"HideNameInNavigation": false,
"ID": "a55d9d95-6629-4a3c-b05e-10529aa98ee5",
"LogoUrl": null,
"ParentHubSiteId": "269da5d4-6a9e-45a5-9502-a74d14977293",
"PermissionsSyncTag": 0,
"RequiresJoinApproval": false,
"SiteDesignId": "00000000-0000-0000-0000-000000000000",
"SiteId": "a55d9d95-6629-4a3c-b05e-10529aa98ee5",
"SiteUrl": "https://contoso.sharepoint.com/sites/HubSiteTesting",
"Targets": null,
"TenantInstanceId": "4fb1efa0-6ebb-49c0-90e3-aeb923e74f04",
"Title": "HubSite Testing"
}
]
}

Copy/paste example

{"id":"6d9811e2-7a59-4a3d-aef6-2d7fa40060aa","brandColor":"#036C70","connectionReferences":{"shared_sharepointonline":{"connection":{"id":"/exp_sharedsharepointonline_e5efa"}}},"connectorDisplayName":"SharePoint","icon":"https://connectoricons-prod.azureedge.net/releases/v1.0.1723/1.0.1723.3986/sharepointonline/icon.png","isTrigger":false,"operationName":"Send_an_HTTP_request_to_SharePoint","operationDefinition":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_sharepointonline","operationId":"HttpRequest","apiId":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline"},"parameters":{"dataset":"@parameters('SPOSiteCollection_PowerUsers (exp_SPOSiteCollection_PowerUsers)')","parameters/method":"GET","parameters/uri":"_api/HubSites","parameters/headers":{"Accept":"application/json;odata=nometadata","Content-Type":"application/json;odata=nometadata"}},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{},"metadata":{"operationMetadataId":"ce46478f-0655-42da-8447-0c90b2bbb81a"}}}

Resources

HubSites method

That’s it, Happy testing!

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.