Meilisearch icon

Meilisearch

Consume Meilisearch API

Keys → Create An API Key

AI-generated

Overview

This node operation creates a new API key in Meilisearch with specified permissions and access controls. It allows users to define the key's name, description, permitted API actions, accessible index UIDs, and expiration date. Additionally, it supports waiting for the key creation task to complete with configurable polling options. This is useful for managing API access securely and programmatically within Meilisearch environments.

Use Case Examples

  1. Creating an API key with read and write permissions on specific indexes.
  2. Generating a key that grants all actions for administrative purposes.
  3. Setting an expiration date for temporary API keys to enhance security.

Properties

Name Meaning
Name The name of the API key to be created.
Description A description for the API key to provide context or usage details.
Actions An array of API actions permitted for the key, represented as strings. This defines what operations the key can perform on authorized indexes.
Index UIDs Comma delimited list of Index UID(s) to give access to.
Expires At Date and time when the key will expire, represented in RFC 3339 format. Null if the key never expires.
Wait for Completion Whether to wait for the task to complete before returning. If enabled, the node will poll the task status until it succeeds, fails, or is canceled.
Use Exponential Backoff If enabled, the polling interval will gradually increase to reduce API calls. If disabled, uses a fixed polling interval.
Polling Interval (ms) Fixed interval between polling requests in milliseconds (used when exponential backoff is disabled).
Initial Polling Interval (ms) Starting interval between polling requests in milliseconds. The interval increases by 1.5x every 5 attempts.
Max Polling Interval (ms) Maximum interval between polling requests. Exponential backoff will not exceed this value.
Timeout (seconds) Maximum time to wait for task completion in seconds (default: 5 minutes).

Output

JSON

  • taskUid - Unique identifier of the task created for the API key creation.
  • status - Status of the task (e.g., succeeded, failed, canceled).
  • details - Additional details about the task result or error information.

Dependencies

  • An API key credential for Meilisearch API authentication.

Troubleshooting

  • Common issues include invalid or insufficient permissions in the actions array, incorrect index UIDs, or expired credentials.
  • If the task does not complete within the specified timeout, an error is thrown indicating the timeout duration.
  • Ensure the API key credential is correctly configured and the host URL is accessible.

Discussion