Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Namespace: microsoft.graph.security.contentManagement
Important
APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Discover source-control repositories accessible through a supplied write-only accessCredential. The result contains up to 200 transient candidates and isn't paged.
API availability
This API is available in the following national cloud deployments.
| Global service | US Government L4 | US Government L5 (DOD) | China operated by 21Vianet |
|---|---|---|---|
| ✅ | ❌ | ❌ | ❌ |
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
| Permission type | Least privileged permissions | Higher privileged permissions |
|---|---|---|
| Delegated (work or school account) | Repository.Read.All | Repository.ReadWrite.All |
| Delegated (personal Microsoft account) | Not supported. | Not supported. |
| Application | Repository.Read.All | Repository.ReadWrite.All |
HTTP request
POST /security/contentManagement/repositories/microsoft.graph.security.contentManagement.discoverAvailableRepositories
Request headers
| Name | Description |
|---|---|
| Authorization | Bearer token. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required when a JSON body is supplied. |
Request body
In the request body, supply a JSON representation of the parameters. The following table describes the supported parameters.
| Parameter | Type | Description |
|---|---|---|
| accessCredential | microsoft.graph.security.contentManagement.repositoryAccessCredential | Required. Provider credential authorizing repository discovery. Not persisted; used only for this call. Write-only; never returned. |
Response
If successful, this action returns a 200 OK response code and a collection of microsoft.graph.security.contentManagement.discoveredRepository objects in the response body.
Examples
Request
POST https://graph.microsoft.com/beta/security/contentManagement/repositories/microsoft.graph.security.contentManagement.discoverAvailableRepositories
Content-Type: application/json
{
"accessCredential": {
"@odata.type": "#microsoft.graph.security.contentManagement.repositoryPatCredential",
"token": "ghp_example_token"
}
}
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.type": "#microsoft.graph.security.contentManagement.discoveredRepository",
"url": "https://github.com/contoso/detections",
"fullName": "contoso/detections",
"branches": [
"main",
"dev"
]
}
]
}