Skip to content

airt api-key

Set of commands for managing the API keys in airt service.

Both the API key and the token can be used for accessing the airt services. However, there is a slight difference in generating and managing the two.

For generating the API key, you first need to get the token. Please refer to the documentation of the airt token command for generating one.

Once successfully authenticated, you can create any number of API keys and set an expiration date for each key individually. Also, you can use the other methods available in the APIKey class to list, revoke the keys at any time.

You can now set the API key in the environment variable AIRT_SERVICE_TOKEN and start accessing airt services with it.

Usage:

$ airt api-key [OPTIONS] COMMAND [ARGS]...

Options:

  • --install-completion: Install completion for the current shell.
  • --show-completion: Show completion for the current shell, to copy it or customize the installation.
  • --help: Show this message and exit.

Commands:

  • create: Create a new API key in airt service
  • details: Return details of the given API Key.
  • ls: List available API keys.
  • rm: Remove the API key from airt service.

airt api-key create

Create a new API key in airt service

Usage:

$ airt api-key create [OPTIONS]

Options:

  • -n, --name TEXT: Name for the new API key [required]
  • -e, --expiry INTEGER: The validity for the newly created API key in the number of days [required]
  • -q, --quiet: Output access token only. [default: False]
  • -d, --debug: Set logger level to DEBUG and output everything. [default: False]
  • --help: Show this message and exit.

airt api-key details

Return details of the given API Key.

Usage:

$ airt api-key details [OPTIONS] ID

Arguments:

  • ID: The API Key ID in the airt service. [required]

Options:

  • -d, --debug: Set logger level to DEBUG and output everything. [default: False]
  • --help: Show this message and exit.

airt api-key ls

List available API keys.

Usage:

$ airt api-key ls [OPTIONS]

Options:

  • -o, --offset INTEGER: The number of records to offset at the beginning of the API keys list. If None, then the default value 0 will be used. [default: 0]
  • -l, --limit INTEGER: The maximum number of records to return from the server. If None, then the default value 100 will be used. [default: 100]
  • --disabled: If set to True, then the disabled API keys will also be included in the result. [default: False]
  • -q, --quiet: Output only ids of API keys separated by space [default: False]
  • -d, --debug: Set logger level to DEBUG and output everything. [default: False]
  • --help: Show this message and exit.

airt api-key rm

Remove the API key from airt service.

Usage:

$ airt api-key rm [OPTIONS] ID

Arguments:

  • ID: The API Key ID in the airt service. [required]

Options:

  • -q, --quiet: Output the deleted API key id only. [default: False]
  • -d, --debug: Set logger level to DEBUG and output everything. [default: False]
  • --help: Show this message and exit.
Back to top