# Multi Tenant Instance Updated Example

> Tell every API Maker server that the connection string of a tenant of a multi-tenant instance changed, using API Maker's g.sys.system.multiTenantInstanceUpdated.

Source: https://docs.apimaker.dev/v1/examples/sys/system/multiTenantInstanceUpdated.html

`g.sys.system.multiTenantInstanceUpdated` calls the [multi tenant instance updated system API](https://docs.apimaker.dev/v1/docs/apis-all/system-apis/system-generated-multi-tenant-instance-updated-api.html) from your code, whatever the settings of that API say about HTTP callers.

### Multi tenant instance updated System API

After the connection string of a tenant of a [multi-tenant](https://docs.apimaker.dev/v1/docs/features/multi-tenant.html) instance changed in the tenants table, tell API Maker. Every server drops the connection pools of that tenant, and the next request of the tenant connects with the new connection string.

```ts
await g.sys.system.multiTenantInstanceUpdated({ instanceName: 'crm', username: 'acme' });
```

Several instances or tenants at once, each item answered on its own:

```ts
const output = await g.sys.system.multiTenantInstanceUpdated([
    { instanceName: 'crm', username: 'acme' },
    { instanceName: 'billing', username: 'acme' },
]);
// [{ success: true, data: true }, { success: false, data: false, error: { code: 404, message: "..." } }]
```

## Related

- [Multi tenant instance updated system API](https://docs.apimaker.dev/v1/docs/apis-all/system-apis/system-generated-multi-tenant-instance-updated-api.html) · [All system APIs from code](https://docs.apimaker.dev/v1/examples/sys/system/system.html) · [The global object g](https://docs.apimaker.dev/v1/docs/pre-defined-terms/global-object-g.html)
