Agreement.ReadWrite.All
Allows the app to read and write terms of use agreements, without a signed in user.
Permission Details
Read and write all terms of use agreements
Allows the app to read and write terms of use agreements, without a signed in user.
c9090d00-6101-42f0-a729-c41074260d47
Read and write all terms of use agreements
Allows the app to read and write terms of use agreements on behalf of the signed-in user.
ef4b5d93-3104-4664-9053-a5c49ab44218
Properties
Properties is shown from stable Microsoft Graph v1.0 metadata.
| Property | Type | Description |
|---|---|---|
displayName |
StringNullable |
Display name of the agreement. The display name is used for internal tracking of the agreement but isn't shown to end users who view the agreement. Supports $filter (eq). |
id |
String |
The identifier of the agreement. Read-only. Supports $filter (eq). |
isPerDeviceAcceptanceRequired |
BooleanNullable |
Indicates whether end users are required to accept this agreement on every device that they access it from. The end user is required to register their device in Microsoft Entra ID, if they haven't already done so. Supports $filter (eq). |
isViewingBeforeAcceptanceRequired |
BooleanNullable |
Indicates whether the user has to expand the agreement before accepting. Supports $filter (eq). |
termsExpiration |
termsExpiration |
Expiration schedule and frequency of agreement for all users. Supports $filter (eq). |
userReacceptRequiredFrequency |
DurationNullable |
The duration after which the user must reaccept the terms of use. The value is represented in ISO 8601 format for durations. Supports $filter (eq). |
acceptances |
agreementAcceptance collection |
Read-only. Information about acceptances of this agreement. |
file |
object |
Default PDF linked to this agreement. |
files |
agreementFileLocalization collection |
PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. Supports $expand. |
JSON Representation
JSON representation is shown from stable Microsoft Graph v1.0 metadata.
{
"@odata.type": "#microsoft.graph.agreement",
"displayName": "String",
"id": "String (identifier)",
"isPerDeviceAcceptanceRequired": "Boolean",
"isViewingBeforeAcceptanceRequired": "Boolean",
"termsExpiration": {
"@odata.type": "microsoft.graph.termsExpiration"
},
"userReacceptRequiredFrequency": "String (duration)"
}
Relationships
Relationships is shown from stable Microsoft Graph v1.0 metadata.
| Relationship | Type | Description |
|---|---|---|
acceptances |
agreementAcceptance collection |
Read-only. Information about acceptances of this agreement. |
file |
agreementFile |
Default PDF linked to this agreement. |
files |
agreementFileLocalization collection |
PDFs linked to this agreement. This property is in the process of being deprecated. Use the file property instead. Supports $expand. |
Graph Methods
Microsoft Graph v1.0 endpoints are mapped directly from refreshed Microsoft Learn permissions tables.
Microsoft Graph beta endpoints are mapped directly from refreshed Microsoft Learn permissions tables.
Microsoft Graph PowerShell v1.0 commands are mapped directly from refreshed Microsoft Learn PowerShell snippets.
Microsoft Graph PowerShell beta commands are mapped directly from refreshed Microsoft Learn PowerShell snippets.
Code Examples
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new Agreement
{
DisplayName = "Contoso ToU for guest users",
IsViewingBeforeAcceptanceRequired = true,
Files = new List<AgreementFileLocalization>
{
new AgreementFileLocalization
{
FileName = "TOU.pdf",
Language = "en",
IsDefault = true,
FileData = new AgreementFileData
{
Data = Convert.FromBase64String("SGVsbG8gd29ybGQ=//truncated-binary"),
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.TermsOfUse.Agreements.PostAsync(requestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const agreement = {
displayName: 'Contoso ToU for guest users',
isViewingBeforeAcceptanceRequired: true,
files: [
{
fileName: 'TOU.pdf',
language: 'en',
isDefault: true,
fileData: {
data: 'SGVsbG8gd29ybGQ=//truncated-binary'
}
}
]
};
await client.api('/identityGovernance/termsOfUse/agreements')
.post(agreement);
Import-Module Microsoft.Graph.Identity.Governance
$params = @{
displayName = "Contoso ToU for guest users"
isViewingBeforeAcceptanceRequired = $true
files = @(
@{
fileName = "TOU.pdf"
language = "en"
isDefault = $true
fileData = @{
data = [System.Text.Encoding]::ASCII.GetBytes("SGVsbG8gd29ybGQ=//truncated-binary")
}
}
)
}
New-MgIdentityGovernanceTermsOfUseAgreement -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.agreement import Agreement
from msgraph.generated.models.agreement_file_localization import AgreementFileLocalization
from msgraph.generated.models.agreement_file_data import AgreementFileData
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Agreement(
display_name = "Contoso ToU for guest users",
is_viewing_before_acceptance_required = True,
files = [
AgreementFileLocalization(
file_name = "TOU.pdf",
language = "en",
is_default = True,
file_data = AgreementFileData(
data = base64.urlsafe_b64decode("SGVsbG8gd29ybGQ=//truncated-binary"),
),
),
],
)
result = await graph_client.identity_governance.terms_of_use.agreements.post(request_body)
App Registration
Navigate to Azure Portal
Go to App registrations in Microsoft Entra admin center
Add API Permission
Select your app → API permissions → Add a permission → Microsoft Graph
Select Permission Type
Choose Application permissions or delegated permissions and search for Agreement.ReadWrite.All
Grant Admin Consent
Application permissions always require admin consent.