Skip to content

hostedOutboundSpamFilterRules

Outbound Spam Rules. Rules binding outbound spam policies to senders. The hostedOutboundSpamFilterRules entity set lives under /exchange/v1.0/hostedOutboundSpamFilterRules in the Threat protection category.

Fact Value
Path /exchange/v1.0/hostedOutboundSpamFilterRules
Category Threat protection
Tier Tier 4, Threat protection
Read role ThreatPolicy.Read.All (Community)
Write role ThreatPolicy.ReadWrite.All (Enterprise)
Backing cmdlets Get-HostedOutboundSpamFilterRule, Set-HostedOutboundSpamFilterRule, New-HostedOutboundSpamFilterRule, Remove-HostedOutboundSpamFilterRule, Enable-HostedOutboundSpamFilterRule, Disable-HostedOutboundSpamFilterRule
Method Path Synopsis Role Plan
GET /exchange/v1.0/hostedOutboundSpamFilterRules List hostedOutboundSpamFilterRules entries. ThreatPolicy.Read Community
POST /exchange/v1.0/hostedOutboundSpamFilterRules Create a new hostedOutboundSpamFilterRules 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. ThreatPolicy.ReadWrite Enterprise
GET /exchange/v1.0/hostedOutboundSpamFilterRules/{key} Get a single hostedOutboundSpamFilterRules entry by Identity. ThreatPolicy.Read Community
PATCH /exchange/v1.0/hostedOutboundSpamFilterRules/{key} Partial update of the hostedOutboundSpamFilterRules at /hostedOutboundSpamFilterRules/{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). ThreatPolicy.ReadWrite Enterprise
DELETE /exchange/v1.0/hostedOutboundSpamFilterRules/{key} Remove the hostedOutboundSpamFilterRules at /hostedOutboundSpamFilterRules/{key}. Returns 204 with no body. ThreatPolicy.ReadWrite Enterprise
POST /exchange/v1.0/hostedOutboundSpamFilterRules/{key}/disable POST /hostedOutboundSpamFilterRules/{key}/disable - bound action via Disable-HostedOutboundSpamFilterRule. Returns 204. ThreatPolicy.ReadWrite Enterprise
POST /exchange/v1.0/hostedOutboundSpamFilterRules/{key}/enable POST /hostedOutboundSpamFilterRules/{key}/enable - bound action via Enable-HostedOutboundSpamFilterRule. Returns 204. ThreatPolicy.ReadWrite Enterprise

GET /exchange/v1.0/hostedOutboundSpamFilterRules

Section titled “GET /exchange/v1.0/hostedOutboundSpamFilterRules”

List hostedOutboundSpamFilterRules entries.

Backing cmdlet: Get-HostedOutboundSpamFilterRule. Role: ThreatPolicy.Read (Community).

Parameter In Type Required Description
state query string Server-side filter by rule enablement state (Get-HostedOutboundSpamFilterRule -State). One of: Enabled | Disabled.

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

GET /exchange/v1.0/hostedOutboundSpamFilterRules?$top=3 HTTP/1.1
Authorization: Bearer {token}
HTTP/1.1 200 OK
{
"@odata.context": "http://localhost:5043/exchange/v1.0/$metadata#hostedOutboundSpamFilterRules",
"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/hostedOutboundSpamFilterRules/{key}

POST /exchange/v1.0/hostedOutboundSpamFilterRules

Section titled “POST /exchange/v1.0/hostedOutboundSpamFilterRules”

Create a new hostedOutboundSpamFilterRules 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-HostedOutboundSpamFilterRule. Role: ThreatPolicy.ReadWrite (Enterprise).

Parameter In Type Required Description
hostedOutboundSpamFilterPolicy body yes
name body yes
comments body
enabled body
exceptIfFrom body
exceptIfFromMemberOf body
exceptIfSenderDomainIs body
from body
fromMemberOf body
priority body
senderDomainIs body
dryRun query bool (switch)

Create fails when a required field is missing

Section titled “Create fails when a required field is missing”

New-HostedOutboundSpamFilterRule requires both name and hostedOutboundSpamFilterPolicy. Omitting hostedOutboundSpamFilterPolicy returns the canonical 400 BadRequest envelope before the cmdlet is invoked.

POST /exchange/v1.0/hostedOutboundSpamFilterRules HTTP/1.1
Authorization: Bearer {token}
Content-Type: application/json
{
"name": "exonaut-sample-hostedOutboundSpamFilterRules"
}
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"error": {
"code": "BadRequest",
"message": "The required field 'hostedOutboundSpamFilterPolicy' is missing from the request body.",
"target": "hostedOutboundSpamFilterPolicy"
},
"correlationId": "0HN7K2QF3M1A8:00000004"
}

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

Related: GET /exchange/v1.0/hostedOutboundSpamFilterRules

Creates a new outbound spam filter rule via New-HostedOutboundSpamFilterRule, binding a hosted outbound spam filter policy to sender-side conditions. Returns 201 with a Location header and the freshly-fetched entity.

