Skip to content

Commit d61a25b

Browse files
Clarify that only custom API keys can be reused after migration (#3003)
1 parent 9a66e2c commit d61a25b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

reference/api/keys.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,12 @@ Accessing the `/keys` route without setting a master key will throw a [`missing_
5757

5858
This value is also used as the `{key}` path variable to [update](#update-a-key), [delete](#delete-a-key), or [get](#get-one-key) a specific key.
5959

60-
<Capsule intent="note">
61-
Since `key` is a hash of the `uid` and master key, `key` values are deterministic between instances sharing the same configuration. You can determine the value of an API key with the following command, replacing `HYPHENATED_UUID` and `MASTER_KEY` with the correct values for your key and instance:
60+
If the master key changes, all `key` values are automatically changed.
6261

63-
```sh
64-
echo -n $HYPHENATED_UUID | openssl dgst -sha256 -hmac $MASTER_KEY
65-
```
62+
<Capsule intent="note" title="Reusing API keys between instances">
63+
Custom API keys are deterministic: `key` is a SHA256 hash of the `uid` and master key. To reuse custom API keys, launch the new instance with the same master key and recreate your API keys with the same `uid`.
6664

67-
This also means that, if the master key changes, all `key` values are automatically changed.
65+
**You cannot reuse default API keys between instances.** Meilisearch automatically generates their `uid`s the first time you launch an instance.
6866
</Capsule>
6967

7068
### `actions`

0 commit comments

Comments
 (0)