# mba-cli key

> Read API keys (key-scoped)

Read API keys (key-scoped)

CLI version: `0.3.2`

## Commands

### mba-cli key get

Get one API key by id

Get single API key

Get a single API key by ID

Get one API key by id

Flags:

- `--id` (string): API key record id

API endpoints:

- GET /management/api-keys/{id} — https://mybusinessapp.co.za/developers/api/api-key#tag/APIKey/getSingleAPIKey

### mba-cli key ls

List API keys

Get all API keys

Get all the API keys for the current tenant

List API keys

Flags:

- `--all` (bool, default `false`): Return all keys (paginate=false)
- `--limit` (int, default `20`): Items per page
- `--page` (int, default `1`): Page number

API endpoints:

- GET /management/api-keys — https://mybusinessapp.co.za/developers/api/api-key#tag/APIKey/getAllAPIKeys

### mba-cli key usage

Show API key usage (tenant-wide, or one key with --id)

Get tenant API key usage

Get the monthly usage statistics for all API keys across the tenant

---

Get single API key usage

Get the daily usage statistics for a single API key

Show API key usage (tenant-wide, or one key with --id)

Flags:

- `--days` (int, default `0`): Key usage window in days
- `--id` (string): API key record id (omit for tenant usage)
- `--months` (int, default `0`): Tenant usage window in months

API endpoints:

- GET /management/api-keys/usage — https://mybusinessapp.co.za/developers/api/api-key#tag/APIKey/getTenantAPIKeyUsage
- GET /management/api-keys/{id}/usage — https://mybusinessapp.co.za/developers/api/api-key#tag/APIKey/getSingleAPIKeyUsage

---

[Rendered page](https://mybusinessapp.co.za/developers/cli/reference/key)

© MyBusinessApp (Pty) Ltd. Proprietary documentation — do not republish.
