<!--
{
  "availability" : [
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "EndpointSecurity",
  "identifier" : "/documentation/EndpointSecurity/es_unsubscribe(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Endpoint Security"
    ],
    "preciseIdentifier" : "c:@F@es_unsubscribe"
  },
  "title" : "es_unsubscribe(_:_:_:)"
}
-->

# es_unsubscribe(_:_:_:)

Unsubscribes the provided client from a set of events.

```
func es_unsubscribe(_ client: OpaquePointer, _ events: UnsafePointer<es_event_type_t>, _ event_count: UInt32) -> es_return_t
```

## Parameters

`client`

The client to unsubscribe.

`events`

An array of event types to unsubscribe to.

`event_count`

The number of event types in the array.

## Return Value

A value indicating if the unsubscribe succeeded. [`ES_RETURN_ERROR`](/documentation/EndpointSecurity/ES_RETURN_ERROR) indicates that the caller couldn’t reach the Endpoint Security subsystem or that the request was invalid.

## Discussion

After making this call successfully, Endpoint Security continues to deliver messages for any previously-subscribed events that aren’t specifically unsubscribed from. Use this function to selectively unsubscribe from some events, while remaining subscribed to others. To unsubscribe from all events, use [`es_unsubscribe_all(_:)`](/documentation/EndpointSecurity/es_unsubscribe_all(_:)).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)