Manages Meilisearch API keys.
Summary
Functions
Creates a new API key.
Creates a new API key, raising on error.
Deletes an API key.
Deletes an API key, raising on error.
Retrieves a single API key by its value or UUID.
Retrieves a single API key, raising on error.
Lists all API keys.
Lists all API keys, raising on error.
Updates an existing API key. Only the name and description can be updated.
Updates an API key, raising on error.
Functions
Creates a new API key.
Keys are automatically camelized from snake_case to camelCase.
Options
name: Human-readable name.description: Purpose of the key.actions: List of permitted actions (e.g.["search"]).indexes: List of accessible indexes.expires_at/expiresAt: Expiration date (RFC 3339 string).
Examples
params = %{
name: "Search Key",
actions: ["search"],
indexes: ["*"],
expires_at: nil
}
Meili.Key.create(params)
Meili.Key.create(client, params)
Creates a new API key, raising on error.
Deletes an API key.
Examples
Meili.Key.delete("key_value")
Meili.Key.delete(client, "key_value")
Deletes an API key, raising on error.
Retrieves a single API key by its value or UUID.
Examples
Meili.Key.get("some-key-value-or-uuid")
Meili.Key.get(client, "some-key-value-or-uuid")
Retrieves a single API key, raising on error.
Lists all API keys.
Options
limit: The maximum number of keys to return.offset: The number of keys to skip.
Examples
Meili.Key.list()
Meili.Key.list(limit: 5)
Meili.Key.list(client, limit: 5)
Lists all API keys, raising on error.
Updates an existing API key. Only the name and description can be updated.
Examples
Meili.Key.update("key_value", name: "New Name", description: "New Description")
Meili.Key.update(client, "key_value", %{name: "New Name"})
Updates an API key, raising on error.