Skip to content
This page View Markdown Open in ChatGPT Open in Claude

Reset system API cache

Drops the cached answers of a system API whose settings 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

The call

Body
{ "name": "Get table meta data" }
Body : several, one for a tenant
[ { "name": "Get table meta data" }, { "name": "Get secret key-keys", "tenantUsername": "acme" } ]
Answer
{ "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 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, Multi tenant instance updated, Is valid connection string. An unknown name gives -1 and a 404 in errors.

From code

await g.sys.cache.resetCacheSystemApis('Get table meta data');
await g.sys.cache.reset_cache_system_apis('Get table meta data')
$g->sys->cache->resetCacheSystemApis('Get table meta data');
await g.Sys.Cache.ResetCacheSystemApis("Get table meta data");
if _, err := g.Sys.Cache.ResetCacheSystemApis("Get table meta data"); err != nil {
    return nil, err
}
g.sys.cache.reset_cache_system_apis("Get table meta data")?;
g.sys.cache.resetCacheSystemApis("Get table meta data");
g.sys.cache.resetCacheSystemApis("Get table meta data")

A tenant

  • The cache of a system API called for one tenant of a multi-tenant instance, with the x-am-tenant-username header. Without a tenant, the cache of every tenant is reset too.
await g.sys.cache.resetCacheSystemApis({ name: "SYSTEM_API_NAME", tenantUsername: "acme" });
await g.sys.cache.reset_cache_system_apis_of_tenant('SYSTEM_API_NAME', 'acme')
$g->sys->cache->resetCacheSystemApisOfTenant('SYSTEM_API_NAME', 'acme');
await g.Sys.Cache.ResetCacheSystemApisOfTenant("SYSTEM_API_NAME", "acme");
1
2
3
if _, err := g.Sys.Cache.ResetCacheSystemApisOfTenant("SYSTEM_API_NAME", "acme"); err != nil {
    return nil, err
}
g.sys.cache.reset_cache_system_apis_of_tenant("SYSTEM_API_NAME", "acme")?;
g.sys.cache.resetCacheSystemApisOfTenant("SYSTEM_API_NAME", "acme");
g.sys.cache.resetCacheSystemApisOfTenant("SYSTEM_API_NAME", "acme")

Access, headers and errors

  • Over HTTP, a system API answers only once its settings open it : TOKEN_ACCESS (the token of an API user whose group grants this system API) or IS_PUBLIC. Without settings it is NO_ACCESS : only your code (g.sys) and the admin panel reach it.
  • The settings can also keep the answer in the cache, or ask for the token of a person (authProviders). Pre and post hooks run around it, as around any API.
  • It takes the request headers and answers the envelope. 401 : no valid token, or the API is NO_ACCESS. 403 : no group grants it. 400 : the body is wrong, and the message names the key.

Related : All APIs · System API settings · System APIs from code