# Reset System API Cache API

> Drop the cached answers of one or several system APIs with the reset system API cache system API of API Maker, for one tenant or all of them.

Source: https://docs.apimaker.dev/v1/docs/apis-all/system-apis/system-generated-reset-redis-cache-system-api.html

Drops the cached answers of a system API whose [settings](https://docs.apimaker.dev/v1/docs/settings/systemApiSettings.html) have `enableCaching`, for example get table meta or get secret.

| | |
|---|---|
| Method | POST |
| URL | `/api/system-api/admin/reset-redis-cache-system-apis` : `admin` is the user path of your account |
| Body | `{ name, tenantUsername? }` or an array of them |
| Answer | `data` : the number of cache entries removed |
| From code | [`g.sys.cache.resetCacheSystemApis`](https://docs.apimaker.dev/v1/examples/sys/cache/resetCacheSystemApis.html) |

## The call

**Body**

```json
{ "name": "Get table meta data" }
```

**Body : several, one for a tenant**

```json
[ { "name": "Get table meta data" }, { "name": "Get secret key-keys", "tenantUsername": "acme" } ]
```

**Answer**

```json
{ "success": true, "statusCode": 200, "data": 1 }
```

- `name` is the name shown on the System API page : Encrypt data, Decrypt data, Hash data, Get token, Call external API, Execute plain query, Get secret key-keys, Get redis key-keys, Set redis key-keys, Remove redis key-keys, Reset database cache, Reset third party API cache, Reset custom apis cache, Reset system apis cache, Get table meta data, Create indexes, Drop indexes, Get indexes, Emit event, Emit event WS, Is valid data for table, Is valid data for custom API, Is valid data for third party API, Multi tenant instance updated, Is valid connection string. An unknown name gives `-1` and a `404` in `errors`.

## From code

```typescript
await g.sys.cache.resetCacheSystemApis('Get table meta data');
```

## Access and settings

- Over HTTP, a system API answers once its [settings](https://docs.apimaker.dev/v1/docs/settings/systemApiSettings.html) give it `apiAccessType: TOKEN_ACCESS` (the token of an API user whose [group](https://docs.apimaker.dev/v1/docs/apis-security/api-group-permission.html) grants this system API, in `x-am-authorization`) or `IS_PUBLIC`. Without settings it is `NO_ACCESS` : your code calls it through `g.sys`, the admin panel tests it, and an HTTP call is refused.
- The settings can also cache the answer or require person tokens (`authProviders`) ; [pre and post hooks](https://docs.apimaker.dev/v1/docs/apis-all/hooks/preHook-api.html) run around it like around any API.
- The [request headers](https://docs.apimaker.dev/v1/docs/apis-all/header/requestHeader.html) apply : `x-am-response-case`, `x-am-content-type-response`, `x-am-internationalization`, `x-am-tenant-username`…

## Errors

| Code | When |
|---|---|
| `400` | The body is wrong : the message names the missing or invalid key. |
| `401` | No valid API user token, or the API is `NO_ACCESS` : `You are not authorized to access this API.` |
| `403` | No group grants this system API. |

## Related

- [All APIs at a glance](https://docs.apimaker.dev/v1/docs/apis-all/overview.html) · [Response format](https://docs.apimaker.dev/v1/docs/apis-all/response-format.html) · [System API settings](https://docs.apimaker.dev/v1/docs/settings/systemApiSettings.html) · [System APIs from code](https://docs.apimaker.dev/v1/examples/sys/system/system.html)
