List API keys
$client->listApiKeys()
We released a new version of the PHP API client in public beta. Read the beta documentation for more information.
We released a new version of the JavaScript API client in public beta. Read the beta documentation for more information.
We released a new version of the Java API client in public beta. Read the beta documentation for more information.
You’re currently reading the JavaScript API client v4 documentation. Check the migration guide to learn how to upgrade from v3 to v4. You can still access the v3 documentation.
You’re currently reading the Ruby API client v2 documentation. Check the migration guide to learn how to upgrade from v1 to v2. You can still access the v1 documentation.
About this method
Get a list of API keys.
Examples
Read the Algolia CLI documentation for more information.
List existing keys
1
$client->listApiKeys();
Parameters
This method doesn't take any parameters.
Response
This section shows the JSON response returned by the API.
Each API client encapsulates this response inside objects specific to the programming language,
so that the actual response might be different.
You can view the response by using the getLogs
method.
Don’t rely on the order of attributes in the response, as JSON doesn’t guarantee the ordering of keys in objects.
JSON format
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"keys": [
{
"value": "0eb3e6308abccdf9b67d70ddacb418b4",
"createdAt": 1513462891,
"acl": ["search"],
"validity": 0
},
{
"value": "90dff5755e694f341fe68aaf6e41a6d4"
"createdAt":1470244596,
"acl":["search"],
"validity":0,
"description": "Search-only API Key"
},
{
"value": "d6a23f212331969e41493051ede9865f",
"createdAt": 1513610838,
"acl": ["search"],
"validity": 0
}
]
}
Field | Description |
---|---|
keys
|
list of
|
keys âž” (api key)
Field | Description |
---|---|
value
|
string
The API key. |
createdAt
|
number
The timestamp at which the key has been created. Since admin API keys don’t have a creation date, this field isn’t returned for admin API keys. |
acl
|
list
Set of permissions associated with the key. The possible access controls are:
|
validity
|
integer
Timestamp of the date at which the key expires. A value of |
indexes
|
list
The list of targeted indices. This field isn’t returned when empty. |
description
|
string
Description for the key. This field isn’t returned when the description is empty. |
maxHitsPerQuery
|
integer
Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced and the field is not returned. |
maxQueriesPerIPPerHour
|
integer
Maximum number of API calls per hour allowed from a given IP address or a user token. Each time an API call is performed with this key, a check is performed. If the IP address or the user token at the origin of the call made more than the specified number of queries within the last hour, the API returns a 429 (Too Many Requests) status code. If zero, the field is not returned. |
queryParameters
|
URL-encoded query string
List query parameters that are applied for each query made with this API key. If empty, the field is not returned and no query parameters are applied. |
referers
|
list
Lists referrer restrictions for this API key.
Leading or trailing asterisks ( For example:
If empty, this field isn’t returned and all referrers are allowed. |