anatools.anaclient.api_keys module

API Keys Functions

create_api_key(self, name, scope='user', organizationId=None, workspaceId=None, expires=None)
Creates a new API Key for the User; the key will only be visible once, so make sure to save it.

To use the API Key on login, ensure it is set as an environment variable called RENDEREDAI_API_KEY or with the APIKey parameter when initializing the anatools client. This call can only be used when logged in with email/password.

Parameters
  • name (str) – Name of the API Key.

  • scope (str) – Scope of the API Key, this can be set to ‘user’, ‘organization’, or ‘workspace’ to limit the scope of access for the API Key.

  • organizationId (str) – Organization ID to set the API Key access to a particular organization’s data.

  • workspaceId (str) – Workspace ID to set the API Key access to a particular workspace’s data.

  • expires (str) – Expiration date to set for the API Key. If no expiration is provided, the key will not expire.

Returns

API Key

Return type

str

delete_api_key(self, name)

Deletes the API key from user account. This call can only be used when logged in with email/password.

Parameters

name (str) – Name of the API Key to delete.

Returns

Success or failure message about API key deletion

Return type

bool

get_api_key_data(self, name)

Returns information about specific api key. This call will return data only when logged in with email/password.

Parameters

name (str) – Name of the API Key.

Returns

Information about API Key

Return type

[dict]

get_api_keys(self)

Queries the api keys associated with user’s account. This call will return data only when logged in with email/password.

Returns

Names of API keys associated with user’s account.

Return type

[dict]