# Reset Custom API Cache Example

> Example showing how to clear cache for custom APIs using API Maker.

Source: https://docs.apimaker.dev/v1/examples/sys/cache/resetCacheCustomApis.html

`g.sys.cache.resetCacheCustomApis` calls the [reset custom API cache system API](https://docs.apimaker.dev/v1/docs/apis-all/system-apis/system-generated-reset-redis-cache-custom-api.html) from your code.

### Reset cache custom API

Reset cache of the custom API using global object 'g'.
```ts
await g.sys.cache.resetCacheCustomApis("CUSTOM_API_NAME");
```

### Multi-tenant
- The cache of a custom API called for one tenant of a [multi-tenant](https://docs.apimaker.dev/v1/docs/features/multi-tenant.html) instance, with the [x-am-tenant-username](https://docs.apimaker.dev/v1/docs/apis-all/header/requestHeader.html#x-am-tenant-username) header. Without a tenant, the cache of every tenant is reset too.

```ts
await g.sys.cache.resetCacheCustomApis({ name: "CUSTOM_API_NAME", tenantUsername: "acme" });
```

## Related

- [Reset custom api cache system API](https://docs.apimaker.dev/v1/docs/apis-all/system-apis/system-generated-reset-redis-cache-custom-api.html) · [Automatic caching](https://docs.apimaker.dev/v1/docs/features/automatic-caching.html) · [The global object g](https://docs.apimaker.dev/v1/docs/pre-defined-terms/global-object-g.html)
