API Reference / API Methods / API keys / Get API Key permissions
Feb. 26, 2019

Get API Key Permissions

Required API Key: Any
Method signature
$client->getApiKey(apiKey)

About this method

Get the permissions of an API key. When initializing the client using the Admin API key, you can request information on any of your application’s API keys. When using a non-admin API key, you can only retrieve information on this specific API key.

Examples

To get the permissions of a given key:

1
2
// Get the rights of a key
$res = $client->getApiKey('YourSearchOnlyAPIKey');

Parameters

apiKey
type: string
default: no default
Required

API Key to retrieve permissions for

Response

In this section we document the JSON response returned by the API. Each language will encapsulate this response inside objects specific to the language and/or the implementation. So the actual type in your language might differ from what is documented.

JSON format

1
2
3
4
5
6
7
{
  "value":"d6386f212331969e41493051ede9a25f",
  "createdAt":1513610838,
  "acl":["search"],
  "validity":0,
  "description": "my key description"
}
value
string

The api key value.

createdAt
string

The date at which the key has been created.

acl
list

List of permissions the key contains. The possible acls are:

  • search: Allows search.
  • browse: Allows retrieval of all index contents via the browse API.
  • addObject: Allows adding/updating an object in the index. (Copying/moving indices are also allowed with this permission.)
  • deleteObject: Allows deleting an existing object.
  • deleteIndex: Allows deleting index content.
  • settings: allows getting index settings.
  • editSettings: Allows changing index settings.
  • analytics: Allows retrieval of analytics through the analytics API.
  • listIndexes: Allows listing all accessible indices.
  • logs: Allows getting the logs.
  • seeUnretrievableAttributes: Disables the unretrievableAttributes feature for all operations returning records.
validity
integer

Timestamp of the date at which the key expires. (0 means it will not expire automatically).

indexes
list

The list of targeted indices, if any.

description
string

Description of the key, if set.

Did you find this page helpful?