Get API Keys

GET /keys

Get API Keys

Query parameters

  • limit number

    Maximum number of results to return.

    Default value is 20.

  • offset number

    Number of results to skip.

    Default value is 0.

Responses

  • 200 application/json

    Ok

    Hide response attributes Show response attributes object
    • results array[object] Required

      API keys are stored and managed by the master key holder and the default admin key holder. These are the keys used by the technical teams to interact with Meilisearch at the level of the client/server code. API keys can have restrictions on which methods can be accessed via an actions list; they can also expiresAt a specific date time and be restricted to a specific set of indexes.

      Hide results attributes Show results attributes object
      • uid string

        A uuid v4 to identify the API Key. If not specified, it's generated by Meilisearch.

      • key string

        The derived key to use in the Authorization header to authorize requests. Generated by Meilisearch with an HMAC, using an SHA-256 hash, of the uid and the master key.

      • actions array[string] Required

        A list of actions permitted for the key. [""] for all actions. The * character can be used as a wildcard when located at the last position. e.g. `documents.` to authorize access on all documents endpoints.

        Values are search, documents.add, documents.get, documents.delete, indexes.create, indexes.get, indexes.update, indexes.delete, indexes.swap, tasks.get, tasks.cancel, tasks.delete, settings.get, settings.update, stats.get, metrics.get, dumps.create, snapshots.create, version, keys.get, keys.create, keys.update, keys.delete, experimental.get, or experimental.update.

      • indexes array[string] Required

        A list of accesible indexes permitted for the key. [""] for all indexes. The * character can be used as a wildcard when located at the last position. e.g. "products_"" to allow access to all indexes whose names start with "products_".

      • name string | null

        A human-readable name for the key. null if empty.

      • description string | null

        A description for the key. null if empty.

      • expiresAt string | null Required

        Represent the expiration date and time as RFC 3339 format. null equals to no expiration time.

      • Represent the date and time as RFC 3339 format when the API key has been created. Generated by Meilisearch.

      • updatedAt string | null

        Represent the date and time as RFC 3339 format when the API key has been updated. Generated by Meilisearch.

    • limit integer Required

      Limit given for the query. If limit is not provided as a query parameter, this parameter displays the default limit value.

    • offset integer Required

      Offset given for the query. If offset is not provided as a query parameter, this parameter displays the default offset value.

    • total integer Required

      Total number of browsable results using offset/limit parameters for the given resource.

  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
GET /keys
curl \
 -X GET https://example.meilisearch.com:7700/keys \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "results": [
    {
      "uid": "01b4bc42-eb33-4041-b481-254d00cce834",
      "key": "d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4",
      "name": "An API Key",
      "description": null,
      "actions": [
        "documents.add"
      ],
      "indexes": [
        "movies"
      ],
      "expiresAt": "2022-11-12T10:00:00Z",
      "createdAt": "2021-11-12T10:00:00Z",
      "updatedAt": "2021-11-12T10:00:00Z"
    }
  ],
  "limit": 20,
  "offset": 0,
  "total": 1
}
Response examples (401)
{
  "message": "The Authorization header is missing. It must use the bearer authorization method.",
  "code": "missing_authorization_header",
  "type": "auth",
  "link": "https://docs.meilisearch.com/errors#missing_authorization_header"
}