IAMinerva
HomeBlogAbout
m3M365 NewscoMicrosoft CopilotteMicrosoft TeamsshSharePoint & OneDriveinIntune & SecurityexExchange & OutlookpoPower PlatformazAzure & Entra IDtuTutorials & GuidesevEvents & ConferencesseSecuritywiWindows
IAMinerva

Professional blog dedicated to the Microsoft 365 ecosystem.

Quick links

HomeBlogAboutNewsletter

Stay informed

Get the latest Microsoft 365 news delivered straight to your inbox.

© 2026 IAMinerva. All rights reserved.

Built withNext.js&Tailwind
Utiliser l'API Copilot Retrieval pour les recherches Microsoft 365
BlogMicrosoft CopilotUsing the Copilot Retrieval API for Microsoft 365 Searches
Microsoft Copilot#Copilot#Microsoft Graph#PowerShell

Using the Copilot Retrieval API for Microsoft 365 Searches

Discover how to use the Copilot Retrieval API to enrich Microsoft 365 queries with contextual excerpts and targeted data.

Houssem MAKHLOUF
April 14, 2026
3 min read

TL;DR par Minerva

généré par IA

Discover how to use the Copilot Retrieval API to enrich Microsoft 365 queries with contextual excerpts and targeted data.

Introduction

The Copilot Retrieval API represents a major advancement for IT professionals seeking to optimize their integrations with Microsoft 365 Copilot. This tool enables targeted searches on content in SharePoint Online, OneDrive for Business, and external connectors, and provides relevant text excerpts to enrich user queries.

i

Good to know

The Copilot Retrieval API uses an approach based on the RAG (Retrieval Augmented Generation) method, a key competitive advantage of Microsoft 365 Copilot over third-party solutions.

Key Features of the Copilot Retrieval API

What is Query "Grounding"?

Grounding consists of contextually enriching user queries by using text excerpts from authorized Microsoft 365 sources. Unlike tools like ChatGPT that process uploaded documents, the Copilot Retrieval API enables deep searches within Microsoft 365 data.

Differences Between the Search API and the Retrieval API

  • Search API: Performs semantic searches.
  • Retrieval API: Executes searches based on the RAG method, complemented by text excerpts.

This positioning facilitated by Microsoft provides rich context for integrated applications such as Word, Excel, or PowerPoint.

Access and Permissions of the Connected User

Usage of this API is limited to the context of the connected user. This means the API requires delegated permissions such as:

  • Files.Read.All
  • Sites.Read.All
  • ExternalItem.Read.All for connectors

These permissions ensure that the API only returns results accessible to the connected user.

!

Attention

Permissions must be properly configured in Microsoft Graph to enable seamless access to data.

Tutorial: Using the Copilot Retrieval API with the Microsoft Graph PowerShell SDK

Here is a series of steps to execute a search via the Copilot Retrieval API:

1

Connect to Microsoft Graph

Use the PowerShell command to connect with the necessary permissions:

⚡PowerShell
1Connect-MgGraph -NoWelcome -Scopes Files.Read.All, Sites.Read.All
2

Define the API endpoint

Assign the Copilot Retrieval API endpoint URL to a variable:

⚡PowerShell
1$Uri = 'https://graph.microsoft.com/v1.0/copilot/retrieval'
3

Create the request body

Configure a hash table containing the search parameters:

⚡PowerShell
1$BodyRequest = @{}
2$BodyRequest.Add("datasource", "sharepoint")
3$BodyRequest.Add("queryString", "How to write a PowerShell script for Microsoft 365")
4$BodyRequest.Add("maximumNumberOfResults", "3")
4

Add advanced filters

Apply filters to target results:

⚡PowerShell
1$BodyRequest.add("filterexpression", 'FileExtension:"DOCX" AND LastModifiedTime>=2025-11-01 AND LastModifiedTime<=2026-01-31')
5

Execute the query

Send a POST request via the Microsoft Graph PowerShell SDK:

⚡PowerShell
1[array]$Data = Invoke-MgGraphRequest -Uri $Uri -Method Post -Body $BodyRequest -OutputType PsObject
6

Interpret the results

Browse the results by displaying metadata and text excerpts:

⚡PowerShell
1$Hits = $Data.RetrievalHits
2ForEach ($Hit in $Hits) {
3 Write-Host "File Title :" $Hit.ResourceMetaData.Title
4 Write-Host "Creation Date :" $Hit.ResourceMetadata.Created
5 Write-Host "Relevance :" $Hit.extracts.relevanceScore
6 Write-Host "Sensitivity Label :" $Hit.SensitivityLabel.DisplayName
7 Write-Host "Excerpt :" $Hit.extracts.text.substring(0,120)
8}

Possible Uses and Benefits

  • Optimized contextualization of queries for Copilot applications.
  • Improved results by using advanced filters and metadata.
  • Facilitated integration with Microsoft Graph and PowerShell.

Conclusion

The Copilot Retrieval API paves the way for advanced contextual search in the Microsoft 365 environment, offering IT teams a powerful tool to exploit data in their automated processes or custom applications. As Microsoft continues to strengthen its features in Microsoft 365 Copilot, remaining agile with these tools will enable teams to maximize their benefits.

✦

Tip

Subscribe to the blog to stay informed of the latest advances in Copilot APIs and other enhanced Microsoft 365 features.

Share:
HM

Houssem MAKHLOUF

Microsoft 365 enthusiast & IT professional.

Previous article

Azure AD: Limiting Application Administrator Privileges by Application

Apr 9, 2026
Next article

MCP Apps: A New Dimension in Microsoft 365 Copilot

Apr 14, 2026

Related articles

Paysages montagneux avec des formes géométriques dorées sur un fond sombre.copilot

Microsoft Cloud, AI and Security Certifications: Anticipate 2026

Discover the new Microsoft certifications for cloud, AI and security. Anticipate these changes to remain competitive in 2026.

Jun 29, 20263 min
Engrenage doré avec des lignes fluides lumineuses sur fond sombre.copilot

Understanding and Using Claude Skills for Automation

Learn how to use Claude Skills to automate your professional tasks with flexible AI and custom connectors.

Jun 29, 20265 min
Fluides lumineuses dorées avec des bulles de dialogue sur fond noir.copilot

Copilot Memory: Essential Updates for Users

Explore the essential updates to Copilot Memory and conversation persistence. Optimize your use of Microsoft 365 Copilot.

Jun 29, 20265 min