# Get Table Meta Data Example

> Example showing how to retrieve metadata for database tables using API Maker.

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

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

### Get table metadata System API

Get table metadata using global object 'g'.

```ts
await g.sys.system.getTableMeta({
    instance: 'INSTANCE_NAME',
    database: 'DATABASE_NAME',
    collection: 'COLLECTION_NAME'
});
```

### Multi-tenant
- `instance: "crm::acme"` reads the table in the database of the tenant `acme` of the [multi-tenant](https://docs.apimaker.dev/v1/docs/features/multi-tenant.html) instance `crm`. In a custom API called for a tenant, `instance: "crm"` reads it in the database of that tenant.

```ts
await g.sys.system.getTableMeta({
    instance: 'crm::acme',
    database: 'crm',
    collection: 'customers'
});
```

## Related

- [Get table meta system API](https://docs.apimaker.dev/v1/docs/apis-all/system-apis/system-generated-get-table-meta-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)
