Keys

Each instance of MeiliSearch has three keys: a master, a private, and a public. Each key has a given set of permissions on the API routes.

You must have the master key to access the keys route.

More information about the keys and their rights.

Get keys

GET

  1. /keys

Get the private and public key.

WARNING

You must have the master key to access this route.

Example

<>

cURL

JS

Python

PHP

Java

Ruby

Go

Rust

Swift

Dart

  1. curl \
  2. -H "X-Meili-API-Key: 123" \
  3. -X GET 'http://localhost:7700/keys'
  1. client.getKeys()
  1. client.get_keys()
  1. $client->getKeys();
  1. //Not yet implemented
  1. client.keys
  1. client.GetKeys()
  1. let keys: Keys = client.get_keys().await.unwrap();
  1. client.keys { (result: Result<Key, Swift.Error>) in
  2. switch result {
  3. case .success(let key):
  4. print(key)
  5. case .failure(let error):
  6. print(error)
  7. }
  8. }
  1. await client.getKeys();

Response: 200 Ok

  1. {
  2. "private": "8c222193c4dff5a19689d637416820bc623375f2ad4c31a2e3a76e8f4c70440d",
  3. "public": "948413b6667024a0704c2023916c21eaf0a13485a586c43e4d2df520852a4fb8"
  4. }