younifyd
Menu

Create API key

Create API key

POST/keys

Use it in a workflow

  1. Add a step and choose the Meilisearch connector.
  2. Pick the Create API key action (under Keys).
  3. Fill in the fields below, then reference the result from later steps as {{createApiKey.response.data}}.

Request

Request body

Enter the body as JSON in the step's Body field.

descriptionstring | null

A description for the key. `null` if empty.

namestring | null

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

uidstring | null

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

actionsarray<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. Valid actions include: `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`, `dumps.create`, `snapshots.create`, `version`, `keys.get`, `keys.create`, `keys.update`, `keys.delete`. Use `*` to grant all actions.

indexesarray<string>required

A list of accessible 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_`.

expiresAtstring | nullrequired

Represent the expiration date and time as RFC 3339 format. `null` equals to no expiration time. Set to `null` to create a key that never expires. Once a key is past its expiry date, using it returns an error.

json
{
  "actions": [
    "documents.add"
  ],
  "indexes": [
    "products"
  ],
  "expiresAt": "2025-01-01T00:00:00Z",
  "description": null,
  "name": "Indexing Products API key",
  "uid": "01b4bc42-eb33-4041-b481-254d00cce834"
}

Response

Returns 201 with an object. Read it in later steps with {{createApiKey.response.data.<field>}}.

namestring | null

A human-readable name for the API key. Use this to identify the purpose of each key, such as "Frontend Search Key" or "Admin Key for CI/CD". This is optional and can be `null`.

descriptionstring | null

A longer description explaining the purpose or usage of this API key. Useful for documenting why the key was created and how it should be used. This is optional and can be `null`.

keystring

The actual API key string to use in the `Authorization: Bearer <key>` header when making requests to Meilisearch. Keep this value secret and never expose it in client-side code.

uidstring (uuid)

The unique identifier (UUID) for this API key. Use this to update or delete the key. The UID remains constant even if the key's name or description changes.

actionsarray<string>

The list of actions (permissions) this key is allowed to perform. Examples include `documents.add`, `search`, `indexes.create`, `settings.update`, etc. Use `*` to grant all permissions.

indexesarray<string>

The list of index UIDs this key can access. Use `*` to grant access to all indexes, including future ones. Patterns are also supported, e.g., `movies_*` matches any index starting with "movies_".

expiresAtstring | null

The expiration date and time of the key in RFC 3339 format. After this time, the key will no longer be valid for authentication. Set to `null` for keys that never expire.

createdAtstring (date-time)

The date and time when this API key was created, formatted as an RFC 3339 date-time string. This is automatically set by Meilisearch and cannot be modified.

updatedAtstring (date-time)

The date and time when this API key was last modified, formatted as an RFC 3339 date-time string. This is automatically updated by Meilisearch when the key's name or description changes.

json
{
  "key": "string",
  "uid": "00000000-0000-0000-0000-000000000000",
  "actions": [
    "*"
  ],
  "indexes": [
    "string"
  ],
  "createdAt": "2025-01-01T00:00:00Z",
  "updatedAt": "2025-01-01T00:00:00Z",
  "name": "string",
  "description": "string",
  "expiresAt": "2025-01-01T00:00:00Z"
}

Need more? See the Meilisearch guide for connection setup and behaviour shared by every action.

Was this page helpful?