Skip to main content
This page documents an earlier version of the API client. For the latest version, see Retrieve API key permissions.
Required ACL: Any The scope of the permissions you can see is different when you initialize the search client with an Admin API key. When initializing the client using the admin API key, you can request information for any of your application’s API keys. When using a non-administrator API key, you can only retrieve information relating to that specific API key, and the description will be obfuscated for security purposes, its contents replaced by <redacted>.

Examples

To get the permissions of a given key:
// Gets the rights of a key
var res = client.GetApiKey("YourSearchOnlyAPIKey");

// Asynchronous
var res = await client.GetApiKeyAsync("YourSearchOnlyAPIKey");

Parameters

apiKey
string
required
API key for which to retrieve its permissions.

Response

acl
string[]
Set of permissions associated with the key.The possible access controls are:
  • Search (search): allowed to perform search operations.
  • Browse Index (browse): allowed to retrieve all index data with the browse endpoint.
  • Add records (addObject): allowed to add or update records in the index.
  • Delete records (deleteObject): allowed to delete an existing record.
  • List indices (listIndexes): allowed to get a list of all existing indices.
  • Delete index (deleteIndex): allowed to delete an index.
  • Get index settings (settings): allowed to read all index settings.
  • Set index settings (editSettings): allowed to update all index settings.
  • Use analytics API (analytics): allowed to retrieve data with the Analytics API.
  • Use recommendation API (recommendation): allowed to interact with the Recommendation API.
  • Use usage API (usage): allowed to retrieve data with the Usage API.
  • Access logs (logs): allowed to query the logs.
  • Get unretrievable attributes (seeUnretrievableAttributes): allowed to retrieve unretrievableAttributes for all operations that return records.
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.
description
string
Description of the key. This field isn’t returned when the description is empty.
indexes
string[]
The list of targeted indices. This field isn’t returned when 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—or the user-token if it’s set—at the origin of the call did more than the specified number of calls within the last hour, the API returns a 429 (Too Many Requests) status code.If zero, the field is not returned.
queryParameters
string
Force some query parameters to be applied for each query made with this API key. You can force all query parameters like: typoTolerance=strict&ignorePlurals=false&filters=rights:public.If empty, the field is not returned.
referers
string[]
Restrict this new API key to specific referers. If empty or blank, defaults to all referers. You can specify a pattern with either a leading or trailing wildcard (*), or both.For example, https://algolia.com/* matches all referers starting with https://algolia.com/ and *.algolia.com matches all referers ending with .algolia.com. You can combine both, as in *algolia.com* to allow the domain algolia.com.If empty, the field is not returned.
validity
integer
Timestamp of the date at which the key expires. A value of 0 means the key never expires.
value
string
The API key.

Response as JSON

This section shows the JSON response returned by the API. Each API client wraps this response in language-specific objects, so the structure may vary. To view the response, use the getLogs method. Don’t rely on the order of properties—JSON objects don’t preserve key order.
JSON
{
  "value":"d6386f212331969e41493051ede9a25f",
  "createdAt":1513610838,
  "acl":["search"],
  "validity":0,
  "description": "my key description"
}
I