Skip to main content
Usage
algolia apikeys create [flags]

Examples

Create a new API key targeting the index β€œMOVIES”, with the β€œsearch” and β€œbrowse” ACL and a description:
algolia apikeys create --indices MOVIES --acl search,browse --description "Search & Browse API Key"
Create a new API key targeting the indices β€œMOVIES” and β€œSERIES”, with the β€œhttps://example.com” referer, with a validity of 1 hour and a description:
algolia apikeys create -i MOVIES,SERIES --acl search -r "https://example.com" --u 1h -d "Search-only API Key for MOVIES & SERIES"

Flags

--acl
API key’s ACL.search: can perform search operations. browse: can retrieve all index data with the browse endpoint. addObject: can add or update records in the index. deleteObject: can delete an existing record. listIndexes: can get a list of all indices. deleteIndex: can delete an index. settings: can read all index settings. editSettings: can update all index settings. analytics: can retrieve data with the Analytics API. recommendation: can interact with the Recommendation API. usage: can retrieve data with the Usage API. logs: can query the logs. seeUnretrievableAttributes: can retrieve unretrievableAttributes for all operations that return records.
-d, --description
Describe an API key to help you identify its uses.
-i, --indices
Index names or patterns that this API key can access. By default, an API key can access all indices in the same application.You can use leading and trailing wildcard characters (*). For example, dev_* matches all indices starting with dev_. *_dev matches all indices ending with _dev. *_products_* matches all indices containing products.
-r, --referers
Specify the list of referrers that can perform an operation. You can use the wildcard character (*) to match subdomains or entire websites.
-u, --validity
Duration (in seconds) after which the API key expires. By default (a value of 0), API keys don’t expire.
⌘I