Is there SharePoint rest api to all retrieve communication site ? similar to following command

Get-PnPTenantSite -WebTemplate SITEPAGEPUBLISHING#0

You could use the below endpoint to retrieve all communication sites:

_api/search/query?querytext='contentclass:sts_site webtemplate=SITEPAGEPUBLISHING'

I've tried the below in Power Automate, and filter seems to have worked for Publishing site. You can try replacing filter value with communication site's template id.

/_api/web/webinfos?$select=ServerRelativeUrl,Title,WebTemplate&$filter=WebTemplate eq 'CMSPUBLISHING'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.