Skip to content

sharingPolicies

Calendar Sharing Policies. Control how users share calendars and contacts with external domains. The sharingPolicies entity set lives under /exchange/v1.0/sharingPolicies in the Sharing & federation category.

Fact Value
Path /exchange/v1.0/sharingPolicies
Category Sharing & federation
Tier Tier 3, Mail flow
Read role MailFlow.Read.All (Community)
Write role MailFlow.ReadWrite.All (Pro)
Backing cmdlets Get-SharingPolicy, Set-SharingPolicy, New-SharingPolicy, Remove-SharingPolicy
Method Path Synopsis Role Plan
GET /exchange/v1.0/sharingPolicies List sharingPolicies entries. MailFlow.Read Community
POST /exchange/v1.0/sharingPolicies Create a new sharingPolicies entry. Body keys map 1:1 to the cmdlet’s parameter names (camelCased). Returns 201 + Location + the freshly-fetched entity. Use ?dryRun=true to map to -WhatIf without applying. MailFlow.ReadWrite Pro
GET /exchange/v1.0/sharingPolicies/{key} Get a single sharingPolicies entry by Identity. MailFlow.Read Community
PATCH /exchange/v1.0/sharingPolicies/{key} Partial update of the sharingPolicies at /sharingPolicies/{key}. Only body fields present are passed to the cmdlet. Returns 200 + the post-Set entity (rename-aware re-fetch when name is in the body). MailFlow.ReadWrite Pro
DELETE /exchange/v1.0/sharingPolicies/{key} Remove the sharingPolicies at /sharingPolicies/{key}. Returns 204 with no body. MailFlow.ReadWrite Pro

List sharingPolicies entries.

Backing cmdlet: Get-SharingPolicy. Role: MailFlow.Read (Community).

Stub auto-generated example for the sharingPolicies collection. Backing cmdlet: Get-SharingPolicy. Live-verify with ?$top=3&$select=Id,Name and replace the synthetic body before promoting to Tier 1.

GET /exchange/v1.0/sharingPolicies?$top=3 HTTP/1.1
Authorization: Bearer {token}
HTTP/1.1 200 OK
{
"@odata.context": "http://localhost:5043/exchange/v1.0/$metadata#sharingPolicies",
"value": []
}

Notes: Illustrative example derived from the cmdlet documentation, not a live capture: field names are real, values are placeholders.

Related: GET /exchange/v1.0/sharingPolicies/{key}

Create a new sharingPolicies entry. Body keys map 1:1 to the cmdlet’s parameter names (camelCased). Returns 201 + Location + the freshly-fetched entity. Use ?dryRun=true to map to -WhatIf without applying.

Backing cmdlet: New-SharingPolicy. Role: MailFlow.ReadWrite (Pro).

Parameter In Type Required Description
domains body yes
name body yes
default body boolean (switch)
enabled body
dryRun query bool (switch)

Create a sharing policy with a missing required field

Section titled “Create a sharing policy with a missing required field”

Rejects a New-SharingPolicy request that omits the required domains field. Backed by the New-SharingPolicy cmdlet.

POST /exchange/v1.0/sharingPolicies HTTP/1.1
Authorization: Bearer {token}
Content-Type: application/json
{
"name": "exonaut-sample-sharingPolicies",
"enabled": true
}
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"error": {
"code": "BadRequest",
"message": "The 'domains' field is required.",
"target": "domains"
},
"correlationId": "0HN7ABCDEF1234567890ABCDEF"
}

Notes: Doc-derived from Wiki + write-param allowlist; not live-captured. Body fields are Wiki-valid; values are illustrative.

Related: GET /exchange/v1.0/sharingPolicies

Creates an organization sharing policy that governs free/busy and calendar sharing with external domains. Backed by the New-SharingPolicy cmdlet.

POST /exchange/v1.0/sharingPolicies HTTP/1.1
Authorization: Bearer {token}
Content-Type: application/json
{
"name": "exonaut-sample-sharingPolicies",
"domains": [
"contoso.com: CalendarSharingFreeBusyReviewer"
],
"enabled": true
}
HTTP/1.1 201 Created
Location: /exchange/v1.0/sharingPolicies/exonaut-sample-sharingPolicies
{
"Identity": "exonaut-sample-sharingPolicies",
"Name": "exonaut-sample-sharingPolicies",
"Domains": [
"contoso.com: CalendarSharingFreeBusyReviewer"
],
"Enabled": true
}

Notes: Doc-derived from Wiki + write-param allowlist; not live-captured. Body fields are Wiki-valid; values are illustrative.

Related: GET /exchange/v1.0/sharingPolicies

Get a single sharingPolicies entry by Identity.

Backing cmdlet: Get-SharingPolicy. Role: MailFlow.Read (Community).

Stub auto-generated example for GET /sharingPolicies/{key}. Backing cmdlet: Get-SharingPolicy with -Identity {key}. Returns the full entity body; 404 if the identity doesn’t resolve.

GET /exchange/v1.0/sharingPolicies/{key} HTTP/1.1
Authorization: Bearer {token}
HTTP/1.1 200 OK
{
"@odata.context": "http://localhost:5043/exchange/v1.0/$metadata#sharingPolicies/$entity"
}

Notes: Illustrative example derived from the cmdlet documentation, not a live capture: field names are real, values are placeholders.

Related: GET /exchange/v1.0/sharingPolicies

PATCH /exchange/v1.0/sharingPolicies/{key}

Section titled “PATCH /exchange/v1.0/sharingPolicies/{key}”

Partial update of the sharingPolicies at /sharingPolicies/{key}. Only body fields present are passed to the cmdlet. Returns 200 + the post-Set entity (rename-aware re-fetch when name is in the body).

Backing cmdlet: Set-SharingPolicy. Role: MailFlow.ReadWrite (Pro).

Parameter In Type Required Description
default body boolean (switch)
domains body
enabled body
name body
dryRun query bool (switch)

Partially updates an existing sharing policy; only the body fields present are passed through. Backed by the Set-SharingPolicy cmdlet.

PATCH /exchange/v1.0/sharingPolicies/{key} HTTP/1.1
Authorization: Bearer {token}
Content-Type: application/json
{
"domains": [
"contoso.com: CalendarSharingFreeBusyDetail"
],
"enabled": false
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"Identity": "exonaut-sample-sharingPolicies",
"Name": "exonaut-sample-sharingPolicies",
"Domains": [
"contoso.com: CalendarSharingFreeBusyDetail"
],
"Enabled": false
}

Notes: Doc-derived from Wiki + write-param allowlist; not live-captured. Body fields are Wiki-valid; values are illustrative.

Related: GET /exchange/v1.0/sharingPolicies

DELETE /exchange/v1.0/sharingPolicies/{key}

Section titled “DELETE /exchange/v1.0/sharingPolicies/{key}”

Remove the sharingPolicies at /sharingPolicies/{key}. Returns 204 with no body.

Backing cmdlet: Remove-SharingPolicy. Role: MailFlow.ReadWrite (Pro).

Parameter In Type Required Description
dryRun query bool (switch)

Removes the sharing policy identified by {key}. Backed by the Remove-SharingPolicy cmdlet.

DELETE /exchange/v1.0/sharingPolicies/{key} HTTP/1.1
Authorization: Bearer {token}
Content-Type: application/json
HTTP/1.1 204 No Content

Notes: Doc-derived from Wiki + write-param allowlist; not live-captured. Body fields are Wiki-valid; values are illustrative.

Related: GET /exchange/v1.0/sharingPolicies

?dryRun=true previews of any write stay on Community.