Headers
-
Content-Type string Required
Payload content-type
Value is
application/json
.
Body
-
uid string
A uuid v4 to identify the API Key. If not specified, it's generated by Meilisearch.
-
actions array[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.
Values are
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
,metrics.get
,dumps.create
,snapshots.create
,version
,keys.get
,keys.create
,keys.update
,keys.delete
,experimental.get
, orexperimental.update
. -
indexes array[string] Required
A list of accesible 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_".
-
name string | null
A human-readable name for the key. null if empty.
-
description string | null
A description for the key. null if empty.
-
expiresAt string | null Required
Represent the expiration date and time as RFC 3339 format. null equals to no expiration time.
curl \
-X POST https://example.meilisearch.com:7700/keys \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Indexing Products API key","actions":["documents.add"],"indexes":["products"],"expiresAt":"2021-11-13T00:00:00Z"}'
# Headers
Content-Type: application/json
# Payload
{
"name": "Indexing Products API key",
"actions": [
"documents.add"
],
"indexes": [
"products"
],
"expiresAt": "2021-11-13T00:00:00Z"
}
{
"uid": "01b4bc42-eb33-4041-b481-254d00cce834",
"key": "d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4",
"name": "Indexing Products API key",
"description": null,
"actions": [
"documents.add"
],
"indexes": [
"products"
],
"expiresAt": "2021-11-13T00:00:00Z",
"createdAt": "2021-11-12T10:00:00Z",
"updatedAt": "2021-11-12T10:00:00Z"
}