An SPFx webpart to explore and test the Microsoft 365 Copilot APIs (beta) through an interactive, tabbed interface: Retrieval and Search.
Built as a developer showcase tool — tweak parameters, compare results, inspect raw JSON, and build intuition for how the Copilot APIs behave.
You can find additional information about this sample in my blog post Exploring the Microsoft 365 Copilot APIs with an SPFx Webpart
| Tab | API Endpoint | What it does |
|---|---|---|
| Retrieval | POST /beta/copilot/retrieval |
AI-powered semantic search with relevance scores, metadata field discovery, KQL filtering |
| Search | POST /beta/copilot/search |
Keyword search with pagination, path-based scoping, and preview text with highlighting |
Additional capabilities:
- Dynamic SharePoint managed property discovery (no hardcoded field lists)
- Request/response JSON inspector with diff comparison
- Structured debug log viewer with timing metrics
Get your own free development tenant by subscribing to Microsoft 365 developer program
- Microsoft 365 tenant with Microsoft 365 Copilot licenses (the beta APIs require Copilot to be enabled)
- SharePoint admin access to approve API permissions
- The following Microsoft Graph delegated permissions must be approved in SharePoint Admin Center > API access:
| Permission | Used by |
|---|---|
Sites.Read.All |
Retrieval, Search |
Files.Read.All |
Retrieval, Search |
ExternalItem.Read.All |
Retrieval |
| Version | Date | Comments |
|---|---|---|
| 1.0 | February 2026 | Initial release |
THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
All Copilot APIs used in this webpart are in beta and subject to change. Do not use in production without understanding the implications of beta API usage.
-
Clone this repository
-
Ensure that you are at the solution folder
-
in the command-line run:
- npm install
- npm run build
-
Upload
sharepoint/solution/react-copilot-apis.sppkgto your App Catalog -
When deploying, the App Catalog will prompt you to trust the solution and list the required Graph permissions:
-
Approve the API permissions in SharePoint Admin Center > API access
-
Add the "Copilot API Showcase" webpart to any modern SharePoint page