POST /exchange/v1.0/hostedOutboundSpamFilterRules HTTP/1.1
Authorization: Bearer {token}
Content-Type: application/json
{
"name": "exonaut-sample-hostedOutboundSpamFilterRules",
"hostedOutboundSpamFilterPolicy": "exonaut-sample-outbound-spam-policy",
"enabled": true,
"comments": "Created by Exonaut sample.",
"priority": 0,
"senderDomainIs": [
"contoso.com"
],
"from": [
"user@contoso.com"
]
}
HTTP/1.1 201 Created
Location: /exchange/v1.0/hostedOutboundSpamFilterRules/exonaut-sample-hostedOutboundSpamFilterRules
{
"Id": "exonaut-sample-hostedOutboundSpamFilterRules",
"Identity": "exonaut-sample-hostedOutboundSpamFilterRules",
"Name": "exonaut-sample-hostedOutboundSpamFilterRules",
"HostedOutboundSpamFilterPolicy": "exonaut-sample-outbound-spam-policy",
"Enabled": true,
"Comments": "Created by Exonaut sample.",
"Priority": 0,
"SenderDomainIs": [
"contoso.com"
],
"From": [
"user@contoso.com"
]
}

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

Related: GET /exchange/v1.0/hostedOutboundSpamFilterRules

GET /exchange/v1.0/hostedOutboundSpamFilterRules/{key}

Section titled “GET /exchange/v1.0/hostedOutboundSpamFilterRules/{key}”

Get a single hostedOutboundSpamFilterRules entry by Identity.

Backing cmdlet: Get-HostedOutboundSpamFilterRule. Role: ThreatPolicy.Read (Community).

Get a single hostedOutboundSpamFilterRules entry

Section titled “Get a single hostedOutboundSpamFilterRules entry”

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

GET /exchange/v1.0/hostedOutboundSpamFilterRules/{key} HTTP/1.1
Authorization: Bearer {token}
HTTP/1.1 200 OK
{
"@odata.context": "http://localhost:5043/exchange/v1.0/$metadata#hostedOutboundSpamFilterRules/$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/hostedOutboundSpamFilterRules

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

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

Partial update of the hostedOutboundSpamFilterRules at /hostedOutboundSpamFilterRules/{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-HostedOutboundSpamFilterRule. Role: ThreatPolicy.ReadWrite (Enterprise).

Parameter In Type Required Description
comments body
exceptIfFrom body
exceptIfFromMemberOf body
exceptIfSenderDomainIs body
from body
fromMemberOf body
hostedOutboundSpamFilterPolicy body
name body
priority body
senderDomainIs body
dryRun query bool (switch)

Partially updates an outbound spam filter rule via Set-HostedOutboundSpamFilterRule. Only the body fields present are passed to the cmdlet. Returns 200 with the post-Set entity.

PATCH /exchange/v1.0/hostedOutboundSpamFilterRules/{key} HTTP/1.1
Authorization: Bearer {token}
Content-Type: application/json
{
"comments": "Updated by Exonaut sample.",
"priority": 1,
"senderDomainIs": [
"contoso.com",
"fabrikam.com"
]
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"Id": "exonaut-sample-hostedOutboundSpamFilterRules",
"Identity": "exonaut-sample-hostedOutboundSpamFilterRules",
"Name": "exonaut-sample-hostedOutboundSpamFilterRules",
"HostedOutboundSpamFilterPolicy": "exonaut-sample-outbound-spam-policy",
"Enabled": true,
"Comments": "Updated by Exonaut sample.",
"Priority": 1,
"SenderDomainIs": [
"contoso.com",
"fabrikam.com"
]
}

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

Related: GET /exchange/v1.0/hostedOutboundSpamFilterRules

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

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

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

Backing cmdlet: Remove-HostedOutboundSpamFilterRule. Role: ThreatPolicy.ReadWrite (Enterprise).

Parameter In Type Required Description
dryRun query bool (switch)

Removes an outbound spam filter rule via Remove-HostedOutboundSpamFilterRule. Returns 204 with no body.

DELETE /exchange/v1.0/hostedOutboundSpamFilterRules/{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/hostedOutboundSpamFilterRules

POST /exchange/v1.0/hostedOutboundSpamFilterRules/{key}/disable

Section titled “POST /exchange/v1.0/hostedOutboundSpamFilterRules/{key}/disable”

POST /hostedOutboundSpamFilterRules/{key}/disable - bound action via Disable-HostedOutboundSpamFilterRule. Returns 204.

Backing cmdlet: Disable-HostedOutboundSpamFilterRule. Role: ThreatPolicy.ReadWrite (Enterprise).

Parameter In Type Required Description
dryRun query bool (switch)

Sub-resource of hostedOutboundSpamFilterRules at GET /hostedOutboundSpamFilterRules/{key} - bound action that disables the rule via Disable-HostedOutboundSpamFilterRule. Returns 204 with no body.

POST /exchange/v1.0/hostedOutboundSpamFilterRules/{key}/disable 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/hostedOutboundSpamFilterRules

POST /exchange/v1.0/hostedOutboundSpamFilterRules/{key}/enable

Section titled “POST /exchange/v1.0/hostedOutboundSpamFilterRules/{key}/enable”

POST /hostedOutboundSpamFilterRules/{key}/enable - bound action via Enable-HostedOutboundSpamFilterRule. Returns 204.

Backing cmdlet: Enable-HostedOutboundSpamFilterRule. Role: ThreatPolicy.ReadWrite (Enterprise).

Parameter In Type Required Description
dryRun query bool (switch)

Sub-resource of hostedOutboundSpamFilterRules at GET /hostedOutboundSpamFilterRules/{key} - bound action that enables the rule via Enable-HostedOutboundSpamFilterRule. Returns 204 with no body.

POST /exchange/v1.0/hostedOutboundSpamFilterRules/{key}/enable 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/hostedOutboundSpamFilterRules

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