> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maximem.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Maximem Synap is a managed memory layer for AI agents: it ingests conversations and documents, extracts structured memory, and returns scoped context to the agent at retrieval time.
> The Python and JavaScript/TypeScript SDKs are the supported way to use Synap. Write integration code with SDK calls, not raw HTTP requests.
> Start with the Quickstart: https://docs.maximem.ai/getting-started/quickstart.md. Every SDK method is documented in the SDK reference: https://docs.maximem.ai/sdk-reference/overview.md.
> For requests about adding Vity memory to OpenClaw, Hermes, an MCP client, or a browser, start with the Vity Quickstart: https://docs.maximem.ai/vity/quickstart.md.

# cache.clear_customer

> Clear all locally-cached SDK data for a single customer (B2B tenant).

> [!WARNING]
>
> **B2B only.** Customer scope exists only on a B2B instance, that is one whose
> `user_context_isolation` is `strict`. A B2C instance
> (`user_context_isolation: "equals_customer"`) does not accept `customer_id`
> on any call and rejects
> [`customer.context.fetch`](https://docs.maximem.ai/sdk-reference/context/customer-fetch) with
> HTTP 400, so it has no customer-scoped entries to clear. On B2C, use
> [`cache.clear_user`](https://docs.maximem.ai/sdk-reference/cache/clear-user) instead. Call
> `GET /api/v1/auth/whoami` to see which mode your instance is in.

```python Python theme={null}
sdk.cache.clear_customer(customer_id)
```

```typescript TypeScript theme={null}
sdk.cache.clear_customer(customerId: string)
```

`clear_customer()` removes every cache entry whose customer scope matches `customer_id`, including any nested user-scoped entries that belong to that customer. Use it when offboarding a B2B tenant, when test fixtures need a clean slate, or when a customer's data has drifted and you want to force a refresh from the platform.

This is a synchronous method, no `await`.

### Parameters

**customer\_id** `string` *required*

The external customer identifier whose cached data should be dropped. Must match the `customer_id` you originally passed when populating the cache. Customer scoping is a B2B concern only. See [B2C vs B2B](https://docs.maximem.ai/concepts/memory-scopes.md#b2c-vs-b2b-which-scopes-apply-to-you).

### Returns

Returns `None`.

### Example

```python Python theme={null}
from maximem_synap import MaximemSynapSDK

sdk = MaximemSynapSDK(api_key="synap_your_key_here")

# Customer is being offboarded; drop their cached context.
sdk.cache.clear_customer("cust_456")
```

```javascript JavaScript theme={null}
import { SynapClient } from '@maximem/synap-js-sdk';

const sdk = new SynapClient({ apiKey: 'synap_your_key_here' });

// Customer is being offboarded; drop their cached context.
sdk.cache.clear_customer('cust_456');
```

```typescript TypeScript theme={null}
import { SynapClient } from '@maximem/synap-js-sdk';

const sdk = new SynapClient({ apiKey: 'synap_your_key_here' });

// Customer is being offboarded; drop their cached context.
sdk.cache.clear_customer('cust_456');
```

### Raises

This method does not raise SDK errors. See [Error Codes](https://docs.maximem.ai/sdk-reference/errors.md) for the full SDK exception hierarchy.

### See also

* [cache.clear](https://docs.maximem.ai/sdk-reference/cache/clear.md): drop the entire local cache.
* [cache.clear\_user](https://docs.maximem.ai/sdk-reference/cache/clear-user.md): drop one user's cached data (GDPR).
* [cache.stats](https://docs.maximem.ai/sdk-reference/cache/stats.md): inspect hit rate and entry counts.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.